Dynamic Web Project HTTP ERROR:503 - java

I am making a dynamic web project with mysql database connectivity in eclipse using dynamic web module 3.0,jdk 1.7
This is my project structure
Project structure
web.xml for it
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">
<display-name>Project</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
<servlet>
<servlet-name>AdminLogin</servlet-name>
<servlet-class>com.servlets.AdminLogin</servlet-class>
</servlet>
<servlet>
<servlet-name>AddBook</servlet-name>
<servlet-class>com.servlets.AddBook</servlet-class>
</servlet>
<servlet>
<servlet-name>AddBookForm</servlet-name>
<servlet-class>com.servlets.AddBookForm</servlet-class>
</servlet>
<servlet>
<servlet-name>AddLibrarian</servlet-name>
<servlet-class>com.servlets.AddLibrarian</servlet-class>
</servlet>
<servlet>
<servlet-name>AddLibrarianForm</servlet-name>
<servlet-class>com.servlets.AddLibrarianForm</servlet-class>
</servlet>
<servlet>
<servlet-name>DeleteBook</servlet-name>
<servlet-class>com.servlets.DeleteBook</servlet-class>
</servlet>
<servlet>
<servlet-name>DeleteLibrarian</servlet-name>
<servlet-class>com.servlets.DeleteLibrarian</servlet-class>
</servlet>
<servlet>
<servlet-name>EditLibrarian</servlet-name>
<servlet-class>com.servlets.EditLibrarian</servlet-class>
</servlet>
<servlet>
<servlet-name>IssueBook</servlet-name>
<servlet-class>com.servlets.IssueBook</servlet-class>
</servlet>
<servlet>
<servlet-name>IssueBookForm</servlet-name>
<servlet-class>com.servlets.IssueBookForm</servlet-class>
</servlet>
<servlet>
<servlet-name>LibrarianLogin</servlet-name>
<servlet-class>com.servlets.LibrarianLogin</servlet-class>
</servlet>
<servlet>
<servlet-name>LogoutAdmin</servlet-name>
<servlet-class>com.servlets.LogoutAdmin</servlet-class>
</servlet>
<servlet>
<servlet-name>LogoutLibrarian</servlet-name>
<servlet-class>com.servlets.LogoutLibrarian</servlet-class>
</servlet>
<servlet>
<servlet-name>ReturnBook</servlet-name>
<servlet-class>com.servlets.ReturnBook</servlet-class>
</servlet>
<servlet>
<servlet-name>ViewBook</servlet-name>
<servlet-class>com.servlets.ViewBook</servlet-class>
</servlet>
<servlet>
<servlet-name>ViewIssuedBook</servlet-name>
<servlet-class>com.servlets.ViewIssuedBook</servlet-class>
</servlet>
<servlet>
<servlet-name>ViewLibrarian</servlet-name>
<servlet-class>com.servlets.ViewLibrarian</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>AdminLogin</servlet-name>
<url-pattern>/AdminLogin</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>AddBook</servlet-name>
<url-pattern>/AddBook</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>AddBookForm</servlet-name>
<url-pattern>/AddBookForm</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>AddLibrarian</servlet-name>
<url-pattern>/AddLibrarian</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>AddLibrarianForm</servlet-name>
<url-pattern>/AddLibrarianForm</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>DeleteBook</servlet-name>
<url-pattern>/DeleteBook</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>DeleteLibrarian</servlet-name>
<url-pattern>/DeleteLibrarian</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>EditLibrarian</servlet-name>
<url-pattern>/EditLibrarian</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>EditLibrarianForm</servlet-name>
<url-pattern>/EditLibrarianForm</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>IssueBook</servlet-name>
<url-pattern>/IssueBook</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>IssueBookForm</servlet-name>
<url-pattern>/IssueBookForm</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>LibrarianLogin</servlet-name>
<url-pattern>/LibrarianLogin</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>LogoutAdmin</servlet-name>
<url-pattern>/LogoutAdmin</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>LogoutLibrarian</servlet-name>
<url-pattern>/LogoutLibrarian</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>ReturnBook</servlet-name>
<url-pattern>/ReturnBook</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>ReturnBookForm</servlet-name>
<url-pattern>/ReturnBookForm</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>ViewBook</servlet-name>
<url-pattern>/ViewBook</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>ViewIssuedBook</servlet-name>
<url-pattern>/ViewIssuedBook</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>ViewLibrarian</servlet-name>
<url-pattern>/ViewLibrarian</url-pattern>
</servlet-mapping>
</web-app>
I have included mysql-connector.jar in java resources/lib only.
When i am running it it shows
HTTP ERROR: 503
Problem accessing /Project/AdminLogin. Reason:
Service Unavailable
Powered by Jetty://
But when I am using the web.xml as
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">
<display-name>Project</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
<servlet>
<servlet-name>AdminLogin</servlet-name>
<servlet-class>com.servlets.AdminLogin</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>AdminLogin</servlet-name>
<url-pattern>/AdminLogin</url-pattern>
</servlet-mapping>
</web-app>
it opens the AdminLogin page but after that when I open other servlets it shows error as
HTTP ERROR 404
Problem accessing /Project/AddLibrarianForm. Reason:
Not Found
Is the problem due to my web.xml file or something else?

Related

IOException parsing XML document from ServletContext resource [/WEB-INF/spring-dispatcher-servlet.xml]

Receiving this error from console:
*org.springframework.beans.factory.BeanDefinitionStoreException:
IOException parsing XML document from ServletContext resource
[/WEB- INF/spring-dispatcher-servlet.xml]; nested exception is
java.io.FileNotFoundException: Could not open ServletContext resource
[/WEB-INF/spring-dispatcher-servlet.xml]*
That's the error I receive from:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
id="WebApp_ID" version="2.5">
<display-name>fj21-tarefas</display-name>
<welcome-file-list>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<servlet>
<servlet-name>spring</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/spring-servlet.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>spring</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
</web-app>
I doing
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/spring-context.xml</param-value>
</init-param>
to change the default context from springmvc, but it is not working. Already took some advice here to write a servlet-name tag to the file name-context.xml convention, same error.
You should try changing the servlet name. Expected Spring web-context metadata XML file name should servletname-servlet.xml, this was expected filename till Spring 4, not sure if it is changed in spring 5.
. As your servlet name is springmvc, filename should be springmvc-servlet.xml.
<servlet>
<servlet-name>springmvc</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/springmvc-servlet.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>springmvc</servlet-name>
<url-pattern>/app-name/*</url-pattern>
</servlet-mapping>
Make your web.xml look like this, taken straight from the Spring documentation:
<web-app>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/spring-context.xml</param-value>
</context-param>
<servlet>
<servlet-name>app</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value></param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>app</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
</web-app>

How to declare multiple packagesin web.xml, by REST (JAX-RS)?

I want to declare tow packages in the web.xml in a REST application using jax-rs.
this my code of web.xml for the first package
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">
<display-name>LampPostZ12</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
<servlet>
<servlet-name>lamppost12</servlet-name>
<servlet-class>org.glassfish.jersey.servlet.ServletContainer</servlet-class>
<init-param>
<param-name>jersey.config.server.provider.packages</param-name>
<param-value>cuLampPost</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>lamppost12</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
</web-app>
like that, everything is working well.
but when I add the declaration of the second package:
<servlet>
<servlet-name>lamppost12</servlet-name>
<servlet-class>org.glassfish.jersey.servlet.ServletContainer</servlet-class>
<init-param>
<param-name>jersey.config.server.provider.packages</param-name>
<param-value>cuLampPost</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>lamppost12</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>radar12</servlet-name>
<servlet-class>org.glassfish.jersey.servlet.ServletContainer</servlet-class>
<init-param>
<param-name>jersey.config.server.provider.packages</param-name>
<param-value>radar</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>radar12</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
it appears as it:
Etat HTTP 404
thank's in advance
The problem is solved when I declare in the web.xml, like this:
<servlet>
<servlet-name>lamppost12</servlet-name>
<servlet-class>org.glassfish.jersey.servlet.ServletContainer</servlet-class>
<init-param>
<param-name>jersey.config.server.provider.packages</param-name>
<param-value>cuLampPost;radar</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>lamppost12</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
</web-app>

Angular 4 and Java BackEnd Project in a single WAR

I created a angular 4 project and using JAVA REST API Project as a BackEnd. I need that I can move my angular 4 project as a staic content inside JAVA war file.
I created the production build for angular project and copy the files from dist folder and paste it inside webcontent of java project. I am able to read the index file of angular project but other files are giving 404.
Please help how can I move my angular project inside my java project to get a single war file for production.
WEB.XML :-
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">
<display-name>userInformation</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
<servlet>
<servlet-name>Jersey RESTful Application</servlet-name>
<servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
<init-param>
<param-name>jersey.config.server.provider.packages</param-name>
<param-value>com.newgen.ap2</param-value>
</init-param>
<init-param>
<param-name>com.sun.jersey.spi.container.ContainerResponseFilters</param-name>
<param-value>com.newgen.ap2.CrossOrigin</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>Jersey RESTful Application</servlet-name>
<url-pattern>/rest/*</url-pattern>
</servlet-mapping>
</web-app>
Change your web.xml to the following:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">
<display-name>userInformation</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
<servlet>
<servlet-name>Jersey RESTful Application</servlet-name>
<servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
<init-param>
<param-name>jersey.config.server.provider.packages</param-name>
<param-value>com.newgen.ap2</param-value>
</init-param>
<init-param>
<param-name>com.sun.jersey.spi.container.ContainerResponseFilters</param-name>
<param-value>com.newgen.ap2.CrossOrigin</param-value>
</init-param>
</servlet>
<servlet>
<servlet-name>default</servlet-name>
<servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Jersey RESTful Application</servlet-name>
<url-pattern>/rest/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>default</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
</web-app>
The idea is to use a different Servlet to serve your static resources.
Here are some more SO posts that might be helpful:
Servlet filters' order of execution
How are Servlet url mappings in web.xml used?
What happens if I have two servlet mappings in web.xml that match a request?

Servlet Wrong response

I have 3 servlets in my web application.
The first servlet is workinh OK.
The second and third servlet which is copying from the first one, doesn't work and doesn't get response.
However, I search on internet and all websites say: the error in web.xml file
This is my web.xml file:
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.1">
<servlet>
<servlet-name>getmarks</servlet-name>
<servlet-class>getmarks</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet>
<servlet-name>Login</servlet-name>
<servlet-class>Login</servlet-class>
<load-on-startup>2</load-on-startup>
</servlet>
<servlet>
<servlet-name>Enter</servlet-name>
<servlet-class>Enter</servlet-class>
<load-on-startup>3</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>getmarks</servlet-name>
<url-pattern>/getmarks</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Login</servlet-name>
<url-pattern>/Login</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Enter</servlet-name>
<url-pattern>/Enter</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
Try This Code Web.xml file
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" id="WebApp_ID" version="3.1">
<display-name>Your Project Name</display-name>
<servlet>
<servlet-name>ABC</servlet-name>
<servlet-class>getmarks</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet>
<servlet-name>DEF</servlet-name>
<servlet-class>Login</servlet-class>
<load-on-startup>2</load-on-startup>
</servlet>
<servlet>
<servlet-name>GHI</servlet-name>
<servlet-class>Enter</servlet-class>
<load-on-startup>3</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>ABC</servlet-name>
<url-pattern>/getmarks_1</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>DEF</servlet-name>
<url-pattern>/Login_1</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>GHI</servlet-name>
<url-pattern>/Enter_1</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
</web-app>
You should put full class names in the <servlet-class> tag.
Also, <web-app> tag is missing some attributes about XML Schema. You can find more information here.
For version 3.1 it should look like this:
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
version="3.1">
// your mappings
</web-app>
Closing </web-app> tag is also missing.

Not able to change default starting page in netbeans

I create a web application in Netbeans, named test9. I have create various jsp files and servlets,etc in it.Now i want to change the starting page index.html to index.jsp so I created a new file index.jsp and deleted index.html but after running it, It is still trying to open index.html and displaying 404 error resource not found i even made changes in my xml file but still it is doing it.
Do i have to make some other changes ?
xml file
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.1" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd">
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<filter>
<filter-name>RequestLoggingFilter</filter-name>
<filter-class>bean.RequestLoggingFilter</filter-class>
</filter>
<filter>
<filter-name>AuthenticationFilter</filter-name>
<filter-class>bean.AuthenticationFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>AuthenticationFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>RequestLoggingFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<servlet>
<servlet-name>LoginServlet</servlet-name>
<servlet-class>bean.LoginServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>LogoutServlet</servlet-name>
<servlet-class>bean.LogoutServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>DepartmentServlet</servlet-name>
<servlet-class>bean.DepartmentServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>C_userServlet</servlet-name>
<servlet-class>bean.C_userServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>statusServlet</servlet-name>
<servlet-class>bean.statusServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>FileServlet</servlet-name>
<servlet-class>bean.FileServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>SearchServlet</servlet-name>
<servlet-class>bean.SearchServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>NoCacheFilter</servlet-name>
<servlet-class>bean.NoCacheFilter</servlet-class>
</servlet>
<servlet>
<servlet-name>forgotServlet</servlet-name>
<servlet-class>bean.forgotServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>passServlet</servlet-name>
<servlet-class>bean.passServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>LoginServlet</servlet-name>
<url-pattern>/LoginServlet</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>LogoutServlet</servlet-name>
<url-pattern>/LogoutServlet</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>DepartmentServlet</servlet-name>
<url-pattern>/DepartmentServlet</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>C_userServlet</servlet-name>
<url-pattern>/C_userServlet</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>statusServlet</servlet-name>
<url-pattern>/statusServlet</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>FileServlet</servlet-name>
<url-pattern>/FileServlet</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>SearchServlet</servlet-name>
<url-pattern>/SearchServlet</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>NoCacheFilter</servlet-name>
<url-pattern>/NoCacheFilter</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>forgotServlet</servlet-name>
<url-pattern>/forgotServlet</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
</web-app>
In netBeans you can right click button on your project, then properties. A new pop up window will open, and on the left menu there will be a label call run. Click there and then in the "relative URL" you should put
/nameOfYourJspFile.jsp
and it works but i still do not know why
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
did not work.
I know that this is an old post but since i had the same issue and solved it i am posting my answer to help some others who might stuck in a situation like this.
What worked for me was to take the new jsp file out of the WEB-INF folder.

Categories