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 Error when using session.getAttribute Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Error when using session.getAttribute" Watch "Error when using session.getAttribute" New topic
Author

Error when using session.getAttribute

Rakesh Rajmohan
Greenhorn

Joined: Jul 09, 2009
Posts: 22
Hello,

I get the below error in one machine.. (In the other machine withb same source code & class files it works)

org.apache.jasper.JasperException: /searchStudentDetails.jsp(133,151) Attribute value session.getAttribute("School_id").toString() is quoted with " which must be escaped when used within the value

any ideas plase..?
Sebastian Janisch
Ranch Hand

Joined: Feb 23, 2009
Posts: 1183
could you post your code snippet


JDBCSupport - An easy to use, light-weight JDBC framework -
Rakesh Rajmohan
Greenhorn

Joined: Jul 09, 2009
Posts: 22
<td width="23%" height="25" align="left"><html:text property="school_id_code" size="20" styleClass="InputTxt10black" readonly="true" value="<%=session.getAttribute("School_id").toString() %>"/></td>

this is the line where I get the error.. (But the same works on another machine)
Sebastian Janisch
Ranch Hand

Joined: Feb 23, 2009
Posts: 1183
the jsp spec prohibits using nested quotes ..

try using value='<%= expr("") %>'

some containers support the version that is actually not allowed,
check https://issues.apache.org/bugzilla/show_bug.cgi?id=45015
Rakesh Rajmohan
Greenhorn

Joined: Jul 09, 2009
Posts: 22
You are awesome.. Its works now.. Thanks a million..!
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Error when using session.getAttribute