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 :

public class pageIdentification
    private String process;

    public pageIdentification(){}

    public String deneme (){
        process = request.getParameter("process");
        return (process);


and the error I get :

>javac pageIdentification.java
pageIdentification.java:8: cannot find symbol
symbol  : variable request
location: class pageIdentification
                process = request.getParameter("process");
1 error

Could anyone help me please?

12 Years
Discussion Span
Last Post by masijade

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.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.