4 Replies Latest reply on Feb 9, 2004 3:03 AM by pilhuhn

    Where to place JSP servlet fiels and url for executing on JB

    srshende

      Hello,
      One thing I would like to know is that Do we need to create WAR and EAR every time when we write new JSP or servlet ??? . If not then tell me how to execute jsp servlet without creating WAR and EAR file and whats the url for running the same.

      Thanks & Regards
      Sanjay

        • 1. Re: Where to place JSP servlet fiels and url for executing o
          dking_radford

          You have a few options:

          Option 1:

          Set up your application like this

          C:\MyApplication
          |
          | - JSP (put your jsp's here)
          |
          | - WEB-INF
          | -- classes
          | -- lib
          | web.xml
          --index.html

          Make this or your app into a war and place it in the
          directory: C:\JBOSS\server\default\deploy

          OR

          You can create you dir stuct like this (This is what I do)

          C:\MyApplication.war (NOTICE the .war extension is the name of my application directory), just put it in the deploy directory and work from..

          Hope this helps..


          • 2. Re: Where to place JSP servlet fiels and url for executing o
            j_kokil

            I would like to ask something more,
            i have done the same ,war file is deployed properly,
            showing index.jsp on the screen but while calling servlet
            it is giving error message classnot found.
            Can you show me an example that how to call servlet.
            Because i m using same method which i am using for calling
            on the tomcat standalone.

            • 3. Re: Where to place JSP servlet fiels and url for executing o
              sysuser1

              I have the same issue. When I am posting to my servlet I keep getting:

              23:45:07,750 INFO [Engine] StandardHost[localhost]: MAPPING configuration error
              for request URI /BaseServlet

              On My JSP Page I have


              In My web.xml I have


              <servlet-name>base</servlet-name>
              <servlet-class>MCC.classes.framework.BaseServlet</servlet-class>
              <init-param><param-name>timeout</param-name><param-value>600</param-value></init-param>
              <init-param><param-name>timeoutPage</param-name><param-value>/base/timeout.jsp</param-value></init-param>
              <init-param><param-name>baseFile</param-name><param-value>/base</param-value></init-param>


              <servlet-mapping>
              <servlet-name>base</servlet-name>
              <url-pattern>/BaseServlet</url-pattern>
              </servlet-mapping>

              • 4. Re: Where to place JSP servlet fiels and url for executing o
                pilhuhn

                Don't forget that servlets etc. are relativt to the web-root.
                So if your web-root is /foo and the servlet is at /barServlet, then
                you can access it at /foo/barServlet.