Mmm... doesn't work.

This is in my struts.xml:

        <action name="login"
class="org.almayer.web.action.SessionAction" method="login">
            <result name="redirect" type="redirectAction">${redirectTo}</result>
        </action>

This is the login action's method (I omitt logic):

    public String login() throws Exception {
            return "home";
    }

And this is the Tomcat response:

    type: Status report

    message: No result defined for action
org.almayer.web.action.SessionAction and result home

    description: The requested resource (No result defined for action
org.almayer.web.action.SessionAction and result home) is not
available.

What's my fault?

Gianluca




2008/9/23 Gianluca Musella <[EMAIL PROTECTED]>:
> thank you Alexander, I understand well now.
>
> Bye,
>
> Gianluca
>
>
>
>
> 2008/9/23 Alexander Baetz <[EMAIL PROTECTED]>:
>> here a longer explanation:
>>
>> when I realizes the user isnt authenticated the link (the action to be
>> called) is saved (in a bean, a session, somewhere where you find it back
>> later)
>> then the user logs himself in. the login action logs him in, checks if a
>> redirect was saved (in the bean, the session,.....)
>> and returns a special result
>>
>> <result name="redirect" type="redirectAction">${redirectTo}</result>
>>
>> the string inside the result is the return value of the call "getredirectTo"
>> on the value stack (where the action lies on top)
>> so if your user wants to get a.action all you have to do is return redirect
>> as the result of the login action and return "a" for getredirectTo.
>>
>> Greetings,
>> Alexander
>>
>>
>> Gianluca Musella schrieb:
>>>
>>> Thank you.
>>>
>>> I can't understand how to realize the redirect descripted here:
>>>
>>>
>>>>
>>>> - during the login action, after the login is confirmed the action
>>>> realizes
>>>> that a redirect is requestet (to a.action)
>>>>
>>>
>>> Particulary I can't understand what it means:
>>>
>>>
>>>>
>>>> <result name="redirect" type="......">${redirectTo}</result>
>>>>
>>>
>>> Do you have a sample?
>>>
>>> Gianluca
>>>
>>>
>>> 2008/9/23 Alexander Baetz <[EMAIL PROTECTED]>:
>>>
>>>>
>>>> I thought of the same problem some time ago.
>>>>
>>>> - during the execution of I all information for the correct redirect is
>>>> stored (session, bean... whatsoever)
>>>> - during the login action, after the login is confirmed the action
>>>> realizes
>>>> that a redirect is requestet (to a.action)
>>>>
>>>> now the login action can get a result like this
>>>>
>>>> <result name="redirect" type="......">${redirectTo}</result>
>>>>
>>>> now the action is asced for the correct action name/tiles view... it
>>>> shall
>>>> return.
>>>>
>>>> Greetings,
>>>> Alexander
>>>>
>>>> Gianluca Musella schrieb:
>>>>
>>>>>
>>>>> This is my requirement:
>>>>>
>>>>> - the user asks for a resource, say A.action
>>>>> - the controller fires a custom interceptor I to authenticate the user
>>>>> - user isn't authenticated, so I redirect to L, the login page
>>>>> - user enters valid credentials
>>>>> - the controller redirect to the original requested A.action
>>>>>
>>>>> The problem is that the results of the login action are statically
>>>>> cablated in struts.xml:
>>>>>
>>>>>               <result type="tiles" name="success">home</result>
>>>>>               <result type="tiles" name="failure">login</result>
>>>>>
>>>>> But I need a new case to redirect dynamically to A.action (I can't
>>>>> provide statically all cases in my struts.xml).
>>>>>
>>>>> How can I have this behaviour?
>>>>>
>>>>> thanks
>>>>>
>>>>> Gianluca
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>>>
>>>>>
>>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>>
>>>>
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to