?
Solved

How to include a file in a JSP?

Posted on 2004-04-22
5
Medium Priority
?
836 Views
Last Modified: 2013-11-24
Hello,

I have this Tree.jsp.  I need to include a GetPreview.jsp on the right of this GetTree.jsp.
The GetPreview.jsp with its paramters looks like this -
http://botdev.spimageworks.com:9180/browseit/GetPreview.jsp?previewPath=//op/characters/bob-bobbie/bob_bobbie1-cg.jpg&serverName=ALIEN01&projectName=oseason&jsessionid=830F9EDF63A0EA8C9F8BD76724571C1F

I have created a table and 1 row <TR> and 2 <td> and in 1st column displays the GetTree and the 2nd column display the GetPreview.jsp

I don't the syntax to include a file with parameters in a jsp ? please advise!


//File -GetTree.jsp
<%@ taglib uri="taglib49.tld" prefix="tree" %>
<%@ taglib uri='http://java.sun.com/jstl/core' prefix='c' %>

<TABLE BORDER="2" >
<TR>
<TD>
<%

ProjectNode projectNode=null;

projectNode= BmxServletUtilities.getProject(session);
%>
<a href="http://www"> hello </a>
<tree:createTree defaultConnectors="false" treePicture="tree-icons/tree.gif" nodePicture="tree-icons/leaf.gif" openPicture="tree-icons/open.gif" dhtml="true" width="325" height="725">
 <tree:addNode open="false" code="<%=projectNode.getName() %>">
<%

...............

<%
synchronized (fChildNode) {
     final Enumeration gChildren = fChildNode.children();

while (gChildren.hasMoreElements())
{
      final Node gChildNode = (Node)(gChildren.nextElement());
%>    
<tree:addNode open="false" code="<%=gChildNode.getName() %>">
<%
synchronized (gChildNode) {
      final Enumeration hChildren = gChildNode.children();

while (hChildren.hasMoreElements())
{
     final Node hChildNode = (Node)(hChildren.nextElement());

%>
<tree:addNode open="false" code='<%="<a href=\\"GetPreview.jsp?previewPath=//"+nChildNode.getName()+ "/" +fChildNode.getName() + "/" + gChildNode.getName() + "/" +hChildNode.getName() + "&serverName=ALIEN01&projectName=oseason&jsessionid=" + session.getId() + "\\">" + hChildNode.getName()+"</a>"%>'/>
<%
}
}
%>
</tree:addNode>
<%
}
}
%>
</tree:addNode>
<%  
} // while
} // in synchronized
%>
 </tree:addNode>

<%  
} // while
}
%>
  </tree:addNode>
</tree:createTree>
</TD>
<TD>
HERE <c:out value="${s_name}" />
<%@include file="GetPreview.jsp" %>
</TD>
</TR>
</TABLE>
0
Comment
Question by:sdesar
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 

Author Comment

by:sdesar
ID: 10894451
increasing points
0
 
LVL 2

Accepted Solution

by:
PaulS_III earned 200 total points
ID: 10894861
can't you use something like:

<jsp:include page="{relativeURL | <%= expression %>}" flush="true" >
      <jsp:param name="parameterName"
            value="{parameterValue | <%= expression %>}" />+
</jsp:include>

Hope that helps


Paul
0
 

Author Comment

by:sdesar
ID: 10921687
I have a file called
 GetTree.jsp - this jsp displays a tree view of all the files.
 I want to include 1 other file within  this JSP such that when the user clicks on the links in GetTree.jsp it displays
 GetPreview.jsp on the Right Frame.

  the link for GetPreview within the GetTree.jsp(TreeView) looks like this -  <a href=\"GetPreview.jsp?dirPath=" + fixedPath  +"&serverName=" + serverName  + "&projectName=" + projectName  +  "&jsessionid=" + jsessionid  + "\"> preview</a>");



  What do I need to do the the GetTree.jsp to display the data with the
  TreeView on the left and the details ie GetPreview.jsp on the right frame

  And what code do I need to add to the data in the link in GetTree.jsp so
  that OnClick of the link will display GetPreview.jsp data  on the right
  frame

and GetPreview accepts these parameters -
<jsp:include page="GetPreview.jsp" flush="true">
  <jsp:param name="dirPath" value="season"/>
  <jsp:param name="serverName" value="ALIEN"/>
  <jsp:param name="projectName" value="oseason"/>
  <jsp:param name="jsessionid" value="<%=session.getId()%>"/>
</jsp:include>


  I  want to use framesets <FRAMESET> , instead on <TABLE>

 Please provide code on how to do this.

  Thanks!
0
 

Author Comment

by:sdesar
ID: 10933335
Thanks PaulS_III !
here are your excellent points!
0
 
LVL 2

Expert Comment

by:PaulS_III
ID: 10934505
Gee thanks. I didn't think I answered your question completely. I do hope you figured it out.
0

Featured Post

Create CentOS 7 Newton Packstack Running Keystone

A bug was filed against RDO for the installation of Keystone v3. This guide is designed to walk you through the configuration for using Keystone v3 with Packstack. You will accomplish this using various repos and the Answers file.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preface This article introduces an authentication and authorization system for a website.  It is understood by the author and the project contributors that there is no such thing as a "one size fits all" system.  That being said, there is a certa…
Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question