Solved

How to include a file in a JSP?

Posted on 2004-04-22
5
821 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
  • 3
  • 2
5 Comments
 

Author Comment

by:sdesar
ID: 10894451
increasing points
0
 
LVL 2

Accepted Solution

by:
PaulS_III earned 50 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Preface In the first article: A Better Website Login System (http://www.experts-exchange.com/A_2902.html) I introduced the EE Collaborative Login System and its intended purpose. In this article I will discuss some of the design consideratio…
This article covers the basics of the Sass, which is a CSS extension language. You will learn about variables, mixins, and nesting.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

743 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now