struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikeh96 <mi...@ncsa.edu>
Subject Re: Struts 2: Unable to catch exceptions via global-exception-mappings
Date Mon, 01 Oct 2007 13:19:28 GMT

Thanks for taking the time.. unfortunately, the exceptions are still
percolating up.
Do you have it working?  




Brian Trzupek wrote:
> 
> I am not 100% sure on this, but I think you need to have  
> struts.devMode = false in struts.properties.
> 
> Give that a whirl.
> 
> Brian-
> 
> On Sep 30, 2007, at 9:43 PM, mikeh96 wrote:
> 
>>
>> I am unable to trap an exception and it's being pushed up until it  
>> becomes a
>> 500 Servlet Exception.
>>
>> Basically, I want to catch the exception if a user mistypes an  
>> action name
>>
>> I am using struts2 (2.0.9).
>>
>> Here's the top of the trace:
>> org.apache.velocity.exception.ResourceNotFoundException:
>> Unable to find resource '/templates/screens/inddd2ex.vm'
>> at
>> org.apache.velocity.runtime.resource.ResourceManagerImpl.loadResource( 
>> ResourceManagerImpl.java:458)
>>
>> Here's my struts.xml file
>>
>> (thanks for helping)
>> ----------------------------------------------------------------
>> <package name="default" extends="struts-default">
>>
>> <interceptors>
>> <interceptor-stack name="simpleStack">
>> <interceptor-ref name="defaultStack" />
>> </interceptor-stack>
>> </interceptors>
>>
>>
>> <global-results>
>> <result name="Exception" type="velocity"
>>> /templates/screens/exception.vm</result>
>> </global-results>
>>
>> <global-exception-mappings>
>> <exception-mapping
>>    exception="java.lang.Exception"
>>    result="Exception"/>
>> <exception-mapping
>>    exception="org.apache.velocity.exception.ResourceNotFoundException"
>>    result="Exception"/>
>> <exception-mapping
>>    exception="java.lang.Runtime"
>>    result="Exception"/>
>> </global-exception-mappings>
>>
>>
>> <action name="*" class="com.opensymphony.xwork2.ActionSupport">
>> <interceptor-ref name="exception" />
>> <interceptor-ref name="defaultStack" />
>> <result type="velocity">/templates/screens/{1}.vm</result>
>> </action>
>>
>> </package>
>> ---------------------------------------------------------------------- 
>> ------
>> -- 
>> View this message in context: http://www.nabble.com/Struts-2%3A-- 
>> Unable-to-catch-exceptions-via-global-exception-mappings- 
>> tf4545971.html#a12972599
>> Sent from the Struts - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> 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
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Struts-2%3A--Unable-to-catch-exceptions-via-global-exception-mappings-tf4545971.html#a12978952
Sent from the Struts - User mailing list archive at Nabble.com.


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


Mime
View raw message