• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Struts2 struts.xml result options

 
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey Guys -

I am trying to get an action to stay on the same page if it is successful, and go elsewhere if not.

If I only define the error messages, the successful result is undefined in struts, and I get an error.

Is there a way to get the <result> part of the struts.xml action definition to forward to a dynamic URL?

Thanks!
 
Ranch Hand
Posts: 433
Netbeans IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, you can have dynamic results. Have a look at http://struts.apache.org/2.1.2/docs/result-configuration.html
And if you want to stay on the same page, why don't you provide the page you came from as the result?
 
Sam Gardner
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Joachim Rohde:
Yes, you can have dynamic results. Have a look at http://struts.apache.org/2.1.2/docs/result-configuration.html
And if you want to stay on the same page, why don't you provide the page you came from as the result?



Thanks for the link. Is there some sort of comprehensive tag documentation somewhere? The tag reference library doesn't have everything documented, the API's don't have anything about tags that I can see, and the guides section on the Struts2 page doesn't have everything used yet.

As for providing the page I came from as a result, how would I go about doing that? Is there an interface for accessing session information from stuts.xml or my action classes?

The action I am writing is hopefully going to be something I can put at the top every page that users need to be logged in to view, so I'd like to forward away if they aren't logged in, and stay there if they are logged in.
 
reply
    Bookmark Topic Watch Topic
  • New Topic