File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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(
at org.apache.jasper.runtime.HttpJspBase.service(
at javax.servlet.http.HttpServlet.service(
at org.apache.jasper.servlet.JspServletWrapper.service(
at org.apache.jasper.servlet.JspServlet.serviceJspFile(
at org.apache.jasper.servlet.JspServlet.service(
at javax.servlet.http.HttpServlet.service(
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
at org.apache.catalina.core.ApplicationFilterChain.doFilter(
at org.apache.catalina.core.StandardWrapperValve.invoke(
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:
subject: what is wrong with my jsp
It's not a secret anymore!