By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,665 Members | 1,952 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,665 IT Pros & Developers. It's quick & easy.

calling JSP from a servlet

P: 11
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
Expand|Select|Wrap|Line Numbers
  1. package servlet;
  2. import javax.servlet.*;  
  3. import javax.servlet.http.*;  
  4. import java.io.*;  
  5. import java.net.*;  
  6. public class ServletHome extends HttpServlet  
  7. {  
  8. public void doGet(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException  
  9. {  
  10. try  
  11. {  
  12. RequestDispatcher rd=request.getRequestDispatcher("/Vij.jsp");  
  13. rd.forward(request,response);  
  14. }  
  15.  
  16. catch(Exception e)  
  17. {  
  18. System.out.print(e);  
  19. }  
  20. }  
  21. }   
  22.  
web.xml is:
Expand|Select|Wrap|Line Numbers
  1. <web-app>  
  2. <servlet>  
  3. <servlet-name>ServletHome</servlet-name>  
  4. <servlet-class>servlet.ServletHome</servlet-class>  
  5. </servlet>  
  6. <jsp-file>Vij.jsp</jsp-file>  
  7. <url-pattern>*.do</url-pattern>
  8. <welcome-file-list>  
  9. <welcome-file>ServletHome</welcome-file>  
  10. </welcome-file-list>  
  11. </web-app>  
  12.  
please suggest.
Mar 16 '10 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.