Hi all,
I have a jsp (testservlet.jsp) in following directory:
C:\JAKARTA-TOMCAT\webapps\examples\jsp
and it contains:
<FORM action="/examples/servlet/jsp.Servlet1" method=POST>
<INPUT TYPE="text" size=5 name=test value="pleasework">
<INPUT TYPE="submit">
</FORM>
and a servlet (Servlet1.class) in following directory:
C:\JAKARTA-TOMCAT\webapps\examples\WEB-INF\classes\jsp
which contains:
package jsp;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class Servlet1 extends HttpServlet
{
public void doGet(HttpServletRequest request,
HttpServletResponse response)
throws IOException, ServletException
{
response.setContentType("text/html");
PrintWriter out = response.getWriter();
String temp = (String) request.getParameter("test");
...
HttpSession userSession = request.getSession(true);
RequestDispatcher rd =
getServletContext().getRequestDispatcher("/jsp/testservlet.jsp");
if (rd != null) rd.forward(request,response);
}
}
I can go from the servlet to the jsp and also the other way if a use a
forward in stead of a submit. If I do it like this I get error 404 (not
found) although the path in the location-field is correct!
If anyone knows what I'm doing wrong or forgot to do please tell me,
thanks in advance & have a nice weekend,
Stijn
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.