• Post Reply Bookmark Topic Watch Topic
  • New Topic

Querystring not working  RSS feed

 
Prasad prap
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am working on google app engine api and am learning with JSP. I am not able to figure out what is causing this error. I am not able to read a value sent by form in the same page.

CODE:



ERROR:
HTTP ERROR: 500
Unable to compile class for JSP

Generated servlet error:
[javac] C:\DOCUME~1\prasad\LOCALS~1\Temp\Jetty_0_0_0_0_8080_war____ut4fm1\jsp\org\apache\jsp\Guestbook_jsp.java:84: getQueryString() in javax.servlet.http.HttpServletRequest cannot be applied to (java.lang.String)
[javac] String cont=request.getQueryString("content");
[javac] ^
[javac] 1 error





What is the mistake i am doin?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are just learning JSP your primary mistake is in putting Java code and scriptlets into a JSP. That is a practice that has been outdated for over 8 years now.

You should be learning modern JSP, where the JSTL (JSP Standard Tag Library) and the EL (Expression language) are used in lieu of scriptlets and scriptlet expressions.

Doing so has many benefits, not the least of which is avoiding errors such as this one (which is caused by using the getQueryString() method incorrectly).
 
Mark E Hansen
Ranch Hand
Posts: 650
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't see a javax.servlet.http.HttpServletRequest.getQueryString() method which takes a String argument. Where are you getting this from? Is this something provided by the Google API? Can you please provide a URL to the Javadoc which shows this method?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!