i use org.xmoon.GenericStrutsAction to serve every service, so the name that identify my service is in path attribute and not in type attribute. I create one xml instead of create one java class for every service.



[EMAIL PROTECTED] wrote:

I would name the actual action based on the functionallity:

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

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

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 functions.

Inactive hide details for Mario Neè <[EMAIL PROTECTED]>Mario Neè <[EMAIL PROTECTED]>


                        *Mario Neè <[EMAIL PROTECTED]>*

                        06/29/2005 09:04 AM
                        Please respond to
                        "Struts Users Mailing List"
                        <user@struts.apache.org>

        

To
        
Struts Users Mailing List <user@struts.apache.org>

cc
        

Subject
        
Re: Architectural question

        


following your example:

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


PostWebServiceAction.xml
<?xml version="1.0" encoding="ISO-8859-1"?>
<service>
   <task>
        <code language="beanshell">
            // business logic
           workbench.setForward("default");
        </code>
    </task>
</service>



[EMAIL PROTECTED] 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
> [EMAIL PROTECTED]
> http://www.xmoon.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


--
Mario Nee'
Brescia Italy
[EMAIL PROTECTED]
http://www.xmoon.org


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




--
Mario Nee'
Brescia Italy
[EMAIL PROTECTED]
http://www.xmoon.org


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

Reply via email to