You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by hezjing <he...@gmail.com> on 2007/08/27 10:19:08 UTC

[S2] Refresh JSP in Tomcat 5.5

Hi

I have a index.html that will redirect to WelcomeAction,

===== index.html =====
<html>
<head>
<META HTTP-EQUIV="Refresh" CONTENT="0;URL=welcome.action">
</head>
<body>
<p>Loading ...</p>
</body>
</html>


WelcomeAction does nothing but simply returns success from execute().

===== WelcomeAction.java =====
public class WelcomeAction extends ActionSupport {
    public String execute() throws Exception {
        return SUCCESS;
    }
}


Struts will then forward the result to index.jsp,

===== struts.xml =====
<struts>
  <constant name="struts.objectFactory" value="spring" />
  <constant name="struts.devMode" value="true" />
  <package name="example" extends="struts-default">
    <action name="welcome" class="welcomeAction" method="execute">
      <result>index.jsp</result>
    </action>
  </package>
</struts>

===== index.jsp =====
<html>
<head>
<title>TITLE</title>
</head>
<body>
</body>
</html>


All of this is working fine, I entered
http://localhost:8080/myapp/index.html and the IE6 displayed the
index.jsp.

However, it will not display the latest JSP after I modified the
content (e.g. the title) of the index.jsp until I restart Tomcat
service.

Do you know how to reload the JSP without restarting the Tomcat?


Note: this seems to be not a Tomcat problem because it was able to
display the latest JSP when I took out all the Struts 2's action and
configuration.


-- 

Hez

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [S2] Refresh JSP in Tomcat 5.5

Posted by Alvaro Sanchez-Mariscal <al...@gmail.com>.
If you use Eclipse and WTP (ie, Servers view), a redeploy is not
required when changing JSP files.

Anothed option is to use jetty, if you use maven.

Alvaro.

On 8/27/07, hezjing <he...@gmail.com> wrote:
> Hi
>
> I have a index.html that will redirect to WelcomeAction,
>
> ===== index.html =====
> <html>
> <head>
> <META HTTP-EQUIV="Refresh" CONTENT="0;URL=welcome.action">
> </head>
> <body>
> <p>Loading ...</p>
> </body>
> </html>
>
>
> WelcomeAction does nothing but simply returns success from execute().
>
> ===== WelcomeAction.java =====
> public class WelcomeAction extends ActionSupport {
>     public String execute() throws Exception {
>         return SUCCESS;
>     }
> }
>
>
> Struts will then forward the result to index.jsp,
>
> ===== struts.xml =====
> <struts>
>   <constant name="struts.objectFactory" value="spring" />
>   <constant name="struts.devMode" value="true" />
>   <package name="example" extends="struts-default">
>     <action name="welcome" class="welcomeAction" method="execute">
>       <result>index.jsp</result>
>     </action>
>   </package>
> </struts>
>
> ===== index.jsp =====
> <html>
> <head>
> <title>TITLE</title>
> </head>
> <body>
> </body>
> </html>
>
>
> All of this is working fine, I entered
> http://localhost:8080/myapp/index.html and the IE6 displayed the
> index.jsp.
>
> However, it will not display the latest JSP after I modified the
> content (e.g. the title) of the index.jsp until I restart Tomcat
> service.
>
> Do you know how to reload the JSP without restarting the Tomcat?
>
>
> Note: this seems to be not a Tomcat problem because it was able to
> display the latest JSP when I took out all the Struts 2's action and
> configuration.
>
>
> --
>
> Hez
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


-- 
Alvaro Sanchez-Mariscal Arnaiz
Java EE Architect & Instructor
alvaro.sanchezmariscal@gmail.com

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [S2] Refresh JSP in Tomcat 5.5

Posted by hezjing <he...@gmail.com>.
Can you explain what these Struts properties mean (see also
http://struts.apache.org/2.0.9/docs/strutsproperties.html) ?

struts.serve.static=true
struts.serve.static.browserCache=true


What does a static content means? In my case, the index.jsp is a static content?

Anyway, setting struts.serve.static.browserCache = false does not
refresh the latest JSP either :-(



On 8/27/07, hezjing <he...@gmail.com> wrote:
> I modified index.jsp directly in Tomcat 5.5\webapps\myapp directory.
>
> 1) Restart Tomcat 5.5.23
> 2) Accessed http://localhost:8080/myapp
> 3) Modified the title of Tomcat 5.5\webapps\myapp\index.jsp
> 4) Pressed Ctrl+F5 on IE6 (http://localhost:8080/myapp/welcome.action),
> BUT it is still showing the old version of index.jsp
>
> When checked, Tomcat
> 5.5\work\Catalina\localhost\myapp\org\apache\jsp\index_jsp.java is
> still writting the old title (?)
>
>
>
> On 8/27/07, Andrei Sauchanka <An...@epam.com> wrote:
> > Hi, You can try to replace your index.jsp in tomcat directory where tom cat copies your apps. For example [tom cat dir]/webapps/[Your apps]/ It works without restarting tom cat server, just refresh your page in IE (Ctrl+F5).
> >
> > Andrei Sauchanka,
> > Software Engineer
> > EPAM Systems
> > Gomel office, Belarus (GMT+2)
> > Office fax: +375 (23) 553-200
> > Mobile: +375 (29) 236-66-04, 124-42-68
> > E-mail: Andrei_Sauchanka@epam.com
> > WWW: http://www.epam.com
> >
> > CONFIDENTIALITY CAUTION AND DISCLAIMER
> > This message is intended only for the use of the individual(s) or entity(ies) to which it is addressed and contains information that is legally privileged and confidential. If you are not the intended recipient, or the person responsible for delivering the message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. All unintended recipients are obliged to delete this message and destroy any printed copies.
> >
> >
> > -----Original Message-----
> > From: hezjing [mailto:hezjing@gmail.com]
> > Sent: Monday, August 27, 2007 11:19
> > To: struts-users
> > Subject: [S2] Refresh JSP in Tomcat 5.5
> >
> > Hi
> >
> > I have a index.html that will redirect to WelcomeAction,
> >
> > ===== index.html =====
> > <html>
> > <head>
> > <META HTTP-EQUIV="Refresh" CONTENT="0;URL=welcome.action">
> > </head>
> > <body>
> > <p>Loading ...</p>
> > </body>
> > </html>
> >
> >
> > WelcomeAction does nothing but simply returns success from execute().
> >
> > ===== WelcomeAction.java =====
> > public class WelcomeAction extends ActionSupport {
> >    public String execute() throws Exception {
> >        return SUCCESS;
> >    }
> > }
> >
> >
> > Struts will then forward the result to index.jsp,
> >
> > ===== struts.xml =====
> > <struts>
> >  <constant name="struts.objectFactory" value="spring" />
> >  <constant name="struts.devMode" value="true" />
> >  <package name="example" extends="struts-default">
> >    <action name="welcome" class="welcomeAction" method="execute">
> >      <result>index.jsp</result>
> >    </action>
> >  </package>
> > </struts>
> >
> > ===== index.jsp =====
> > <html>
> > <head>
> > <title>TITLE</title>
> > </head>
> > <body>
> > </body>
> > </html>
> >
> >
> > All of this is working fine, I entered
> > http://localhost:8080/myapp/index.html and the IE6 displayed the
> > index.jsp.
> >
> > However, it will not display the latest JSP after I modified the
> > content (e.g. the title) of the index.jsp until I restart Tomcat
> > service.
> >
> > Do you know how to reload the JSP without restarting the Tomcat?
> >
> >
> > Note: this seems to be not a Tomcat problem because it was able to
> > display the latest JSP when I took out all the Struts 2's action and
> > configuration.
> >
> >
> > --
> >
> > Hez
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
>
>
> --
>
> Hez
>


-- 

Hez

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [S2] Refresh JSP in Tomcat 5.5

Posted by hezjing <he...@gmail.com>.
I modified index.jsp directly in Tomcat 5.5\webapps\myapp directory.

1) Restart Tomcat 5.5.23
2) Accessed http://localhost:8080/myapp
3) Modified the title of Tomcat 5.5\webapps\myapp\index.jsp
4) Pressed Ctrl+F5 on IE6 (http://localhost:8080/myapp/welcome.action),
BUT it is still showing the old version of index.jsp

When checked, Tomcat
5.5\work\Catalina\localhost\myapp\org\apache\jsp\index_jsp.java is
still writting the old title (?)



On 8/27/07, Andrei Sauchanka <An...@epam.com> wrote:
> Hi, You can try to replace your index.jsp in tomcat directory where tom cat copies your apps. For example [tom cat dir]/webapps/[Your apps]/ It works without restarting tom cat server, just refresh your page in IE (Ctrl+F5).
>
> Andrei Sauchanka,
> Software Engineer
> EPAM Systems
> Gomel office, Belarus (GMT+2)
> Office fax: +375 (23) 553-200
> Mobile: +375 (29) 236-66-04, 124-42-68
> E-mail: Andrei_Sauchanka@epam.com
> WWW: http://www.epam.com
>
> CONFIDENTIALITY CAUTION AND DISCLAIMER
> This message is intended only for the use of the individual(s) or entity(ies) to which it is addressed and contains information that is legally privileged and confidential. If you are not the intended recipient, or the person responsible for delivering the message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. All unintended recipients are obliged to delete this message and destroy any printed copies.
>
>
> -----Original Message-----
> From: hezjing [mailto:hezjing@gmail.com]
> Sent: Monday, August 27, 2007 11:19
> To: struts-users
> Subject: [S2] Refresh JSP in Tomcat 5.5
>
> Hi
>
> I have a index.html that will redirect to WelcomeAction,
>
> ===== index.html =====
> <html>
> <head>
> <META HTTP-EQUIV="Refresh" CONTENT="0;URL=welcome.action">
> </head>
> <body>
> <p>Loading ...</p>
> </body>
> </html>
>
>
> WelcomeAction does nothing but simply returns success from execute().
>
> ===== WelcomeAction.java =====
> public class WelcomeAction extends ActionSupport {
>    public String execute() throws Exception {
>        return SUCCESS;
>    }
> }
>
>
> Struts will then forward the result to index.jsp,
>
> ===== struts.xml =====
> <struts>
>  <constant name="struts.objectFactory" value="spring" />
>  <constant name="struts.devMode" value="true" />
>  <package name="example" extends="struts-default">
>    <action name="welcome" class="welcomeAction" method="execute">
>      <result>index.jsp</result>
>    </action>
>  </package>
> </struts>
>
> ===== index.jsp =====
> <html>
> <head>
> <title>TITLE</title>
> </head>
> <body>
> </body>
> </html>
>
>
> All of this is working fine, I entered
> http://localhost:8080/myapp/index.html and the IE6 displayed the
> index.jsp.
>
> However, it will not display the latest JSP after I modified the
> content (e.g. the title) of the index.jsp until I restart Tomcat
> service.
>
> Do you know how to reload the JSP without restarting the Tomcat?
>
>
> Note: this seems to be not a Tomcat problem because it was able to
> display the latest JSP when I took out all the Struts 2's action and
> configuration.
>
>
> --
>
> Hez
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


-- 

Hez

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: [S2] Refresh JSP in Tomcat 5.5

Posted by Andrei Sauchanka <An...@epam.com>.
Hi, You can try to replace your index.jsp in tomcat directory where tom cat copies your apps. For example [tom cat dir]/webapps/[Your apps]/ It works without restarting tom cat server, just refresh your page in IE (Ctrl+F5).

Andrei Sauchanka,
Software Engineer
EPAM Systems
Gomel office, Belarus (GMT+2)
Office fax: +375 (23) 553-200
Mobile: +375 (29) 236-66-04, 124-42-68
E-mail: Andrei_Sauchanka@epam.com
WWW: http://www.epam.com

CONFIDENTIALITY CAUTION AND DISCLAIMER
This message is intended only for the use of the individual(s) or entity(ies) to which it is addressed and contains information that is legally privileged and confidential. If you are not the intended recipient, or the person responsible for delivering the message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. All unintended recipients are obliged to delete this message and destroy any printed copies.


-----Original Message-----
From: hezjing [mailto:hezjing@gmail.com] 
Sent: Monday, August 27, 2007 11:19
To: struts-users
Subject: [S2] Refresh JSP in Tomcat 5.5

Hi

I have a index.html that will redirect to WelcomeAction,

===== index.html =====
<html>
<head>
<META HTTP-EQUIV="Refresh" CONTENT="0;URL=welcome.action">
</head>
<body>
<p>Loading ...</p>
</body>
</html>


WelcomeAction does nothing but simply returns success from execute().

===== WelcomeAction.java =====
public class WelcomeAction extends ActionSupport {
    public String execute() throws Exception {
        return SUCCESS;
    }
}


Struts will then forward the result to index.jsp,

===== struts.xml =====
<struts>
  <constant name="struts.objectFactory" value="spring" />
  <constant name="struts.devMode" value="true" />
  <package name="example" extends="struts-default">
    <action name="welcome" class="welcomeAction" method="execute">
      <result>index.jsp</result>
    </action>
  </package>
</struts>

===== index.jsp =====
<html>
<head>
<title>TITLE</title>
</head>
<body>
</body>
</html>


All of this is working fine, I entered
http://localhost:8080/myapp/index.html and the IE6 displayed the
index.jsp.

However, it will not display the latest JSP after I modified the
content (e.g. the title) of the index.jsp until I restart Tomcat
service.

Do you know how to reload the JSP without restarting the Tomcat?


Note: this seems to be not a Tomcat problem because it was able to
display the latest JSP when I took out all the Struts 2's action and
configuration.


-- 

Hez

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org