4 Replies Latest reply on Oct 8, 2014 11:22 AM by flamant

    display login.jsp page or call a servlet

    flamant

      Hello,

       

      I work with jboss eap 6.2

       

      I deployed an enterprise java project where there is a web module

       

      Here is screenshot of the project

       

      Project_2014-10-07_à_11.21.46.png

       

       

      Here is the web.xml file

       

      <?xml version="1.0" encoding="ISO-8859-1" ?>

       

      <web-app xmlns="http://java.sun.com/xml/ns/j2ee"

          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

          xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"

          version="2.4">

       

          <display-name>HelloWorld Application</display-name>

          <description>

              This is a simple web application with a source code organization

              based on the recommendations of the Application Developer's Guide.

          </description>

       

          <servlet>

              <servlet-name>ServletCallSessionBean</servlet-name>

              <servlet-class>com.tutorialspoint.servlet.ServletCallSessionBean</servlet-class>

          </servlet>

       

          <servlet-mapping>

              <servlet-name>ServletCallSessionBean</servlet-name>

              <url-pattern>/test</url-pattern>

          </servlet-mapping>

       

          <welcome-file-list>

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

          </welcome-file-list>

      </web-app>

       

      When I try to reach the login.jsp page or the servlet, I have the http status 404 error

       

      login-jsp_2014-10-07_à_11.18.19.png

       

      Servlet_2014-10-07_à_11.19.49.png

       

      Do you have any idea ? Thank you in advance for your answers

        • 1. Re: display login.jsp page or call a servlet
          jamezp

          Not the issue, but in your web.xml you have Login.jsp defined in the welcome files. It should be loging.jsp (lowercase L).

           

          I'm not sure what this EJB tutorial is. Are you deploying an EAR or a WAR? Some more information about the project would be helpful.

           

          One thing you could do is look at the log and look for a message like "JBAS017534: Registered web context: /EJBTutorial". It might be that your context is incorrect.

           

          --

          James R. Perkins

          • 2. Re: display login.jsp page or call a servlet
            flamant

            Hello James and thank you for your answer.

             

            Effectivaly I can see in the console the following log output "JBAS018210: Enregistrement du contexte web /EJBTutorialWeb". tranlation: "JBAS018210: registration of the web context /EJBTutorialWeb"

             

            So the correct URL to enter was "http://localhost:8080/EJBTutorialWeb/test" and "http://localhost:8080/EJBTutorialWeb/login.jsp"

             

            I am Surprised because the name of the ear deployed was EJBTutorial.ear so I thought that the web context was /EJBTutorial

             

            Thanks again

            • 3. Re: Re: display login.jsp page or call a servlet
              jamezp

              You can change that in the application.xml of the EAR. Just add something like:

              <application version="6" xmlns="http://java.sun.com/xml/ns/javaee"  
                 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  
                 xsi:schemaLocation="  
                    http://java.sun.com/xml/ns/javaee  
                    http://java.sun.com/xml/ns/javaee/application_6.xsd">
                 ... 
                 <module>  
                    <web>  
                       <web-uri>EJBTutorialWeb.war</web-uri>  
                       <context-root>EJBTutorial</context-root>  
                    </web>  
                 </module>
                 ...
              </application>  
              

               

              The reason though it doesn't use the name of the EAR is you can have more than one web deployment in your EAR. Each one needs a separate context root which is why the name of the web deployment is used.

               

              --

              James R. Perkins

              1 of 1 people found this helpful
              • 4. Re: Re: display login.jsp page or call a servlet
                flamant

                Hello James and thank you for your answer. The problem is resolved.