You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "gianluca.musella@gmail.com" <gi...@gmail.com> on 2008/09/22 18:25:21 UTC

Global result of type redirect

Ho all.

I'm il train!

It is possible in struts.xml to have global result of type redirect?

My struts.xml doesn't give validation errors, but results or type  
redirect aren't visible ho the controller.

Please help

Gianluca



Inviato da iPhone

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


Re: Global result of type redirect

Posted by Chris Pratt <th...@gmail.com>.
What is the message you're receiving?  From what you've provided I can't
tell if it's that it can't find the redirect result type, or the
/homeSecure.action to redirect to.
  (*Chris*)

On Mon, Sep 22, 2008 at 4:03 PM, Gianluca Musella <
gianluca.musella@gmail.com> wrote:

> Hello Chris. Thank you.
>
> > Are you saying you want to set the default result type to "redirect"
> > globally or that you just want a global result type of "redirect" to be
> > available to your actions?
>
> The second. I wrote this:
>
> <package name="almayer" namespace="/" extends="struts-default">
>
>        <global-results>
>            <result name="login">/component/login.jsp</result>
>            <result type="redirect"
> name="homeSecure">/homeSecure.action</result>
>            <result type="redirect"
> name="homeUnsecure">/homeUnsecure.action</result>
>        </global-results>
>
> Te problem is that the struts.xml is validated in the startup phase,
> but if some action returns "homeSecure",  I receive an error because
> the forward isn't defined.
>
> That's all. Where is my fault?
>
> Gianluca
>
>
>
>
>
> 2008/9/22 Chris Pratt <th...@gmail.com>:
> > Are you saying you want to set the default result type to "redirect"
> > globally or that you just want a global result type of "redirect" to be
> > available to your actions?
> >
> > If the former, just redefine the "redirect" result type in your package
> and
> > set it to default="true", like:
> >
> >          <result-types>
> >            <result-type name="redirect"
> > class="org.apache.struts2.dispatcher.ServletRedirectResult"
> default="true"/>
> >          </result-types>
> >
> > If the latter, make sure your package extends "struts-default"  that's
> where
> > all the standard result types get defined.
> >  (*Chris*)
> >
> >
> > On Mon, Sep 22, 2008 at 9:25 AM, gianluca.musella@gmail.com <
> > gianluca.musella@gmail.com> wrote:
> >
> >>
> >> Ho all.
> >>
> >> I'm il train!
> >>
> >> It is possible in struts.xml to have global result of type redirect?
> >>
> >> My struts.xml doesn't give validation errors, but results or type
> redirect
> >> aren't visible ho the controller.
> >>
> >> Please help
> >>
> >> Gianluca
> >>
> >>
> >>
> >> Inviato da iPhone
> >>
> >> ---------------------------------------------------------------------
> >> 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
>
>

Re: Global result of type redirect

Posted by Gianluca Musella <gi...@gmail.com>.
Hello Chris. Thank you.

> Are you saying you want to set the default result type to "redirect"
> globally or that you just want a global result type of "redirect" to be
> available to your actions?

The second. I wrote this:

<package name="almayer" namespace="/" extends="struts-default">

        <global-results>
            <result name="login">/component/login.jsp</result>
            <result type="redirect"
name="homeSecure">/homeSecure.action</result>
            <result type="redirect"
name="homeUnsecure">/homeUnsecure.action</result>
        </global-results>

Te problem is that the struts.xml is validated in the startup phase,
but if some action returns "homeSecure",  I receive an error because
the forward isn't defined.

That's all. Where is my fault?

Gianluca





2008/9/22 Chris Pratt <th...@gmail.com>:
> Are you saying you want to set the default result type to "redirect"
> globally or that you just want a global result type of "redirect" to be
> available to your actions?
>
> If the former, just redefine the "redirect" result type in your package and
> set it to default="true", like:
>
>          <result-types>
>            <result-type name="redirect"
> class="org.apache.struts2.dispatcher.ServletRedirectResult" default="true"/>
>          </result-types>
>
> If the latter, make sure your package extends "struts-default"  that's where
> all the standard result types get defined.
>  (*Chris*)
>
>
> On Mon, Sep 22, 2008 at 9:25 AM, gianluca.musella@gmail.com <
> gianluca.musella@gmail.com> wrote:
>
>>
>> Ho all.
>>
>> I'm il train!
>>
>> It is possible in struts.xml to have global result of type redirect?
>>
>> My struts.xml doesn't give validation errors, but results or type redirect
>> aren't visible ho the controller.
>>
>> Please help
>>
>> Gianluca
>>
>>
>>
>> Inviato da iPhone
>>
>> ---------------------------------------------------------------------
>> 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


Re: Global result of type redirect

Posted by Chris Pratt <th...@gmail.com>.
Are you saying you want to set the default result type to "redirect"
globally or that you just want a global result type of "redirect" to be
available to your actions?

If the former, just redefine the "redirect" result type in your package and
set it to default="true", like:

          <result-types>
            <result-type name="redirect"
class="org.apache.struts2.dispatcher.ServletRedirectResult" default="true"/>
          </result-types>

If the latter, make sure your package extends "struts-default"  that's where
all the standard result types get defined.
  (*Chris*)


On Mon, Sep 22, 2008 at 9:25 AM, gianluca.musella@gmail.com <
gianluca.musella@gmail.com> wrote:

>
> Ho all.
>
> I'm il train!
>
> It is possible in struts.xml to have global result of type redirect?
>
> My struts.xml doesn't give validation errors, but results or type redirect
> aren't visible ho the controller.
>
> Please help
>
> Gianluca
>
>
>
> Inviato da iPhone
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>