8 Replies Latest reply on Apr 10, 2007 11:26 AM by aggressivefish

    JSPs in JBoss

    aggressivefish

      I've been using JRun up to this point and the development environment was already set up. I want to start using JBoss to run my JSPs but wasn't sure where I should put them. Is there a specific directory I should put them? Is there a way to point to another directory to access them? Which approach would be more desirable? Do the JSPs have to be compiled beforehand? On JRun, it handles compilation on it's own. Thanks for any help in advance.

      AF

        • 1. Re: JSPs in JBoss
          peterj

          Package them in a war file and copy the war file to the server/xxx/deploy directory. Or deploy them as an exploded directory in that same location. See http://wiki.jboss.org/wiki/Wiki.jsp?page=ExplodedDeployment

          To specify a different directory, look at the URLs attribute in the last meban in sevrer/xxx/conf/jboss-service.xml.

          • 2. Re: JSPs in JBoss
            aggressivefish

            Thanks again Peter. I guess the layout is similar to JRun with the war and WEB-INFO directories. Couple of really stupid questions now:
            when entering localhost:8080/ what path does that go to? The reason why I'm asking this is because the directory(ies) I thought i would lead to doesn't appear to. I tried to look at the document's properties for JBoss to get a filename or something but nothing in the properties gave much of a clue. I was trying to experiment with a simple JSP I had put it into the jmx-console.war but I wasn't sure if the errors I was getting was related to URL problems or with the setup of the JSP. Thanks again for any help/info you can spare.

            AF

            • 3. Re: JSPs in JBoss
              aggressivefish

              Never mind Peter. I had been trying to put in jmx-console.war, didn't realize it but tried taking off the .war and it worked.

              • 4. Re: JSPs in JBoss
                aggressivefish

                Hi Peter,
                I figured I would give this a try. I copied a simple JSP I had into another directory at the same level as the jmx-console.war one. I tried running the app (i.e. localhost:8080/TmpDir/testjsp.jsp) and the app ran fine. What are the benefits/ requirements of having the other directories in the .war directory (i.e. WEB-INF)?
                I notcied that my .class files were going to a totally separate directory (...default/work/.......apache/jsp/). If I wanted to send just my .class files over to another computer without the .jsps in the main .war directory would I simply update the web.xml document with the path of the class file(s) or is there more to it? I tried removing the jsp altogether and leaving the classes (which I didn't think would work) and it didn't work (i.e. ole 404). Thanks again.

                AF

                • 5. Re: JSPs in JBoss
                  peterj

                  I guess I am not sure what you are attempting to do. There is a lot of documentation available on the web regarding the layout of the war file. Read chapters 2-5 at http://pdf.moreservlets.com/ for fairly decent coverage.

                  • 6. Re: JSPs in JBoss
                    aggressivefish

                    Peter,
                    Couple of hopefully quick questions. Where can I change the port number from 8080 to something else? How can I go about accessing (for example) the jmx-console directory without having to type in the computer name, colon, and the port number? Instead of mycomputer:8080/ being able to type mycomputer/? Appreciate the help once again.

                    AF

                    • 7. Re: JSPs in JBoss
                      peterj

                      To change port number, see http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossOnPort80 (a search of the wiki using the terms "port 80" would have found this for you)

                      To change the context, see http://wiki.jboss.org/wiki/Wiki.jsp?page=ChangeTheContextOfAWAR (a search of the wiki using the terms "change context" would have found this for you)

                      • 8. Re: JSPs in JBoss
                        aggressivefish

                        Thanks Peter.