struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lukasz Lenart <lukaszlen...@apache.org>
Subject Re: Struts2 Exception Handling
Date Fri, 21 Jun 2013 06:44:44 GMT
There is nothing like CatchAll in Struts 2, you define result per exception type

<global-exception-mappings>
    <exception-mapping
exception="org.apache.struts.register.exceptions.SecurityBreachException"
result="securityerror" />
    <exception-mapping exception="java.lang.Exception" result="error" />
</global-exception-mappings>

so all other exceptions than SecurityBreachException will be directed
to result "error" and error.jsp prints the stacktrace as well:

<h4>Exception Details: <s:property value="exceptionStack" /></h4>

so maybe remove that line and your are done.


Regards
-- 
Łukasz
mobile +48 606 323 122 http://www.lenart.org.pl/

2013/6/21 Sreekanth S. Nair <sreekanth.nair@egovernments.org>:
> Hi Lukasz,
>                 Thanks for your replay, i did the same way only, but there
> are some exception still going uncaught and showing the stacktrace to view.
> There was something called CatchAll, can you please tell me how to do it.
>
> --
> Thanks & Regards
> Srikanth
> Software Developer
> --------------------------------
> eGovernments Foundations
> www.egovernments.org
> Mob : 9980078913
> --------------------------------
>
>
> On Fri, Jun 21, 2013 at 11:50 AM, Lukasz Lenart <lukaszlenart@apache.org>wrote:
>
>> 2013/6/21 Sreekanth S. Nair <sreekanth.nair@egovernments.org>:
>> > Hi,
>> >     Can anyone point me a tutorial or reference for how to handle
>> exception
>> > (uncaught or all exception). There are so many tutorial available online
>> > but all are different.
>>
>> http://struts.apache.org/development/2.x/docs/exception-handling.html
>>
>>
>> Regards
>> --
>> Łukasz
>> + 48 606 323 122 http://www.lenart.org.pl/
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>

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


Mime
View raw message