File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes include file directive, how the included jsp file is built? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "include file directive, how the included jsp file is built?" Watch "include file directive, how the included jsp file is built?" New topic
Author

include file directive, how the included jsp file is built?

Alton Hernandez
Ranch Hand

Joined: May 30, 2003
Posts: 443
Hi,
I have 2 jsp files where one is included in the other:
MAIN FILE: Test1.jsp

Included File aramRequest.jsp

When these codes are parsed, the resulting java files are as follows:
Test1_jsp.java

paramRequest_jsp.java

What I find interesting here is that part of the jsp code (starting from line Attributes in this Request:) that was in the included file[i]paramRequest.jsp[i] was not in its final generated java code, but instead can only be found in the generated main java file.
My question now is what made these lines different from the rest?
For your information I am using Tomcat 5.x.
Thanks.
Al
Prakash Dwivedi
Ranch Hand

Joined: Sep 28, 2002
Posts: 452
In Test1.jsp you have included ParamRequest.jsp statically and not dynamically, Hence all the generated code of ParamRequest.jsp is included in the generated java file for Test1.jsp.
If instead of
<%@ include file="/paramRequest.jsp"%>
you use
<jsp:include page="/paramRequest.jsp"/>
result will be different.


Prakash Dwivedi (SCJP2, SCWCD, SCBCD)
"Failure is not when you fall down, Its only when you don't get up again"
Alton Hernandez
Ranch Hand

Joined: May 30, 2003
Posts: 443
Hi Prakash,
But what I am wondering is why only part of ParamRequest.jsp is generated in the intermediate file ParamRequest_jsp.java.
If you take a look at the file ParamRequest.jsp, you will notice that the following codes are NOT in the ParamRequest_jsp.java.

Instead, they appeared in the Test1_jsp.java ONLY.
So why did the intermediate code ParamRequest_jsp.java ignored these lines?
[ February 24, 2004: Message edited by: Alton Hernandez ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: include file directive, how the included jsp file is built?