• Post Reply Bookmark Topic Watch Topic
  • New Topic

requestDispatcher.forward() failing  RSS feed

Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI Joe,
thanx..thats exactly what i have done but then on i stumbled onto another problem. MAy be not related to this forum.
i have an .ear file loaded into my wls6.0 server.
in the application.xml i have a context-root element say "fruit"
what i do is write the uri in my index.html as "/fruit/jsp/Login.jsp". so when i type http://localhost:9001/fruit the login.jsp is called. Then when the user presses on the ok button the submission is made to the login servlet which (after whatever validations reqd. ) forwards the request to a Main.jsp using requestDispatcher("/fruit/jsp/Main.jsp")
this is how i do it
// gives ctxPath = /crol
String ctxPath = request.getContextPath();
String cPath = "\""+ ctxPath + "/jsp/ROLMain.jsp\"";
String cPath = "/jsp/ROLMain.jsp";
ServletContext servletCtx = getServletContext() ;
RequestDispatcher reqDis = servletCtx.getRequestDispatcher(cPath) ;
reqDis.forward(request, response) ;
but when i do this it gives a weird display "HTTP POST mathod not supported by this url"...i have no idea why?? but if use "/jsp/Main.jsp" it works fine...
i have tried using request.getRequestDispatcher(cPath).forward(request, repsonse) and still the same error..

please help............
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!