I use Tomcat to deploy JSP named "menu.jsp",I want to call JSP from Servlet.
//Servlet named "myservlet.java"
  public void doPost(HttpServletRequest request,HttpServletResponse response)
     throws ServletException,IOException
 {
    .....
    getServletConfig().getServletContext().getRequestDispatcher
       ("/login/servlet/jsp/menu.jsp").forward(request,response);
    ...
 }

//JSP named "menu.jsp"
<html>
<body>
  <H1>I have recieve your message</H1>
</body>
</html>

I put my files into follow directories:
D:\Apache Tomcat 4.0\webapps\login\WEB-INF\jsp\menu.jsp
D:\Apache Tomcat 4.0\webapps\login\WEB-INF\classes\myservlet.class
D:\Apache Tomcat 4.0\webapps\login\WEB-INF\web.xml
D:\Apache Tomcat 4.0\webapps\login\servlets\index.html

//web.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd";>
<web-app>
    <servlet>
        <servlet-name>
           myservlet
        </servlet-name>
        <servlet-class>
           myservlet
        </servlet-class>
    </servlet>
    <session-config>
     <session-timeout>
        30
     </session-timeout>
    </session-config>
    <welcome-file-list>
     <welcome-file>
        index.html
     </welcome-file>
     <welcome-file>
            menu.jsp
        </welcome-file>
    </welcome-file-list>
</web-app>

When I call menu.jsp from servlet,it got a error:
Apache Tomcat/4.0.1 - HTTP Status 404 - /menu.jsp

type Status report
message /login/servlet/jsp/menu.jsp
description The requested resource (/login/servlet/jsp/menu.jsp) is not available.

I have put menu.jsp into D:\Apache Tomcat 4.0\webapps\login\WEB-INF\jsp\menu.jsp, Why 
it still error?
Thanks in advance!
Edward

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to