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
Solved

How to include a file in a JSP?

Posted on 2004-04-22
5
826 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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Animated .jpg? 13 95
table example 4 32
going to wrong jsp page 2 33
collection output issue 9 36
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…
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 how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

790 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