3 Replies Latest reply on Oct 4, 2011 12:53 PM by jsulik

    Creating and executing simple jsp page

    jsulik

      I'm having trouble executing a simple jsp page.  I verified the jsp is in the war file but I just get a 404 error when trying to execute.

       

      Here's a snippet from the startup log:

      08:26:29,441 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-2) Starting deployment of "bsm.war"

      08:26:36,121 INFO  [org.jboss.web] (MSC service thread 1-3) registering web context: /bsm

      08:26:39,877 INFO  [org.jboss.as.server.controller] (Controller Boot Thread) Deployed "bsm.war"

       

      Here's a snippet from the war file contents:

      /apps/sulikj/jboss/apps/bsm/target> jar -tvf bsm.war

           0 Tue Oct 04 07:38:50 EDT 2011 META-INF/

         125 Tue Oct 04 07:38:48 EDT 2011 META-INF/MANIFEST.MF

           0 Mon Oct 03 16:48:32 EDT 2011 WEB-INF/

           0 Mon Oct 03 16:48:32 EDT 2011 WEB-INF/classes/

           0 Mon Oct 03 16:48:34 EDT 2011 WEB-INF/lib/

         487 Mon Oct 03 16:48:28 EDT 2011 WEB-INF/classes/registration.jsp

       

      Here's a snippet from the pom.xml:

        <build>

            <finalName>bsm</finalName>

            <resources>

             <resource>

              <directory>src</directory>

              <includes>

               <include>**/*.jsp</include>

              </includes>

             </resource>

            </resources>

       

      When I enter http://nti15.andipc.basf-corp.com:8080/bsm/registration.jsp in the url I just get a 404 error.  I was able to configure the hello world example and it executes correctly using http://nti15.andipc.basf-corp.com:8080/jboss-as-helloworld/HelloWorld.

       

      What am I missing?

       

      Thanks.

        • 1. Re: Creating and executing simple jsp page
          peterj

          The registration.jsp file should be in the base directory of the war, not within WEB-INF/classes. Files within WEB-INF and not accessible via URL.

           

          Based on your pom.xml, I suspect that you did not create a web app project. Your JSP should be at src/main/webapp/registration.jsp. Then if the packaging type in the pom.xml is war, the WAR file will contain the JSP in the correct location. This is just a guess based on the WAR file contents, I would really need to see the complete pom.xml to know better.

          • 2. Re: Creating and executing simple jsp page
            jsulik

            Thanks for the quick resonse.  I am using WAR as the packaging type and I moved the jsp to src/main/webapp/registration.jsp as you suggested.

             

            I also updated my compile script to use the parameter -DarchetypeArtifactId=maven-archetype-webapp.

             

            It's still compiling the jsp to the WEB-INF/classes folder though so I'm still missing something.

             

            I attached the full pom.xml for review.

            • 3. Re: Creating and executing simple jsp page
              jsulik

              It's working!!  I had pom.xml in the src folder.  I moved it back one directory and it compiled correctly.

               

              Thanks!