| | |
Working classes with JSP
Please support our JSP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
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 :
and the error I get :
Could anyone help me please?
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)
public class pageIdentification { private String process; public pageIdentification(){} public String deneme (){ process = request.getParameter("process"); return (process); } }
JSP Syntax (Toggle Plain Text)
>javac pageIdentification.java pageIdentification.java:8: cannot find symbol symbol : variable request location: class pageIdentification process = request.getParameter("process"); ^ 1 error
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
----------------------------------------------
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
![]() |
Similar Threads
- package javax.ejb.* does not exist (Java)
- <jsp:include> Not Printing On Web Page, But In Source Code (JSP)
- C++ class file that uses an array (C++)
- Function pointers inside classes (C++)
- an application that involves all the j2ee technologies (Java)
- hi,help me ,urgent (JSP)
- Help with Direct and Indirect Communication (Java)
- Help with Java Threads (Java)
Other Threads in the JSP Forum
- Previous Thread: Unable to read a site with JSP coding
- Next Thread: How to Deploy the Web applications(JSP) on weblogic server
| Thread Tools | Search this Thread |
Tag cloud for JSP
apache array backbutton combobox comma connection csv database development directorystructure dropdownlist dynamicpagetitles eclipse frames glassfish ie8 imagetodatabse imageupload integer internet java javaee javascript jsf jsp jsppagetitles levels mvc2 mvcmodel2 mysql netbeans network parameters passing ping printinserverinsteadofclient project read redirect request.getparameter response seperated servlet servletdopost()readxml sessions software sql ssl state_saving_method stocks sun tomcat tutorial update values video web write






