struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From leonardo aramaki <leoaram...@gmail.com>
Subject How to map a wildcard-matched method to an exception?
Date Fri, 02 Jul 2010 17:25:15 GMT
Hello,

I'm working with Struts 2.1.8.1, JDK 1.6.0_17, with container WASCE 2.1 on
Windows 7 Pro.

Here's a snippet of my struts.xml file:

<struts>

..

<constant name="struts.devMode" value="true" />

...

<action name="*test" class="fend.config.TestAction" method="{1}">
            <exception-mapping result="fail"
exception="java.lang.UnsupportedOperationException"/>
            <result name="success">/registerCrisis.jsp</result>
            <result name="dummy">/dummy.jsp</result>
            <result name="fail">/error.jsp</result>
            <interceptor-ref name="configStack"/>
</action>
...
</struts>


When I run the application as:
http://localhost:8080/appContext/viewtest.action, struts calls the view
method in the TestAction class. In the view method I put a code that
generates a *java.lang.UnsupportedOperationException* just for testing
purposes.

What I intended was to redirect to the result named fail, so that error.jsp
is exhibited. But it does not redirect to the page. What I've missed?

Thank you.

-- 
Leonardo Aramaki

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message