facebook

Restarting web container when changing struts-config.xml

  1. MyEclipse IDE
  2.  > 
  3. Java EE Development (EJB, JSP, Struts, XDoclet, etc.)
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #226080 Reply

    acuretra
    Member

    I do struts work at the momemnt and need to experiment quite a bit to get it right. Currently I need to restart the web container (Resin and Tomcat) in order to get it to reread the struts-config.xml file, which is a bit cumbersome.

    Is there a simple way of telling MyEclipse to restart the web container when this file is changed. It knows to do it for other files, so this might be quite simple.

    I am running a

    Version: 3.8.4
    Build id: 200501171200-3.8.4

    #226114 Reply

    Riyad Kalla
    Member

    The best solution to this is to:
    a) Use tomcat
    b) Load up an extra browser window and connect to your Tomcat Manager webapp (http://localhost:8080, click on the Manager link on left and login)
    c) See the Tomcat docs on how to setup access to the Manager

    Then just click the “Restart” link next to the webapp you want to restart.

    The fundamental problem here is that Struts was not written to reload changed struts-config.xml files so you need to force it to by restarting the webapp.

    Actually, I think you can “Trick” tomcat into doing this by modifying your web.xml file, try adding a space, then removing it and saving the file.. Tomcat should pickup the changed web.xml file and reload the context.

    #226127 Reply

    acuretra
    Member

    Thank you for your reply.

    I had not thought of doing it that way, and it does not help in Resin.

    Is there a way to tell MyEclipse that _it_ needs to restart the web container if this file is changed?

    #226128 Reply

    Riyad Kalla
    Member

    I had not thought of doing it that way, and it does not help in Resin.

    Did you see my web.xml trick? I believe that will work for any app server.

    Is there a way to tell MyEclipse that _it_ needs to restart the web container if this file is changed?

    Restarting the web context is what I’m guessing you meant and no there isn’t a way. We support 20+ app servers, so we keep our app-server-specific features to a minimum because implementing that functionality once means we need to implement it 20 other times for all other connectors, and each one is totally different.

    #226150 Reply

    ahanys
    Member

    @support-rkalla wrote:

    I had not thought of doing it that way, and it does not help in Resin.

    Did you see my web.xml trick? I believe that will work for any app server.

    Is there a way to tell MyEclipse that _it_ needs to restart the web container if this file is changed?

    Restarting the web context is what I’m guessing you meant and no there isn’t a way. We support 20+ app servers, so we keep our app-server-specific features to a minimum because implementing that functionality once means we need to implement it 20 other times for all other connectors, and each one is totally different.

    DO IT THIS WAY:
    When the user changes struts-config.xml than you programmatically change the web.xml file timestamp or add/delete space in web.xml file. This way you will implement the same way the web-context restarting functionality on every web container.

    Isn’t it?
    🙂

Viewing 5 posts - 1 through 5 (of 5 total)
Reply To: Restarting web container when changing struts-config.xml

You must be logged in to post in the forum log in