You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Sgarlata Matt <sg...@bah.com> on 2003/09/28 23:30:19 UTC

[Chain] CommandAction

To do testing for the ChainServlet I was using Struts and set up my own
CommandAction which I think is rather nice.  As you might have guessed, you
use it like this:

  <action
   path="/chainTest"
   type="com.bah.krm.actions.CommandAction"
   parameter="SaveAsset">
   <forward
    name="success"
    path="/test.jsp"/>
  </action>

where SaveAsset is the name of a command stored in the catalog initialized
by the ChainServlet.  If the command executes successfully, the user is sent
to the success forward.  Otherwise, Struts' error-handling mechanisms take
over.  Do you think this Action could find a home somewhere?

I am attaching the Action in case you want to take a look.  It will not
compile outside my application framework.  If you like it, I will clean it
up, remove dependencies on my application framework, add documentation, and
change the coding conventions.

Matt


Re: [Chain] CommandAction

Posted by Ted Husted <hu...@apache.org>.
I believe the Commons Lang implementation is equivalent:

http://jakarta.apache.org/commons/lang/api/org/apache/commons/lang/exception/NestableException.html

Sgarlata Matt wrote:
> OK, I will clean this class up and add to BugZilla sometime this week.
> 
> One question though is that I think it's important this class catch
> exceptions and rethrow them as something that makes more sense (and also
> throw new exceptions if configuration issues are detected).  I defined a
> CommandException for this purpose, which is based on a class very similar to
> the ChainedException in Scaffold.  Is this OK?  Should I just copy most of
> ChainedException into CommandException?  I know we don't want struts-chain
> dependent on scaffold.
> 
> Matt
> ----- Original Message ----- 
> From: "Ted Husted" <hu...@apache.org>
> To: "Jakarta Commons Developers List" <co...@jakarta.apache.org>
> Sent: Monday, September 29, 2003 11:51 AM
> Subject: Re: [Chain] CommandAction
> 
> 
> 
>>You should create a bugzilla ticket under Struts for an enhancement to
>>the "Standard Actions" component and post this here.
>>
>>I plan to adopt the ProcessAction in Scaffold to do this too, but that's
>>a more complex usage, so I think there would be room for a simple case
> 
> too.
> 
>>-Ted.
>>
>>Sgarlata Matt wrote:
>>
>>
>>>To do testing for the ChainServlet I was using Struts and set up my own
>>>CommandAction which I think is rather nice.  As you might have guessed,
> 
> you
> 
>>>use it like this:
>>>
>>>  <action
>>>   path="/chainTest"
>>>   type="com.bah.krm.actions.CommandAction"
>>>   parameter="SaveAsset">
>>>   <forward
>>>    name="success"
>>>    path="/test.jsp"/>
>>>  </action>
>>>
>>>where SaveAsset is the name of a command stored in the catalog
> 
> initialized
> 
>>>by the ChainServlet.  If the command executes successfully, the user is
> 
> sent
> 
>>>to the success forward.  Otherwise, Struts' error-handling mechanisms
> 
> take
> 
>>>over.  Do you think this Action could find a home somewhere?
>>>
>>>I am attaching the Action in case you want to take a look.  It will not
>>>compile outside my application framework.  If you like it, I will clean
> 
> it
> 
>>>up, remove dependencies on my application framework, add documentation,
> 
> and
> 
>>>change the coding conventions.
>>>
>>>Matt
>>>
>>>
>>>
>>>------------------------------------------------------------------------
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
>>>For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>>
>>-- 
>>Ted Husted,
>>   Junit in Action  - <http://www.manning.com/massol/>,
>>   Struts in Action - <http://husted.com/struts/book.html>,
>>   JSP Site Design  - <http://www.amazon.com/exec/obidos/ISBN=1861005512>.
>>
>>"Get Ready, We're Moving Out!!" - <http://www.clark04.com>
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>>
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> 
> 

-- 
Ted Husted,
   Junit in Action  - <http://www.manning.com/massol/>,
   Struts in Action - <http://husted.com/struts/book.html>,
   JSP Site Design  - <http://www.amazon.com/exec/obidos/ISBN=1861005512>.

"Get Ready, We're Moving Out!!" - <http://www.clark04.com>



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: [Chain] CommandAction

Posted by Ted Husted <hu...@apache.org>.
I believe the Commons Lang implementation is equivalent:

http://jakarta.apache.org/commons/lang/api/org/apache/commons/lang/exception/NestableException.html

Sgarlata Matt wrote:
> OK, I will clean this class up and add to BugZilla sometime this week.
> 
> One question though is that I think it's important this class catch
> exceptions and rethrow them as something that makes more sense (and also
> throw new exceptions if configuration issues are detected).  I defined a
> CommandException for this purpose, which is based on a class very similar to
> the ChainedException in Scaffold.  Is this OK?  Should I just copy most of
> ChainedException into CommandException?  I know we don't want struts-chain
> dependent on scaffold.
> 
> Matt
> ----- Original Message ----- 
> From: "Ted Husted" <hu...@apache.org>
> To: "Jakarta Commons Developers List" <co...@jakarta.apache.org>
> Sent: Monday, September 29, 2003 11:51 AM
> Subject: Re: [Chain] CommandAction
> 
> 
> 
>>You should create a bugzilla ticket under Struts for an enhancement to
>>the "Standard Actions" component and post this here.
>>
>>I plan to adopt the ProcessAction in Scaffold to do this too, but that's
>>a more complex usage, so I think there would be room for a simple case
> 
> too.
> 
>>-Ted.
>>
>>Sgarlata Matt wrote:
>>
>>
>>>To do testing for the ChainServlet I was using Struts and set up my own
>>>CommandAction which I think is rather nice.  As you might have guessed,
> 
> you
> 
>>>use it like this:
>>>
>>>  <action
>>>   path="/chainTest"
>>>   type="com.bah.krm.actions.CommandAction"
>>>   parameter="SaveAsset">
>>>   <forward
>>>    name="success"
>>>    path="/test.jsp"/>
>>>  </action>
>>>
>>>where SaveAsset is the name of a command stored in the catalog
> 
> initialized
> 
>>>by the ChainServlet.  If the command executes successfully, the user is
> 
> sent
> 
>>>to the success forward.  Otherwise, Struts' error-handling mechanisms
> 
> take
> 
>>>over.  Do you think this Action could find a home somewhere?
>>>
>>>I am attaching the Action in case you want to take a look.  It will not
>>>compile outside my application framework.  If you like it, I will clean
> 
> it
> 
>>>up, remove dependencies on my application framework, add documentation,
> 
> and
> 
>>>change the coding conventions.
>>>
>>>Matt
>>>
>>>
>>>
>>>------------------------------------------------------------------------
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
>>>For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>>
>>-- 
>>Ted Husted,
>>   Junit in Action  - <http://www.manning.com/massol/>,
>>   Struts in Action - <http://husted.com/struts/book.html>,
>>   JSP Site Design  - <http://www.amazon.com/exec/obidos/ISBN=1861005512>.
>>
>>"Get Ready, We're Moving Out!!" - <http://www.clark04.com>
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>>
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> 
> 

-- 
Ted Husted,
   Junit in Action  - <http://www.manning.com/massol/>,
   Struts in Action - <http://husted.com/struts/book.html>,
   JSP Site Design  - <http://www.amazon.com/exec/obidos/ISBN=1861005512>.

"Get Ready, We're Moving Out!!" - <http://www.clark04.com>



Re: [Chain] CommandAction

Posted by Sgarlata Matt <sg...@bah.com>.
OK, I will clean this class up and add to BugZilla sometime this week.

One question though is that I think it's important this class catch
exceptions and rethrow them as something that makes more sense (and also
throw new exceptions if configuration issues are detected).  I defined a
CommandException for this purpose, which is based on a class very similar to
the ChainedException in Scaffold.  Is this OK?  Should I just copy most of
ChainedException into CommandException?  I know we don't want struts-chain
dependent on scaffold.

Matt
----- Original Message ----- 
From: "Ted Husted" <hu...@apache.org>
To: "Jakarta Commons Developers List" <co...@jakarta.apache.org>
Sent: Monday, September 29, 2003 11:51 AM
Subject: Re: [Chain] CommandAction


> You should create a bugzilla ticket under Struts for an enhancement to
> the "Standard Actions" component and post this here.
>
> I plan to adopt the ProcessAction in Scaffold to do this too, but that's
> a more complex usage, so I think there would be room for a simple case
too.
>
> -Ted.
>
> Sgarlata Matt wrote:
>
> > To do testing for the ChainServlet I was using Struts and set up my own
> > CommandAction which I think is rather nice.  As you might have guessed,
you
> > use it like this:
> >
> >   <action
> >    path="/chainTest"
> >    type="com.bah.krm.actions.CommandAction"
> >    parameter="SaveAsset">
> >    <forward
> >     name="success"
> >     path="/test.jsp"/>
> >   </action>
> >
> > where SaveAsset is the name of a command stored in the catalog
initialized
> > by the ChainServlet.  If the command executes successfully, the user is
sent
> > to the success forward.  Otherwise, Struts' error-handling mechanisms
take
> > over.  Do you think this Action could find a home somewhere?
> >
> > I am attaching the Action in case you want to take a look.  It will not
> > compile outside my application framework.  If you like it, I will clean
it
> > up, remove dependencies on my application framework, add documentation,
and
> > change the coding conventions.
> >
> > Matt
> >
> >
> >
> > ------------------------------------------------------------------------
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>
> -- 
> Ted Husted,
>    Junit in Action  - <http://www.manning.com/massol/>,
>    Struts in Action - <http://husted.com/struts/book.html>,
>    JSP Site Design  - <http://www.amazon.com/exec/obidos/ISBN=1861005512>.
>
> "Get Ready, We're Moving Out!!" - <http://www.clark04.com>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: [Chain] CommandAction

Posted by Sgarlata Matt <sg...@bah.com>.
OK, I will clean this class up and add to BugZilla sometime this week.

One question though is that I think it's important this class catch
exceptions and rethrow them as something that makes more sense (and also
throw new exceptions if configuration issues are detected).  I defined a
CommandException for this purpose, which is based on a class very similar to
the ChainedException in Scaffold.  Is this OK?  Should I just copy most of
ChainedException into CommandException?  I know we don't want struts-chain
dependent on scaffold.

Matt
----- Original Message ----- 
From: "Ted Husted" <hu...@apache.org>
To: "Jakarta Commons Developers List" <co...@jakarta.apache.org>
Sent: Monday, September 29, 2003 11:51 AM
Subject: Re: [Chain] CommandAction


> You should create a bugzilla ticket under Struts for an enhancement to
> the "Standard Actions" component and post this here.
>
> I plan to adopt the ProcessAction in Scaffold to do this too, but that's
> a more complex usage, so I think there would be room for a simple case
too.
>
> -Ted.
>
> Sgarlata Matt wrote:
>
> > To do testing for the ChainServlet I was using Struts and set up my own
> > CommandAction which I think is rather nice.  As you might have guessed,
you
> > use it like this:
> >
> >   <action
> >    path="/chainTest"
> >    type="com.bah.krm.actions.CommandAction"
> >    parameter="SaveAsset">
> >    <forward
> >     name="success"
> >     path="/test.jsp"/>
> >   </action>
> >
> > where SaveAsset is the name of a command stored in the catalog
initialized
> > by the ChainServlet.  If the command executes successfully, the user is
sent
> > to the success forward.  Otherwise, Struts' error-handling mechanisms
take
> > over.  Do you think this Action could find a home somewhere?
> >
> > I am attaching the Action in case you want to take a look.  It will not
> > compile outside my application framework.  If you like it, I will clean
it
> > up, remove dependencies on my application framework, add documentation,
and
> > change the coding conventions.
> >
> > Matt
> >
> >
> >
> > ------------------------------------------------------------------------
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>
> -- 
> Ted Husted,
>    Junit in Action  - <http://www.manning.com/massol/>,
>    Struts in Action - <http://husted.com/struts/book.html>,
>    JSP Site Design  - <http://www.amazon.com/exec/obidos/ISBN=1861005512>.
>
> "Get Ready, We're Moving Out!!" - <http://www.clark04.com>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>


Re: [Chain] CommandAction

Posted by Ted Husted <hu...@apache.org>.
You should create a bugzilla ticket under Struts for an enhancement to 
the "Standard Actions" component and post this here.

I plan to adopt the ProcessAction in Scaffold to do this too, but that's 
a more complex usage, so I think there would be room for a simple case too.

-Ted.

Sgarlata Matt wrote:

> To do testing for the ChainServlet I was using Struts and set up my own
> CommandAction which I think is rather nice.  As you might have guessed, you
> use it like this:
> 
>   <action
>    path="/chainTest"
>    type="com.bah.krm.actions.CommandAction"
>    parameter="SaveAsset">
>    <forward
>     name="success"
>     path="/test.jsp"/>
>   </action>
> 
> where SaveAsset is the name of a command stored in the catalog initialized
> by the ChainServlet.  If the command executes successfully, the user is sent
> to the success forward.  Otherwise, Struts' error-handling mechanisms take
> over.  Do you think this Action could find a home somewhere?
> 
> I am attaching the Action in case you want to take a look.  It will not
> compile outside my application framework.  If you like it, I will clean it
> up, remove dependencies on my application framework, add documentation, and
> change the coding conventions.
> 
> Matt
> 
> 
> 
> ------------------------------------------------------------------------
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org

-- 
Ted Husted,
   Junit in Action  - <http://www.manning.com/massol/>,
   Struts in Action - <http://husted.com/struts/book.html>,
   JSP Site Design  - <http://www.amazon.com/exec/obidos/ISBN=1861005512>.

"Get Ready, We're Moving Out!!" - <http://www.clark04.com>



Re: [Chain] CommandAction

Posted by Sgarlata Matt <sg...@bah.com>.
Looks like .zip is needed to attach things...
----- Original Message ----- 
From: "Sgarlata Matt" <sg...@bah.com>
To: "Jakarta Commons Developers List" <co...@jakarta.apache.org>
Sent: Sunday, September 28, 2003 5:30 PM
Subject: [Chain] CommandAction


> To do testing for the ChainServlet I was using Struts and set up my own
> CommandAction which I think is rather nice.  As you might have guessed,
you
> use it like this:
>
>   <action
>    path="/chainTest"
>    type="com.bah.krm.actions.CommandAction"
>    parameter="SaveAsset">
>    <forward
>     name="success"
>     path="/test.jsp"/>
>   </action>
>
> where SaveAsset is the name of a command stored in the catalog initialized
> by the ChainServlet.  If the command executes successfully, the user is
sent
> to the success forward.  Otherwise, Struts' error-handling mechanisms take
> over.  Do you think this Action could find a home somewhere?
>
> I am attaching the Action in case you want to take a look.  It will not
> compile outside my application framework.  If you like it, I will clean it
> up, remove dependencies on my application framework, add documentation,
and
> change the coding conventions.
>
> Matt
>
>


----------------------------------------------------------------------------
----


> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org

Re: [Chain] CommandAction

Posted by Ted Husted <hu...@apache.org>.
You should create a bugzilla ticket under Struts for an enhancement to 
the "Standard Actions" component and post this here.

I plan to adopt the ProcessAction in Scaffold to do this too, but that's 
a more complex usage, so I think there would be room for a simple case too.

-Ted.

Sgarlata Matt wrote:

> To do testing for the ChainServlet I was using Struts and set up my own
> CommandAction which I think is rather nice.  As you might have guessed, you
> use it like this:
> 
>   <action
>    path="/chainTest"
>    type="com.bah.krm.actions.CommandAction"
>    parameter="SaveAsset">
>    <forward
>     name="success"
>     path="/test.jsp"/>
>   </action>
> 
> where SaveAsset is the name of a command stored in the catalog initialized
> by the ChainServlet.  If the command executes successfully, the user is sent
> to the success forward.  Otherwise, Struts' error-handling mechanisms take
> over.  Do you think this Action could find a home somewhere?
> 
> I am attaching the Action in case you want to take a look.  It will not
> compile outside my application framework.  If you like it, I will clean it
> up, remove dependencies on my application framework, add documentation, and
> change the coding conventions.
> 
> Matt
> 
> 
> 
> ------------------------------------------------------------------------
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org

-- 
Ted Husted,
   Junit in Action  - <http://www.manning.com/massol/>,
   Struts in Action - <http://husted.com/struts/book.html>,
   JSP Site Design  - <http://www.amazon.com/exec/obidos/ISBN=1861005512>.

"Get Ready, We're Moving Out!!" - <http://www.clark04.com>



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org