Servlet Exception:Attribute value is quoted with " which must be escaped when used within the value
kamlendra kumar
Greenhorn
Joined: Nov 09, 2009
Posts: 23
posted
0
Hi,
I am trying to Migrate my application from Tomcat 5.0 to Tomcat5.5.28. I have used Struts, JSP and JSTLs in my application.
for Tomcat 5.5.28 i am getting servlet exception when rendering the jsp page.
The Exception is:
[ServletException in:/home/home1l/proposal_list.jsp] /home/home1l/proposal_list.jsp(497,59) Attribute value
MyPermissions.PERMISSION1
is quoted with " which must be escaped when used within the value .
The code in JSP page is:
<permissions:hasAnyNetworkSettings networkSettings="<%=MyPermissions.PERMISSION1%>">
Tomcat versions prior to 5.5.27 doesn't follow the quote requirements of Jsp Spec. Tomcat version 5.5.27 onwards quotes are checked strictly. Nested quotes has to be escaped.
what does MyPermissions.PERMISSION1 return?
tld file for this Tag is like this:
<tag>
<name>hasAnyNetworkSettings</name>
<tagclass>HasAnyNetworkSettingsTag</tagclass>
<bodycontent>JSP</bodycontent>
<attribute>
<name>networkSettings</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
</tag>
this class returns SKIP_BODY or EVAL_BODY_INCLUDE depending on the value passed to the tag.
kamlendra kumar
Greenhorn
Joined: Nov 09, 2009
Posts: 23
posted
0
Can you please give me the link to page confirming the fact that Tomcat5.5.27 onwards quotes are checked strictly..
i'll be very helpful.
So the bigger a web app gets, the less quality matters?
Thats absolutely right. For a mere 150+ pages i felt completely drowned by modifying a simple thing....
I didnt even think about getting into 2500 pages...
Never try to be a hard-worker. Be a smart-worker.
My Blog
kamlendra kumar
Greenhorn
Joined: Nov 09, 2009
Posts: 23
posted
0
Due to security vulnerability we are migrating to Tomcat5.5. Quality always matters friend.
But due to this issue not a single jsp page was getting rendered.And checking and correcting 2500 jsp pages gonna take tremendous efforts..
so i guess the way i found works best for my application.
kadavul seelan
Greenhorn
Joined: Dec 20, 2010
Posts: 5
posted
0
Hello,
i have got same problem with you.
I use TOMCAT 6, ECLIPSE
And i did not know how and where i need add the line "-Dorg.apache.jasper.compiler.Parser.STRICT_QUOTE_ESCAPING=false "
Please Help me.
kamlendra kumar
Greenhorn
Joined: Nov 09, 2009
Posts: 23
posted
0
Hey!
Set the parameter in catalina.bat .
kadavul seelan
Greenhorn
Joined: Dec 20, 2010
Posts: 5
posted
0
Hello thanks for answer,
i try this
i add this line in catalina.bat
kadavul seelan wrote:Hello thanks for answer,
i try this
i add this line in catalina.bat
But it doesn't work
Thanks for help
Actually, if you create a file named "setenv.bat" (or setenv.sh) and put the line in there, catalina.bat will pick up the configuration option from there and you won't have to modify the Tomcat startup script. setenv goes in the TOMCAT_HOME/bin directory just like the catalina.bat file.
Customer surveys are for companies who didn't pay proper attention to begin with.
kadavul seelan
Greenhorn
Joined: Dec 20, 2010
Posts: 5
posted
0
i resolved my problem, eclipse HELIOS create in workspace a folder server, on this folder it saved catalina.properties files
on this file i add "org.apache.jasper.compiler.Parser.STRICT_QUOTE_ESCAPING=false" in this file and my project work.
You just add the below line in a path of tomcat\conf\catalina.properties
org.apache.jasper.compiler.Parser.STRICT_QUOTE_ESCAPING=false to the end of ${catalina.home}\conf\catalina.properties
That should be work.
Regards:Prince Charles
http://princecharl.blogspot.com