jQuery in Action, 3rd edition
The moose likes JSP and the fly likes Standards for splitting up JSP pages. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Standards for splitting up JSP pages." Watch "Standards for splitting up JSP pages." New topic

Standards for splitting up JSP pages.

Jack Numen
Ranch Hand

Joined: Nov 09, 2011
Posts: 42

I have a requirement of splitting up a JSP page into two or more of each less than 65KB size.

I am using jsp:include
I have declared Class varibles in <%! %> thinking of using the same in the split pages instead of redeclaration.As expected it threw

undefined variables in the splitted pages.

Now i redeclared the variables in all the splitted up pages.
In the jsp:param tag i am passing the variables and fetching the same values in the split up pages using




Is this the right way to do it..Or is there any other wway to escape this redeclaration in the partOne.jsp(split up page).
jatan bhavsar
Ranch Hand

Joined: Jul 23, 2008
Posts: 297

hi Jack,

declaring variable global with ! mark will not work in what you are trying to achieve.When you use jsp:include it generates the separate servlets for included jsp.so the way you are passing the parameters is correct.Global declaration will not be useful.

And have you tried to compile seprate jsp and put it into the weblogic server.also it will be useful here if you add the reference of previous discussion in struts forum.

Jack Numen
Ranch Hand

Joined: Nov 09, 2011
Posts: 42

Thanks Bhavsar.

Here is the link to the previous discussion of splitting up of JSPs


Regarding JSP compilation i am sure it will work as the maximum size allowed is 65KB.
Spltting up is cumbersome as it will have maintenance overhead.
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63852

If you want to know what's "standard" and accepted best practice then you should remove all Java code and scriptlets from the JSPs. They've been discredited and obsolete for over 10 years.

As of JSP2 introduced in 2002, you should use the JSTL and EL.

See this JspFaq entry.

[Asking smart questions] [About Bear] [Books by Bear]
Don't get me started about those stupid light bulbs.
subject: Standards for splitting up JSP pages.
It's not a secret anymore!