Description
1 source files to c:\...\workspace\proj\build\web-Inf\classes[javac] C:\...\workspace\proj\src\main\helper.java : £cannot find Symbol[javac] symbolinterface Javax.servlet.http.httpservletrequest[javac] return geturiset (Request.getservletcontext () ); [Javac] ^for 1 error
Solution
getServletContext()
The method is introduced in Servlets 3.0, not 2.3. But if you want to get the ServletContext
that then a alternative method to get it is:
1 ServletContext context = request.getsession (). Getservletcontext (); 2 3 if NULL ) {4 context.setattribute ("Savedusername", username); 5 }6 writer.println ("Context Parameter:" + (String) context.getattribute ("Savedusername"));
This is the "can get" stored Request Parameter Value in different browser ....
Reference
- Request.getservletcontext () not found, even with new JAR
Cannot find Symbol:method Getservletcontext ()