aspose file tools*
The moose likes Servlets and the fly likes ServletContext Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "ServletContext" Watch "ServletContext" New topic
Author

ServletContext

Deepthi Katta
Greenhorn

Joined: Mar 26, 2001
Posts: 7
Hi,
I have a problem with the servlet context. I get a message
<E> <ServletContext-General> Warning: One of the getParameter family of methods called after reading from the ServletInputStream(), can't mix
these two!
I am getting the servletcontext in this code
public static void encodeForwardURL(String aURL, HttpSession session, HttpServlet servlet, HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {

ServletContext aContext = servlet.getServletContext();
System.out.println("aurl in encodeforward is: " + aURL);
RequestDispatcher aDispatch = aContext.getRequestDispatcher(res.encodeURL(aURL));


if (aDispatch == null) {
System.out.println("Request dispatcher could not be gotten...");
}
aDispatch.forward(req, res);
}
Please can anyone throw me any light on this or let me know of any other way to do this.
Thanks,
Deepthi
maha anna
Ranch Hand

Joined: Jan 31, 2000
Posts: 1467
Deepthi,
Please refer to the sample code in this thread. Here the forwarded resource could be anything html/jsp/servlet.
http://www.javaranch.com/ubb/Forum7/HTML/002833.html
regds
maha anna
[This message has been edited by maha anna (edited March 30, 2001).]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: ServletContext