struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Re: Architectural question
Date Wed, 29 Jun 2005 13:27:20 GMT

I would name the actual action based on the functionallity:

<action path="/postRequest1" type="org.moon.PostWebServiceAction"
      <forward name="default" path="test1.jsp"/>

<action path="/postRequest2" type="org.moon.PostWebServiceAction"
      <forward name="default" path="test2.jsp"/>

This would indicate that you are running two seperate web pages that both
attempt to post data to a web service.  The process for posting these
requests are identical an therefor redundant to create two independent
action classes to handle the business flow.  however, based on the action
path you are calling you can control the validation and forward
differently.  The key is that the code within the PostWebServiceAction does
not contain any business logic, only deligating calls to other model

             Mario Neè                                                     
             org>                                                       To 
                                       Struts Users Mailing List           
             06/29/2005 09:04          <>            
             AM                                                         cc 
             Please respond to         Re: Architectural question          
               "Struts Users                                               
               Mailing List"                                               

following your example:

<action path="/PostWebServiceAction" type="org.xmoon.GenericStrutsAction">
       <forward name="default" path="..."/>

<?xml version="1.0" encoding="ISO-8859-1"?>
         <code language="beanshell">
             // business logic
</service> wrote:

> So long as the Action class is performing a truly generic function
> then I see no problem with this. Additionally, the name of the Action
> should reflect the function that is being performed. For example, if
> the action is forwarding a bean embedded in the form to a web service,
> the Action should be named something like PostWebServiceAction.
> However, if the action has logic built into it to determine which jsp
> is feeding the action and how to Interpret the data, this should be
> broken out.

> Hello,
> Does anybody knows if there is some problem in using single Action class
> to serve more Service ?
> XMoon load service automatically from xml but the Action class is the
> same.
> ex:
> <action path="/console" type="org.xmoon.GenericStrutsAction">
>        <forward name="default" path="/pages/console.jsp"/>
> </action>
> <action path="/test" type="org.xmoon.GenericStrutsAction">
>        <forward name="default" path="/pages/test.jsp"/>
> </action>
> --
> Mario Nee'
> Brescia Italy
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

Mario Nee'
Brescia Italy

To unsubscribe, e-mail:
For additional commands, e-mail:

  • Unnamed multipart/related (inline, None, 0 bytes)
View raw message