my dog learned polymorphism
The moose likes Struts and the fly likes exception in struts handling in JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "exception in struts handling in JSP" Watch "exception in struts handling in JSP" New topic

exception in struts handling in JSP

sitaram irrinki
Ranch Hand

Joined: Feb 16, 2005
Posts: 158
how can we catch expections in struts using JSP's
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63349

Moved to the Struts forum.

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
alan do
Ranch Hand

Joined: Apr 14, 2005
Posts: 354
exceptions can be handled declaratively globally or locally (per action mapping) by defining them in struts-config.xml. this is documented in the struts user guide on apache web site. you essentially map an exception to a message key and a forward (jsp, tile, action mapping) and use html:errors to display the message in your jsp. in this sense, jsp does NOT handle the exception.

you can also define exception handlers for your exceptions.

-/a<br />certified slacker...yes, my last name is 'do' - <a href="" target="_blank" rel="nofollow"></a>
Brett Han

Joined: May 17, 2005
Posts: 10
Thanks for the help - that was exactly what I was doing, but I found my problem. The action was actually completing before the property was updated in my form bean - so at the time the page was refreshed, it actually _was_ correct (the items were deleted immediately after).

Thanks again.
Brett Han

Joined: May 17, 2005
Posts: 10
I apologize - I posted the previous message in the wrong thread.
I agree. Here's the link:
subject: exception in struts handling in JSP
jQuery in Action, 3rd edition