if i give res.sendRedirect(“RequestObjectInJSP.jsp”) in my servlet class it works(in this case jsp file exist at D:\apache-tomcat-6.0.33\apache-tomcat-6.0.33\webapps\hello) but if i give res.sendRedirect(“WEB-INF/classes/jsp/RequestObjectInJSP.jsp”) it does not work(in this case file exist at D:\apache-tomcat-6.0.33\apache-tomcat-6.0.33\webapps\hello\WEB-INF\classes\jsp) saying requested resource is not available. Not sure what ia m missing here.Appserver is Tomcat
if i give res.sendRedirect(RequestObjectInJSP.jsp) in my servlet class it works(in this case jsp file
Share
JSPs under WEB-INF cannot be directly accessed. This is generally a Good Thing. A redirect tells the browser to request a different URL, so sending a redirect to a JSP tells the browser to directly request that JSP.
To server a JSP inside of WEB-INF,
RequestDispatcher#forward()to it from a servlet.