Go4Expert

Go4Expert (http://www.go4expert.com/)
-   JSP (http://www.go4expert.com/forums/jsp/)
-   -   splitting a JSP based on num of lines (http://www.go4expert.com/forums/splitting-jsp-based-num-lines-t5477/)

sakthi.abdullah 26Jul2007 19:57

splitting a JSP based on num of lines
 
One of my jsp files [say X.jsp] is causing "exceeding the 655353 size limit in Tomcat 5.5"

So I splitted that large jsp file based on the no of lines...
I <jsp:include>d the splitted jsp files inside X.jsp instead of the original contents..

BUT THAT IS NOT WORKING..

Someone tell me "splitting a jsp file based on the num of lines and using <jsp:include> "is the right way to do ????

sakthi.abdullah 26Jul2007 23:58

Re: splitting a JSP based on num of lines
 
Hi banking on that question,

I found out that if u physically split the file like small files 1000 lines or files of say 100 kb, You must use &lt; include &gt; tag...

sakthi.abdullah 27Jul2007 00:03

Re: splitting a JSP based on num of lines
 
But include tag doesn't serve the purpose .It physically includes the contents of the splitted files .Therefore during the main jsp file compilation,the error recurs saying:

SEVERE: Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: Unable to compile class for JSP:

An error occurred at line: 29 in the generated java file
The code of method _jspService(HttpServletRequest, HttpServletResponse) is exceeding the 65535 bytes limit Stacktrace:


So I have to use jsp:include which means meaningfully splitting the file..
I need help here ...

how to achieve this since the file contents change everytime....
I mean the jsp file is produced by some other machine which I have to process...
I need a fool-proof mechanism whereby I can handle a large jsp file which itself changes ??

Please its an urgent requirement!

pradeep 27Jul2007 10:05

Re: splitting a JSP based on num of lines
 
You can split the file that way, you need to keep the Class source code in once piece! In .NET you can declare your class in fragments if you wish!

sakthi.abdullah 27Jul2007 15:14

Re: splitting a JSP based on num of lines
 
But that big jsp file is infact a javascript code!!!!!!

<%
response.setContentType("application/x-javascript");
response.setHeader("Cache-Control", "no-cache");
response.setHeader("Pramga", "no-cache");
%>

sonefuntion();
O("200511","200511");

var mhArray=new Array(
"ALL||ALL",
"06||06"
,"1N||1N"
,"1X||1X"
,"1Y||1Y"
,"21||21"
,"30||30"
,"3C||3C"
,"4J||4J"
}


Many arrays are dclared in this file spanning thousands of lines ..... That's why the JSP is big !! SO,how to tackle this?

pradeep 27Jul2007 15:32

Re: splitting a JSP based on num of lines
 
Why declare so many arrays?? Keep the data in a database, and fetch & use as required!

sakthi.abdullah 27Jul2007 15:38

Re: splitting a JSP based on num of lines
 
Quote:

Originally Posted by pradeep
Why declare so many arrays?? Keep the data in a database, and fetch & use as required!

Nice Suggestion!
i am a newbie!
Can you please explain on that how to do !!

Thanks,

pradeep 27Jul2007 15:41

Re: splitting a JSP based on num of lines
 
What are you storing in those arrays??

pradeep 27Jul2007 15:43

Re: splitting a JSP based on num of lines
 
Will you have your breakfast,lunch & dinner just you need to have it! Likewise, load the data the data when required.

sakthi.abdullah 27Jul2007 15:46

"Values for list boxes in a web page"
 
The jsp or js file contains various list box values....

The page which includes this file takes all the values and displays in the list box,,,,


All times are GMT +5.5. The time now is 07:11.