Embedding a querystring parameter in a hidden input with JSP results ing 500 error.

Posted by dacracot on Stack Overflow See other posts from Stack Overflow or by dacracot
Published on 2010-04-07T16:31:27Z Indexed on 2010/04/07 16:33 UTC
Read the original article Hit count: 303

Filed under:
|

I need a hidden input to contain the value passed by the querystring via a JSP's URL.

The URL looks like... http://nowhere.com/myapp/blah.jsp?key=12345

The JSP looks like...

<html>
<body>
<input id="key" type="hidden" value="<%=request.getParameter('key')%>" />
</body>
</html>

This causes a 500 error...

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

An error occurred at line: 3 in the jsp file: /myapp/blah.jsp
Invalid character constant
1: <html>
2: <body>
3: <input id="key" type="hidden" value="<%=request.getParameter('key')%>" />
4: </body>
5: </html>

© Stack Overflow or respective owner

Related posts about jsp

Related posts about querystring