7 Replies Latest reply on Aug 9, 2002 11:58 PM by dudoes

    Where to store servlets in JBOSS3.0

    lavanya_s

      How do I run a servlet in JBoss3.0. Where should I place it?
      ThankYou

        • 1. Re: Where to store servlets in JBOSS3.0
          joelvogt

          you should package your servlets in a war file which you should place in jboss' deploy directory

          • 2. Re: Where to store servlets in JBOSS3.0
            dudoes

            Servlet is a Class, place it to the place where you like,
            then make reference tags in Web.xml of the .war where your .JSP file ACTION to the Servlet.

            do you underStand?

            I hope this help you.

            • 3. Re: Where to store servlets in JBOSS3.0
              guru

              Hi,

              To run a servlet in JBOSS or for that matter in any app server, You have to prepare a archive called .war file.

              it's directory structure shud be like the following one.

              sample_servlet.war
              |
              |
              ---- index.html, .jsp files shud be placed here.
              |
              ---- WEB-INF [FOLDER]
              |
              --- WEB.XML [FILE]
              (which has the entry abt the servlets that can be accessed) |
              |
              |
              --- CLASSES [FOLDER]
              (which contains all the servlet class files)
              | |
              | --- LIB [FOLDER]
              (which contains the .jar files that the servlet uses )

              after arcchiving these files as .war

              just put it in deploy folder in JBOSS and access it using the url thru the browser.



              • 4. Re: Where to store servlets in JBOSS3.0
                guru

                Hi,

                To run a servlet in JBOSS or for that matter in any app server, You have to prepare a archive called .war file.

                it's directory structure shud be like the following one.

                sample_servlet.war
                |
                |
                ---- index.html, .jsp files shud be placed here.
                |
                ---- WEB-INF [FOLDER]
                |
                --- WEB.XML [FILE]
                (which has the entry abt the servlets that can be accessed) |
                |
                |
                --- CLASSES [FOLDER]
                (which contains all the servlet class files)
                | |
                | --- LIB [FOLDER]
                (which contains the .jar files that the servlet uses )

                after arcchiving these files as .war

                just put it in deploy folder in JBOSS and access it using the url thru the browser.

                i have attached a sample .war file which shows the structure that has to be built for deploying a servlet.

                it is a sample .war ... only jsp works and not the servlet.. any how u can put ur own servlet and see it works.

                regards,
                Gurumurthy R.

                • 5. Re: Where to store servlets in JBOSS3.0
                  dudoes

                  I think a JAVA programmer should know the contructure of .war

                  I means how to call the servlet after the Servlet Class have being compiled.

                  of cause ,System can automatically put all Class files in the folder "/web-inf/Classes" after having been compiled.

                  • 6. Re: Where to store servlets in JBOSS3.0
                    mlapolla

                    If I deploy my servlet to the /WEB-INF/classes directory, I can forward from a JSP using

                    <jsp:forward page="/servlet/servletController">
                    </jsp:forward>

                    However, if I try to do that from an action in a post,



                    it doesn't work. I know I have to modify web.xml if I don't want to deploy under /servlet/ but what do I modify to get it to work for the action in a form?

                    Thanks.

                    • 7. Re: Where to store servlets in JBOSS3.0
                      dudoes