This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Struts and the fly likes Struts Refresh Page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts Refresh Page" Watch "Struts Refresh Page" New topic

Struts Refresh Page

Scott Selikoff
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3700

What's the best way to do an HTML equivalent of a meta-refresh in struts? For example, to make a page to automatically refresh every 10 seconds.

One (good?) method would be just to use an HTML meta tag. The only difficulty is the URL value. Currently, when I construct a link, I use struts tags to fully resolve it. For example, in an html:form tag, the action value is converted from "/buildWidget" to "/myApp/buildWidget". Is there a struts tag I can use to insert the fully resolved URL inside the meta tag?

Or is there a better way to do page refreshes in struts all together?

My Blog: Down Home Country Coding with Scott Selikoff
Scott Selikoff
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3700

Nevermind about the inserting the URL part, I forgot I could use a c:url to insert the URL.

Back to my original question though, what is the best way for a page refresh in struts? Just an HTML meta tag?
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
I'd suggest using the JSTL <c:url> tag, which also prepends the context to the url.

Consultant, Sima Solutions
It is sorta covered in the JavaRanch Style Guide.
subject: Struts Refresh Page
Similar Threads
AutoSubmit When a Page is Called
how to reload a jsp page ?
two questions
Page refresh after Action execute