i am calling a JSP from a servlet but i am getting a error Error 404- Not found.

Servlet file is reside in E:\Simple\WEB-INF\classes\servlet folder.

ServletHome.java

package servlet;  
import javax.servlet.*;    
import javax.servlet.http.*;    
import java.io.*;    
import java.net.*;    
public class ServletHome extends HttpServlet    
{    
public void doGet(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException    
{    
try    
{    
RequestDispatcher rd=request.getRequestDispatcher("/Vij.jsp");    
rd.forward(request,response);    
}    
   
catch(Exception e)    
{    
System.out.print(e);    
}    
}    
}

web.xml:

<web-app>    
<servlet>    
<servlet-name>ServletHome</servlet-name>    
<servlet-class>servlet.ServletHome</servlet-class>    
</servlet>    
<jsp-file>Vij.jsp</jsp-file>    
<url-pattern>*.do</url-pattern>  
<welcome-file-list>    
<welcome-file>ServletHome</welcome-file>    
</welcome-file-list>    
</web-app>

please suggest

you did compile it first?

Also, that web.xml looks a tad fishy. Are you sure you're not getting deployment errors?

just remove jsp-file tag,check it out correct directory structure,

<web-app>

      <servlet>

      <servlet-name>Home</servlet-name>

      <servlet-class>servlet.ServletHome</servlet-class>

      </servlet>

      
,<servlet-mapping>
<servlet-name>Home</servlet-name>
      <url-pattern>/mmm</url-pattern>
</servlet-mapping>

      <welcome-file-list>

      <welcome-file>login.jsp</welcome-file>

      </welcome-file-list>

      </web-app>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.