You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Joseph McGranaghan <dr...@draegoonz.com> on 2006/12/19 15:28:48 UTC
Chains - 1.3.5
This should be simple, but for the life of me I can't get find the answer.
All I want to do is have a chain execute and then go to an action <forward>
Right now it goes through the chain and outputs a blank web page with no
source code at all.
struts-config:
<action path="/preprocess_myaction" scope="request" catalog="mycatalog"
command="mychain">
<forward name="myaction" path="/myaction.do" />
</action>
<action path="/myaction" forward="tile.myaction" />
chain-config:
<?xml version="1.0" ?>
<catalog name="mycatalog">
<chain name="mychain">
<command id="GetSomethingAndPutInRequest"
className="com.draegoonZ.GetSomethingAndPutInRequest" />
</chain>
</catalog>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Chains - 1.3.5
Posted by Joseph McGranaghan <dr...@draegoonz.com>.
Yes, that works perfectly!
A whole lot cleaner too.
Now people will find this in the archives.
Thanks,
Joe
Niall Pemberton wrote:
> On 12/19/06, Joseph McGranaghan <dr...@draegoonz.com> wrote:
>>
>> Solved my problem:
>>
>> ActionContext ac = (ActionContext)context;
>> ac.setForwardConfig(new ActionForward("/myaction.do"));
>>
>> If anyone has a cleaner, non-hardcoded my, I'm all ears!
>
> Can you not just do this as one action mapping and specify the forward
> on the action?
>
> <action path="/myaction" scope="request"
> catalog="mycatalog" command="mychain" forward="tile.myaction">
> </action>
>
> Niall
>
>> Thanks,
>>
>> Joe
>>
>> Joseph McGranaghan wrote:
>> >
>> > This should be simple, but for the life of me I can't get find the
>> > answer.
>> >
>> > All I want to do is have a chain execute and then go to an action
>> > <forward>
>> >
>> > Right now it goes through the chain and outputs a blank web page with
>> > no source code at all.
>> >
>> >
>> >
>> > struts-config:
>> >
>> > <action path="/preprocess_myaction" scope="request"
>> > catalog="mycatalog" command="mychain">
>> >
>> > <forward name="myaction" path="/myaction.do" />
>> >
>> > </action>
>> >
>> > <action path="/myaction" forward="tile.myaction" />
>> >
>> >
>> >
>> > chain-config:
>> >
>> > <?xml version="1.0" ?>
>> >
>> > <catalog name="mycatalog">
>> > <chain name="mychain">
>> > <command id="GetSomethingAndPutInRequest"
>> > className="com.draegoonZ.GetSomethingAndPutInRequest" />
>> >
>> > </chain>
>> >
>> > </catalog>
>
> ---------------------------------------------------------------------
> 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: Chains - 1.3.5
Posted by Niall Pemberton <ni...@gmail.com>.
On 12/19/06, Joseph McGranaghan <dr...@draegoonz.com> wrote:
>
> Solved my problem:
>
> ActionContext ac = (ActionContext)context;
> ac.setForwardConfig(new ActionForward("/myaction.do"));
>
> If anyone has a cleaner, non-hardcoded my, I'm all ears!
Can you not just do this as one action mapping and specify the forward
on the action?
<action path="/myaction" scope="request"
catalog="mycatalog" command="mychain" forward="tile.myaction">
</action>
Niall
> Thanks,
>
> Joe
>
> Joseph McGranaghan wrote:
> >
> > This should be simple, but for the life of me I can't get find the
> > answer.
> >
> > All I want to do is have a chain execute and then go to an action
> > <forward>
> >
> > Right now it goes through the chain and outputs a blank web page with
> > no source code at all.
> >
> >
> >
> > struts-config:
> >
> > <action path="/preprocess_myaction" scope="request"
> > catalog="mycatalog" command="mychain">
> >
> > <forward name="myaction" path="/myaction.do" />
> >
> > </action>
> >
> > <action path="/myaction" forward="tile.myaction" />
> >
> >
> >
> > chain-config:
> >
> > <?xml version="1.0" ?>
> >
> > <catalog name="mycatalog">
> > <chain name="mychain">
> > <command id="GetSomethingAndPutInRequest"
> > className="com.draegoonZ.GetSomethingAndPutInRequest" />
> >
> > </chain>
> >
> > </catalog>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Chains - 1.3.5
Posted by Joseph McGranaghan <dr...@draegoonz.com>.
Solved my problem:
ActionContext ac = (ActionContext)context;
ac.setForwardConfig(new ActionForward("/myaction.do"));
If anyone has a cleaner, non-hardcoded my, I'm all ears!
Thanks,
Joe
Joseph McGranaghan wrote:
>
> This should be simple, but for the life of me I can't get find the
> answer.
>
> All I want to do is have a chain execute and then go to an action
> <forward>
>
> Right now it goes through the chain and outputs a blank web page with
> no source code at all.
>
>
>
> struts-config:
>
> <action path="/preprocess_myaction" scope="request"
> catalog="mycatalog" command="mychain">
>
> <forward name="myaction" path="/myaction.do" />
>
> </action>
>
> <action path="/myaction" forward="tile.myaction" />
>
>
>
> chain-config:
>
> <?xml version="1.0" ?>
>
> <catalog name="mycatalog">
> <chain name="mychain">
> <command id="GetSomethingAndPutInRequest"
> className="com.draegoonZ.GetSomethingAndPutInRequest" />
>
> </chain>
>
> </catalog>
>
> ---------------------------------------------------------------------
> 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