tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From marju jalloh <>
Subject Re: problem calling request.getParameter("myparameter") in jsp
Date Tue, 10 Jan 2006 22:16:59 GMT
I got it. HttpRequest throws an exception by enclosing 
String query = request.getParameter("display") in a try and catch block everything was fine
marju jalloh <> wrote: I see 
 <%!   String query = request.getParameter("display") ;  %>
 is declared in the init()  of the servlet.I changed it but now I`m getting

java.lang.NullPointerException which should not execute the query

Can anyone throw licht on this


marju jalloh  wrote:  Hi everyone
I  `m writing a bean application to execute sql query.The query properties in the Bean works
perfect.I have a jsp with textArea where the user can enter query.The query is the required
parameter that the Bean should execute.



<%!   String query = request.getParameter("display") ;  %>

if(!query.equals("") || !query.equals(null))
              String selector = (query.substring(0,6)).trim();
                   myBean.setData(query) ;
                   out.write("nothing is entered");
My problem is when the jsp page is requested for the first time
 I got this error:
cannot find symbol variable request.
I know I should have null for  request.getParameter("display")  at first access and that is
caugt.If I  submit the form then the content of the textarea should be 
request.getParameter("display") .That was what I was expecting.

Can anyone help
Thanks in advance

Yahoo! Photos
 Got holiday prints? See all the ways to get quality prints in your hands ASAP.

Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 

Yahoo! Photos
 Got holiday prints? See all the ways to get quality prints in your hands ASAP.
  • Unnamed multipart/alternative (inline, 8-Bit, 0 bytes)
View raw message