0
votes

I started learning jsp and did some simple web application examples. I am coding a simple shop and dynamic web-app name is Book0. The index.html redirects

response.sendRedirect("/Book0/eshop");

while the item list is null (initial access).

Now I deployed the application on tomcat via .war export on eclipse. I had the servlet coded on servlet.Servlet0;

the web.xml for the app, I added on top welcome file list on generic eclipse web.xml:

<servlet>
   <servlet-name>EshopServlet0</servlet-name>
   <servlet-class>servlet.Servlet0</servlet-class>
</servlet>
<servlet-mapping>
   <servlet-name>EshopServlet0</servlet-name>
   <url-pattern>/eshop</url-pattern>
</servlet-mapping>

My other application has been working so far. But this one hits 404 when redirects to the servlet.. Any ideas what has gone wrong. Thx

1
Have you done some research about 404 status? Could you provide more code to replicate the issue?Luiggi Mendoza
what code do you need? I can just post on pastebin or sumwhere? thxt00n_crumbl3
Can you browse directly to eshop?rickz
No. I can't. It's gonna be apache 404..t00n_crumbl3
pastebin.com/Bm71VRUp -index.jsp sorry bout syntax.. no jsp... pastebin.com/tdcLd5Mh -Servlet0.java it's bit partial unfinished.. just bitt00n_crumbl3

1 Answers

1
votes

In Servlet0, you have @WebServlet("Servlet0") but you also have in your web.xml /eshop. You only need one and they should agree with each other. You could remove annotation or change to @WebServlet("eshop") or @WebServlet("/eshop")