tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From marju jalloh <jallohma...@yahoo.com>
Subject problem calling request.getParameter("myparameter") in jsp
Date Tue, 10 Jan 2006 21:55:53 GMT
 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.

snippet
...
<Form    Method=GET ACTION="" >
  <Textarea  name="display" value="this.value"  >    </Textarea> 
   <Input    type=submit Value="Send">
</Form>

<jsp:useBean id="myBean" class="com.Database" />
<%!   String query = request.getParameter("display") ;  %>

<%  
if(!query.equals("") || !query.equals(null))
  {
              String selector = (query.substring(0,6)).trim();
              out.write(selector);
              if(selector.equals("SELECT")){
                   out.write(myBean.getData());
              }else
                if(selector.equals("INSERT")){
                   myBean.setData(query) ;
                }else
                if(selector.equals("DELETE")){
                  myBean.setDelete(query);
                }
                else
                   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.
Mime
  • Unnamed multipart/alternative (inline, 8-Bit, 0 bytes)
View raw message