Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ServletContext

 
Deepthi Katta
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1467
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic