5 Replies Latest reply on Aug 23, 2006 3:57 PM by None None

    Testing pages within JBoss / Seam

    None None Master

      I'm sure all of us have heard of the PHP development cycle: you run httpd/php on your computer, you go into the htdocs directory, you edit the file, you hit reload, you tweak something, you hit reload again, etc. As horrible as PHP is, that does give you a quick testing loop.

      How can I do something like that with my .jsp pages? I fully understand that if I need to change some JavaBean or whatever, I do need to redeploy the app. But I don't need to make a lot of small incremental changes to the Java parts. I need to make lots of small incremental changes to the View part of it, like moving something around, changing a font, that kind of small thing.

      Can I do something like that within JBoss?

      Right now, I have a build.xml file which compiles everything and puts everything into a .ear file and copies it over to server/default/deploy and then I can hit reload.

      But is there a way I can make View-type changes (changes to my .jsp pages) without having to do that?

      I know that within Tomcat I can just go into the directory and change .jsp files and the server does the right thing.

        • 1. Re: Testing pages within JBoss / Seam
          David G. Newbie

          If you use JBoss IDE you can configure the debugger to reload your classes.
          See the JBoss IDE tutorial for more info.
          Yes, I think PHP is better for fast development :(

          • 2. Re: Testing pages within JBoss / Seam
            Maurice Zeijen Master

            You should deploy the ear package and all sub packages as exploded packages. Changes made in the jsp pages in the exploded package is immidiatly visible.

            I am using MyEclipse for my J2EE development. One of its big advantages is its hot deployement. It also automaticly deploys you jsp, jsf, xhtml, html, etc files to the server. A disadvantage is that you need to follow the MyEclipse project folder, but that isn't a real big problem. MyEclipse isn't free however, but it isn't expensive also.

            I also saw a plugin once that can synchronize the contents of one or more directories from your eclipse project to an external folder. It is free, but I don't know the name of the plugin anymore :(... But it could be usefull if you use it together with a exploded ear.

            • 3. Re: Testing pages within JBoss / Seam
              None None Master

              Hmm, how do I deploy them as exploded packages? Do I just leave it as a directory and copy that directory over?

              As for synchronizing files, that's easy to do with standard Linux tools (I run on Linux). I can just make something do a find in the directory once a second for any file modified in the last second and copy it over.

              • 4. Re: Testing pages within JBoss / Seam
                Stan Silvert Master

                One option is to use an exploded directory off off /deploy like this:

                server/default/deploy/myear.ear/application.xml
                server/default/deploy/myear.ear/mywar.war/WEB-INF/web.xml
                ...

                If you don't want to work out of the JBoss /deploy directory, you can tell the JBoss deployer to also look in your project directory:

                myproject/myear.ear/application.xml
                myproject/myear.ear/mywar.war/WEB-INF/web.xml
                ...

                You will edit the conf/jboss-service.xml file. The last MBean in the file controls the deployer. To see doc on all the options you can set, go to http://www.jboss.org/wiki/Wiki.jsp?page=ConfiguringTheDeploymentScannerInConfjbossSystem.xml

                Stan

                • 5. Re: Testing pages within JBoss / Seam
                  None None Master

                  Thanks Stan. That's what I needed to know: the directory name. It should be my-app.ear/ . I'll try that out. As for copying files, I can make it automatically update the JSPs only with about two lines of shell script. Such is the joy of Linux.