Working classes with JSP

Reply

Join Date: Apr 2006
Posts: 10
Reputation: delizeka is an unknown quantity at this point 
Solved Threads: 0
delizeka's Avatar
delizeka delizeka is offline Offline
Newbie Poster

Working classes with JSP

 
0
  #1
Jul 10th, 2006
Hi everyone,

I am trying to use classes with JSP but I have a problem. I created a class and a method that will be used to return a specific querystring value . But I get an error while compiling the class and I can't solve the problem.

I use Apache Tomcat & J2SE on Windows XP Pro. SP2.

The class I wrote :

  1. public class pageIdentification
  2. {
  3. private String process;
  4.  
  5. public pageIdentification(){}
  6.  
  7. public String deneme (){
  8. process = request.getParameter("process");
  9. return (process);
  10. }
  11.  
  12. }
and the error I get :

  1. >javac pageIdentification.java
  2. pageIdentification.java:8: cannot find symbol
  3. symbol : variable request
  4. location: class pageIdentification
  5. process = request.getParameter("process");
  6. ^
  7. 1 error
Could anyone help me please?
Reply With Quote Quick reply to this message  
Join Date: Feb 2006
Posts: 2,467
Reputation: masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of 
Solved Threads: 267
Moderator
masijade's Avatar
masijade masijade is offline Offline
Nearly a Posting Maven

Re: Working classes with JSP

 
0
  #2
Jul 11th, 2006
The request object in a servlet is a passed in Object, not some sort of magical reference. You would have to rewrite this to either pass the request object into the called method or retrieve it from the ServletContext. But, in either case, you will also need to import a couple of further classes from the J2EE packages.
Java Programmer and Sun Systems Administrator

----------------------------------------------

Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



Tag cloud for JSP
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC