7 Replies Latest reply on Jan 3, 2008 5:11 PM by loopix

    Create plugin for a web application

    loopix

      Hi all,


      I'm trying to make a Web application but now, I'm stuck because I try to do things that I don't know if it's possible....


      I have write the "base" of the application, that consist of a login page and a main page. The application wanted must work with plugin, like Eclipse (a plateform and severals plugin). So, I can say that I've got a plateform, and now, I must develop some plugin to add some function to the web application.


      The problem is that a plugin will contains:
      - html page
      - jsp page
      - servlet page
      - class file
      - other file

      Recently, I've learn how to make plugin for Java project (normal application)... So, I must create some interfaces and search, into a specific directories, for plugin. But, for a web application, I don't know how to add html page and servlet (and set context for servlet) into a web module who is already deploied and running ...


      My web application is packaged into a war file wich is also packaged into an ear archive. So, I want to make the base of the plateform into an EAR file and add somes .jar files to a specific directories.


      So for now, I'm stuck because I don't know if it's possible to add page and context to an web based application. The perfect solution should use Java stuff and not JBoss stuff ...


      Because I'm really stuck, it would be great if someones try to put me on the good way :)


      Thanks to all

        • 1. Re: Create plugin for a web application
          loopix

          EDIT: is there any way to do a "addServlet()" in a Web Application (.war, from a servlet for example ...) using JBoss application server ???

          • 2. Re: Create plugin for a web application
            jaikiran

             

            My web application is packaged into a war file wich is also packaged into an ear archive. So, I want to make the base of the plateform into an EAR file and add somes .jar files to a specific directories.


            You might want to have a look at http://wiki.jboss.org/wiki/Wiki.jsp?page=ExplodedDeployment. This way, your EAR and WAR files can be deployed as normal folders and you can dynamically put content in that folder.

            • 3. Re: Create plugin for a web application
              loopix

              Yes, thanks

              I think I have no choice and must follow this way. But, I got a last question:


              Is it possible, for a web application already deployed, to modify itself ?
              I say that because I will need to update web.xml or application.xml with that application, so JBoss will re-deploy the archive and then ... the application will stop, but ... what's happen if this application has not finish the modification on itself ???? Crash ? ...

              • 4. Re: Create plugin for a web application
                jaikiran

                If you change a jsp file in your web application then you dont have to do anything. The change will be automatically picked up. However if you change a class file then you will have to touch the web.xml for the application to be redeployed

                • 5. Re: Create plugin for a web application
                  loopix

                  Ok, thanks very much, now I'm on the good road :)

                  So, my last idea is:

                  - a plugin will be a .war file (it's easy to develop it on Eclipse, separately)
                  - the web application base will load a directories with .war files
                  - a .war files is unpackaged and will be a part of "web_plugin.war" modules (exploded archive) which is empty at the start of the application (first time or not, ...)

                  So, I got 2 web modules:
                  - web_base
                  - web_plugin

                  the second module will be filled by all files contained into .war files on a specific directories .. I think that idea must work, but actually, I must open a gived WAR file .. unpack it, copy files to web_plugin.war and update the application (if needed). All of that work must be hardcoded in Java, so ... first: try to deploy a helloworld plugin which contains only a html page ...

                  For now, don't know how to open a .war files with a .war application :D

                  • 6. Re: Create plugin for a web application
                    jaikiran

                     

                    "loopix" wrote:

                    For now, don't know how to open a .war files with a .war application :D


                    Look at the APIs available in java.util.zip.ZipFile http://java.sun.com/j2se/1.4.2/docs/api/java/util/zip/ZipFile.html

                    • 7. Re: Create plugin for a web application
                      loopix

                      Great :)


                      I will take a look, now