wood burning stoves 2.0
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


Deepthi Katta

Joined: Mar 26, 2001
Posts: 7
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.
maha anna
Ranch Hand

Joined: Jan 31, 2000
Posts: 1467
Please refer to the sample code in this thread. Here the forwarded resource could be anything html/jsp/servlet.
maha anna
[This message has been edited by maha anna (edited March 30, 2001).]
I agree. Here's the link: http://aspose.com/file-tools
subject: ServletContext
jQuery in Action, 3rd edition