944,131 Members | Top Members by Rank

Ad:
  • JSP Discussion Thread
  • Unsolved
  • Views: 4648
  • JSP RSS
Jul 10th, 2006
0

Working classes with JSP

Expand Post »
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 :

JSP Syntax (Toggle Plain Text)
  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 :

JSP Syntax (Toggle Plain Text)
  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?
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
delizeka is offline Offline
10 posts
since Apr 2006
Jul 11th, 2006
0

Re: Working classes with JSP

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.
Moderator
Reputation Points: 1471
Solved Threads: 490
Industrious Poster
masijade is offline Offline
4,043 posts
since Feb 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in JSP Forum Timeline: Unable to read a site with JSP coding
Next Thread in JSP Forum Timeline: How to Deploy the Web applications(JSP) on weblogic server





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC