7 Replies Latest reply on Dec 7, 2003 12:09 PM by Wouter Zoons

    Viable team development process for JSPs with Jboss/Tomcat

    RAPHEAD Newbie

      Hi,

      I'm pretty new to JSP and I read through many tuts and stuff now but what my knowledge is really lacking of is a good development process. I come from PHP where things are a lot easier and to find a good development process in the team was really straight forward. What I'm asking for looking for:

      - I want the JSPs and Jboss to lie on a central server which - on a share that every team member can edit the files (works fine with locking)

      - These files should be accessible to the container in a way that they don't have to be deployed each time they change

      - It would be ideal if there was a faster way to generate the servlets each time - I heard something about precompilation?!

      - And I want to use a good IDE to edit my JSPs with syntax check etc. like Eclipse with Lomboz


      That's all I want to be happy but even if I know how to achieve parts of these requirements, other parts would be impossible. Please post all your experiences for the best dev. process.
      Please keep in mind that I don't use EJB nor do I use a Framework like struts.

      Currently I'm working with lomboz@Eclipse which has all the editing features I'm looking for but you have to run Jboss inside eclipse AND you have to deploy each time you change anything!


        • 1. Re: Viable team development process for JSPs with Jboss/Tomc
          Joe Fraser Newbie

          I won't make a IDE recommendation, but I can tell you that a jsp can be loaded (i.e. compiled at JBOSS startup. attached is a web.xml file that does just that.
          you will know the entry in the file, because it has a
          <jsp-file> tag. Servlets can be loaded at startup, but not compiled.

          Joe

          • 2. Re: Viable team development process for JSPs with Jboss/Tomc
            Joe Fraser Newbie

            oops I forgot to tell you that to make the precompile work, you have to put four, files in your JBOSS_CLASSPATH they are:

            jasper-compiler.jar
            jasper-runtime.jar
            ant.jar
            javax.servlet.jar

            get them from you default deploy ... directories

            • 3. Re: Viable team development process for JSPs with Jboss/Tomc
              RAPHEAD Newbie

              Hi J, and thanks for the Hint!

              But please let me ask one thing regarding that: My understanding is, that I get Jboss to compile my JSPs, when it starts up - which otherwise will happen on the first request of the JSP.
              That's interesting for production servers but what about development?
              OR does it mean, that all files get compiled also on change?

              Thanks, Thomas

              • 4. Re: Viable team development process for JSPs with Jboss/Tomc
                Joe Fraser Newbie

                Sorry, I didn't notice your second question right away.
                In production and development a request will start a recompile(if new), behind the scenes. Also, note that this behavior is configurable, so you can make it different, if you desire.

                • 5. Re: Viable team development process for JSPs with Jboss/Tomc
                  Wouter Zoons Newbie

                  while precompiling jsps on deploy is a step in the good direction I think it is more interesting to compile at development time (notice compile problems sooner, no need for JSP compiler on server (security), quicker (no server load) etc...)

                  I explained how to do this here:
                  http://sourceforge.net/mailarchive/forum.php?thread_id=3435763&forum_id=28502

                  note: you should not drop your welcome files from the bundle, just leave those JSPs in the WAR, the server will pick up the compiled versions but the validation of web.xml will otherwise fail at deploy time since the file(s) referenced cannot be found

                  as for the IDE I strongly recommend IntelliJ IDEA from jetbrains (www.jetbrains.com) it's a commercial tool, but IMHO the best one out there, but that you should figure out yourself...

                  some like eclipse better, but most people that gave it an honest try stick with IDEA

                  [typical flame bait, I know; this is just my personal experience so keep this thread clean please, thanks :-)]

                  as for Struts, I would recommend getting into that too, it looks heavy at first but it's quite straightforward once you get the idea and understand how they applied MVC

                  to make things easier you could visit http://andromda.sf.net, AndroMDA lets you generate EJB/Hibernate/Struts/XML code from a UML diagram

                  the generated boiler-plate code should put you on track as it typically reflects the experience/best practices of many developers in the open-source community, it should at least give you some ideas. there is a new module called 'bpm4struts' that will handle generation of Struts code, it's not yet in any release but a first version is fully functional and documented (with sample) in CVS

                  regards
                  Wouter.

                  • 6. Re: Viable team development process for JSPs with Jboss/Tomc
                    RAPHEAD Newbie

                    Hi draftdog ,

                    Great tutorial on how to get those JSPs compiled before deployment. I think this can really save a considerable amount of time!

                    I think I'll try IDEA, I've read several good comments on it. Otherwise, I'll just integrate the ant tasks in eclipse.

                    Regarding the team development: As I said, I come from PHP and with 3 developers it was no problem to work with one server and a shared webserer root.... I can see that this isn't applicable for J2EE, so every developer should run his own container and commit his work to a 'commulated one' - what do you think?

                    • 7. Re: Viable team development process for JSPs with Jboss/Tomc
                      Wouter Zoons Newbie

                      well, you could always explode your WAR bundle:

                      suppose your webapp is bundled in appname.war (you would normally copy this into /deploy), remove this bundle and create a directory in /deploy with exactly that same name 'appname.war', unzip your WAR bundle in there

                      you can then transparently use you webapp as though it was deployed as a bundle

                      you can update files at runtime by copying and overwriting, these new ones will be picked up by the container, I am not sure if this works for precompiled JSPs (never tried it), but it definately works for regular JSPs

                      this is a JBoss specific feature although other app servers might implement it also

                      on the other hand, it's probably more comfortable to run your local server (if you have enough RAM, I have 1,5GB on an AMD Athlon, I paid less than 100 euros for this RAM, so it was an easy decision to make)

                      HTH
                      Wouter.