Results 1 to 3 of 3

Thread: on-exception

  1. #1
    Join Date
    Jul 2007
    Location
    Mauritius
    Posts
    127

    Default on-exception

    Hello guys,
    i am using the on-exception as follows:
    Code:
    	<global-transitions>
    		<transition on-exception="java.lang.NullPointerException" to="exceptionView" />
        </global-transitions>

    But when the nullpointer exception occurs, I see it on my console and it is not going on the desired view.

    Can anybody give me a hint why this is so?

    Thanks
    Kris

  2. #2
    Join Date
    Jan 2008
    Location
    Spain - Espaņa
    Posts
    37

    Default

    Hi,
    i think you must catch "java.lang.NullPointerException" on action, pojo.... i have an old sample whit it, but it runs in normal transition how this:
    Code:
    	<view-state id="xxxxxxxxxx" view="/xxxxxxxxxx.jsp">
    		<transition on="event" to="nextState">
    			<action bean="formAction" method="bindAndValidate">
    				<attribute name="validatorMethod" value="validateDatos" />
    			</action>
    		</transition>
    		<transition on-exception="java.lang.ArithmeticException" to="error"/>
    
    	</view-state>
    the exception was caugth on method action class

    I din't try it on global transition, see if it is your problem
    regards

  3. #3
    Join Date
    Jul 2007
    Location
    Mauritius
    Posts
    127

    Default

    Hello there,

    i actually got the global thing to work.

    When I first started testing the exception, I did not specify an attribute in the input-mapper and as a result a null pointer exception was being generated by the framework. This could not be catched!!
    However, if it is an exception from the actions in the flow, then it works.


    Regards
    Kris

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •