• 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

Displaying Key Specified in Action->Exception tag key within a JSP

 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If I'm trying to specifiy a key to be displayed in the jsp page that the browser is forwarded to when an exception is thrown, what tag do I use to display it?

For example:
(struts-config.xml)



If I want to display the key "BS.error.key" in my JSP page "bs.site.error", what tags do I need to include in that JSP page to display the text of the BS.error.key?
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The behavior of the default Exception handler is to create an ActionMessages object in request scope that has an ActionMessage with the message you specified in the "key" attribute of your exception configuration.

You can then access that message in your error JSP with either the <html:errors> tag or a combination of the <html:messages> and <bean:write> tags.

However, I can see from your configuration that you have specified your own ExceptionHandler. The behavior of your ExceptionHandler may be entirely different. It's up to you what you do with it.
 
reply
    Bookmark Topic Watch Topic
  • New Topic