views:

8

answers:

1

I'm newbie, so please forgive bad terminology, etc... I want to only follow through on my forward when a condition is met, but I don't know how to incorporate that into my struts config xml. For example, I have this:

<action path="somePath"
        type="myTypeClass" 
        parameter="method" 
        scope="request">
    <forward name="myForwardName1" path="myPage1.jsp"/>
    <forward name="myForwardName2" path="myPage2.jsp"/>
</action>

But I want this action to only work when a condition is true and throw an exception otherwise. Is there some syntax I can use to this. For example, I want none of the jsp pages to display if my condition is not met, but display some generic error message instead.

A: 

If I'm not mistaken, I don't think it's possible. Your Struts Action is where your business logic is implemented and decisions are made there to which ActionForward you want Struts to forward to.

Well, there are Struts-Validation that you can look at if you have predefined rules to link to a forward.

The Elite Gentleman