jQuery in Action, 3rd edition
The moose likes JSP and the fly likes what is wrong with my jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "what is wrong with my jsp" Watch "what is wrong with my jsp" New topic

what is wrong with my jsp

Archana Annamaneni
Ranch Hand

Joined: Jan 29, 2003
Posts: 147
hi ,
I have following jsp , it runs fine if i delete that if part, it prints the query string as null, i am getting errors becuse of that if , i am not undertsanding what is wrong with that part, someone please suggest.

<h2>Enter the following data</h2>
<body bgcolor="#FFDAB9">
String query = request.getQueryString();
out.println("query is "+query);
out.println("query is null");
I ma getting folowing errors when i access it thorugh the browser
at org.apache.jsp.index_jsp._jspService(index_jsp.java:58)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:210)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
Archana Annamaneni
Ranch Hand

Joined: Jan 29, 2003
Posts: 147
hey i got that , i have to use
if(query == null
toma lam

Joined: Aug 25, 2003
Posts: 4
Yeh, this gets me a lot too. I keep forgetting that Null isn't treated like an object, so you can't use the equals method.
I agree. Here's the link: http://aspose.com/file-tools
subject: what is wrong with my jsp
It's not a secret anymore!