get/setAttribute and getParameter...
Hi, What is more time consuming? JSP1: <% request.setAttribute("FLAG", new Boolean("true")); %> JSP2: <% boolean FLAG = ((Boolean) request.getAttribute("FLAG")).booleanValue(); if (FLAG) { .. ... } %> OR?: JSP1: JSP2: <% String FLAG = request.getParameter("FLAG"); if (FLAG.equals('true")) { .. .. } %> OR?: JSP1: JSP2: <% boolean FLAG = (new Boolean(request.getParameter("FLAG"))).booleanValue(); if (FLAG) { .. .. } %> AND, which way is it best practiced. Thankss for any help! -- Oskar Zinger
Re: Problem:
Nope. I have not found any solution to that yet. I have decided to go with JSP for now (until I develop everything)... then I will think of deployment of the converted servlets. And for now I am setting flush="false", and with JSPs it works fine, even though it should be the same in theory since whether I compile my JSPs through CMD by jspc.sh script and run them pre compiled or I let them compile on the fly dynamically. --- Oskar Zinger cher wrote: > Hi Oskar, Refering to your problem on > http://w4.metronet.com/~wjm/tomcat/2001/May/msg00767.html,we are > encoutner the same headache too:Error:["Cannot forward after response > has been committed."]Do you have any hint to solve it > ? Thanks. Regards,ChereTact Solutions, > Singaporehttp://www.etact.com.sg
Re: Precompiling JSP files
You can use a -p option to tell it to use a package... jspc.sh -p com.somecompany.sompepackage SomeJSPFile.jsp And also they could be syntax errors and other errors... --- Oskar Zinger Wellington Pereira Alves wrote: > Hello, I´m trying to precompile my .jsp´s using jspc. It generated > lots of .java files. When I tried to compile (using javac) the > generated .java files it gives hundreds of errors. I guess that the > erros are caused because the generated java files doesn´t have the > correct import sentences so I take "Cannot Resolve Symbol" errors. The > classpath apperars to be ok. Anybody knows what can be wrong? What I > need to do to precompile my jsp files at once? Thks,Wellington
dev: errors
Hey, guys, I am new to tomcat... using Tomcat v4.0-b3/b5. I am trying to include other jsps output in one main jsp and getting an IllegalStateException: with error message: "Cannot forward after response has been committed." This is what I am doing: <% for(int i = 0; i < typeNames.length; i++) { url = "my url is constructed here"; %> // if I set the flush to false I see the first iterated page of the servlet that I am including, if I am setting it to true then I get exception right on the first iteration of the loop. <% } %> I am writing JSPs then I am compiling them into servlets by using jspc.sh script that uses JspC.java in jasper's package. So when I go into the browser I am accessing not JSPs but converted jsps to Servlets which were generated by this script. (jspc.sh). I have tried many different things already, setting isThreadSafe to FALSE, setting buffer to a very big size, setting autoFlush to TRUE and FALSE, nothing seems to work. Has anyone ever encountered such problems? Thanks for your help, Oskar