You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Ted Husted (JIRA)" <ji...@apache.org> on 2006/06/13 00:13:16 UTC

[jira] Created: (WW-1347) SAF1 Features to Implement

SAF1 Features to Implement
--------------------------

         Key: WW-1347
         URL: http://issues.apache.org/struts/browse/WW-1347
     Project: Struts Action 2
        Type: Task

    Reporter: Ted Husted
     Fix For: 2.0.0


 
 * Wildcard Action Mappings - Complete
 *  DynaForm as Model Object
 *  Extends for action mappings


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/struts/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (WW-1347) SAF1 Features to Implement

Posted by "Ted Husted (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/struts/browse/WW-1347?page=comments#action_37857 ] 
            
Ted Husted commented on WW-1347:
--------------------------------

Here's another real-life example of using extends 

Before 

<action name="listInvoice" class="com.eplus.app.invoice.action.InvoiceCrudAction" method="list">
               <interceptor-ref name="listStack"/>
                 <result name="CRUD-list" type="freemarker">/template/eplus/metaDataList.ftl</result>
       </action>

       <action name="editInvoice" class="com.eplus.app.invoice.action.InvoiceCrudAction">
               <interceptor-ref name="editStack"/>
       </action>
      
  <action name="saveInvoice" class="com.eplus.app.invoice.action.InvoiceCrudAction" method="save">
               <interceptor-ref name="crudStack"/>
       </action>
       <action name="deleteInvoice" class="com.eplus.app.invoice.action.InvoiceCrudAction" method="delete">
               <interceptor-ref name="crudStack"/>
       </action>

 After

      <action name="*Invoice" class="com.eplus.app.invoice.action.InvoiceCrudAction">
               <interceptor-ref name="editStack"/>
       </action>

     <action name="listInvoice" exends="*Invoice"  method="list">
               <interceptor-ref name="listStack"/>
                 <result name="CRUD-list" type="freemarker">/template/eplus/metaDataList.ftl</result>
       </action>

Along the same lines, another useful XML feature is class aliases.

<class-ref name="InvoiceCrudAction" class="com.eplus.app.invoice.action.InvoiceCrudAction"/>

     <action name="listInvoice" class="InvoiceCrudAction" method="list">
               <interceptor-ref name="listStack"/>
                 <result name="CRUD-list" type="freemarker">/template/eplus/metaDataList.ftl</result>
       </action>

       <action name="editInvoice" class="InvoiceCrudAction">
               <interceptor-ref name="editStack"/>
       </action>
      
     <action name="saveInvoice" class="InvoiceCrudAction" method="save">
               <interceptor-ref name="crudStack"/>
       </action>

       <action name="deleteInvoice" class="InvoiceCrudAction" method="delete">
               <interceptor-ref name="crudStack"/>
       </action>


> SAF1 Features to Implement
> --------------------------
>
>                 Key: WW-1347
>                 URL: http://issues.apache.org/struts/browse/WW-1347
>             Project: Struts 2
>          Issue Type: Task
>          Components: Documentation
>            Reporter: Ted Husted
>         Assigned To: Don Brown
>             Fix For: 2.0.0
>
>
>  
>  * Wildcard Action Mappings - Complete
>  *  DynaForm as Model Object
>  *  Extends for action mappings

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/struts/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (WW-1347) SAF1 Features to Implement

Posted by "Don Brown (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/struts/browse/WW-1347?page=comments#action_37597 ] 

Don Brown commented on WW-1347:
-------------------------------

With wildcards complete, I'm looking at the next two.  First, you can use a dynaform as the model object today if you use its map view, getMap() I believe.  Were you thinking of something more complicated?

As for action mapping extends, I'm not sure that would be useful for xwork action mappings, since xwork has a package structure that allows you to set default result types, interceptor stacks, and exception handling for a package.  In what way do you see adding an "extends" attribute helping an application that can't be done with packages?

> SAF1 Features to Implement
> --------------------------
>
>          Key: WW-1347
>          URL: http://issues.apache.org/struts/browse/WW-1347
>      Project: Struts Action 2
>         Type: Task

>     Reporter: Ted Husted
>      Fix For: 2.0.0

>
>  
>  * Wildcard Action Mappings - Complete
>  *  DynaForm as Model Object
>  *  Extends for action mappings

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/struts/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (WW-1347) SAF1 Features to Implement

Posted by "Don Brown (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/struts/browse/WW-1347?page=comments#action_37854 ] 
            
Don Brown commented on WW-1347:
-------------------------------

Actually, the execute method should work just fine with the original mapping with the url "Logon".  Therefore, the mapping:
  <action name="Logon!*" class="mailreader2.Logon" method="{1}">

matches and calls:

Logon -> Logon.execute()
Logon!delete -> Logon.delete()

and so on.  This works because the wildcard pattern handling inserts a second pattern, one that removes the previous character for this very usecase.  When the wildcard matches nothing, a blank string is put into the method attribute.  If  a blank string is present, the ActionInvocation assumes "execute".

> SAF1 Features to Implement
> --------------------------
>
>                 Key: WW-1347
>                 URL: http://issues.apache.org/struts/browse/WW-1347
>             Project: Struts 2
>          Issue Type: Task
>          Components: Documentation
>            Reporter: Ted Husted
>         Assigned To: Don Brown
>             Fix For: 2.0.0
>
>
>  
>  * Wildcard Action Mappings - Complete
>  *  DynaForm as Model Object
>  *  Extends for action mappings

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/struts/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (WW-1347) SAF1 Features to Implement

Posted by "Ted Husted (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/struts/browse/WW-1347?page=comments#action_37678 ] 

Ted Husted commented on WW-1347:
--------------------------------

Hmmm, with s2 defaults, I can set one per package. With extends, I can have as many base mappings as I like, just like we can have as many sets of interceptors as we like. I'm not saying that this much flexibility is necessary or desirable, but we shouldn't consider package defaults a panacea. 

I still don't think we've addressed the issue of using DynaBeans in S2 head-on. If there are technical issues that cause us to recommend against it, then we should say that. We should also actually try it before dismissing the notion. In practice, a lot of domain object graphs are not appropriate for use as "backing beans". Slapping the properties on the Action can be useful, but it can also be a lot of  busywork. Again, we shouldn't consider action-properties and POJO support a panacea. We still have far to go in terms of making web applications truly easy to create and to maintain. 

-Ted.


> SAF1 Features to Implement
> --------------------------
>
>          Key: WW-1347
>          URL: http://issues.apache.org/struts/browse/WW-1347
>      Project: Struts 2
>         Type: Task

>   Components: Documentation
>     Reporter: Ted Husted
>     Assignee: Don Brown
>      Fix For: 2.0.0

>
>  
>  * Wildcard Action Mappings - Complete
>  *  DynaForm as Model Object
>  *  Extends for action mappings

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/struts/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (WW-1347) SAF1 Features to Implement

Posted by "Ted Husted (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/struts/browse/WW-1347?page=comments#action_37855 ] 
            
Ted Husted commented on WW-1347:
--------------------------------

The strategy didn't seem to work in the case of  "post-back" form. We had a form like 

<s:form validate="false">

that used to post back to the Register method. 

But, with wildcards, it didn't postback until we added 

<s:form action="Registration!execute" validate="false">

to the tag.

-Ted.


> SAF1 Features to Implement
> --------------------------
>
>                 Key: WW-1347
>                 URL: http://issues.apache.org/struts/browse/WW-1347
>             Project: Struts 2
>          Issue Type: Task
>          Components: Documentation
>            Reporter: Ted Husted
>         Assigned To: Don Brown
>             Fix For: 2.0.0
>
>
>  
>  * Wildcard Action Mappings - Complete
>  *  DynaForm as Model Object
>  *  Extends for action mappings

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/struts/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (WW-1347) SAF1 Features to Implement

Posted by "Ted Husted (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/struts/browse/WW-1347?page=comments#action_37853 ] 
            
Ted Husted commented on WW-1347:
--------------------------------

> In what way do you see adding an "extends" attribute helping an application that can't be done with packages?

Say, I'm trying to do away with the ! notation,and I have an action stanza like this: 

        <action name="Logon" class="mailreader2.Logon">
            <result name="input">/pages/Logon.jsp</result>
            <result name="cancel" type="redirect-action">Welcome</result>
            <result type="redirect-action">MainMenu</result>
            <result name="expired" type="chain">ChangePassword</result>
            <exception-mapping
                    exception="org.apache.struts.apps.mailreader.dao.ExpiredPasswordException"
                    result="expired"/>
            <interceptor-ref name="guest"/>
        </action>

With wildcards, I can change the first line to read: 

        <action name="Logon!*" class="mailreader2.Logon" method={1}>

and the old aliases will work just fine. Except for the default execute method. To invoke the execute method, we need to use a URI like "Logon!execute", or repeat the stanza. 

With extends we could keep the original element as is and just add 

        <action name="Logon!*" extends="Logon" method={1}  />

If we didn't like wildcards for some reason, with extends we could specify exactly with methods to expose.

        <action name="Logon!delete" extends="Logon" method="delete"  />

        <action name="Logon!copy" extends="Logon" method="copy"  />

We could also override some of the alias action mappigs, if needed.

        <action name="Logon!delete" extends="Logon" method="delete"  >
            <result name="cancel" type="redirect-action">Welcome</result>
        </action>

I think one reason people dislike declarative configurations is because we don't try hard enough to ensure that we can "say it once" in XML. 

-Ted.




> SAF1 Features to Implement
> --------------------------
>
>                 Key: WW-1347
>                 URL: http://issues.apache.org/struts/browse/WW-1347
>             Project: Struts 2
>          Issue Type: Task
>          Components: Documentation
>            Reporter: Ted Husted
>         Assigned To: Don Brown
>             Fix For: 2.0.0
>
>
>  
>  * Wildcard Action Mappings - Complete
>  *  DynaForm as Model Object
>  *  Extends for action mappings

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/struts/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Resolved: (WW-1347) SAF1 Features to Implement

Posted by "Don Brown (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/struts/browse/WW-1347?page=all ]
     
Don Brown resolved WW-1347:
---------------------------

    Resolution: Fixed
     Assign To: Don Brown

I modified the migration guide under Issues and Solutions.  

> SAF1 Features to Implement
> --------------------------
>
>          Key: WW-1347
>          URL: http://issues.apache.org/struts/browse/WW-1347
>      Project: Struts 2
>         Type: Task

>   Components: Documentation
>     Reporter: Ted Husted
>     Assignee: Don Brown
>      Fix For: 2.0.0

>
>  
>  * Wildcard Action Mappings - Complete
>  *  DynaForm as Model Object
>  *  Extends for action mappings

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/struts/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (WW-1347) SAF1 Features to Implement

Posted by "Ted Husted (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/struts/browse/WW-1347?page=all ]

Ted Husted updated WW-1347:
---------------------------

    Component: Documentation

These are probably documentation issues, so I'm changing the component setting.

I was thinking in terms of using a DynaBean as a S2 POJO, perhaps using Spring to create the DynaBean instead.  The use case being, we're comfortable with Dyna's and want to use them in our next S2 application. 

As to extends, in the migration guide, we may just need to document how value for a defaults can be set, and relate the concepts.  I've noticed that some developers are not aware of how much you can do with defaults. 


> SAF1 Features to Implement
> --------------------------
>
>          Key: WW-1347
>          URL: http://issues.apache.org/struts/browse/WW-1347
>      Project: Struts 2
>         Type: Task

>   Components: Documentation
>     Reporter: Ted Husted
>      Fix For: 2.0.0

>
>  
>  * Wildcard Action Mappings - Complete
>  *  DynaForm as Model Object
>  *  Extends for action mappings

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/struts/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (WW-1347) SAF1 Features to Implement

Posted by "Niall Pemberton (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/struts/browse/WW-1347?page=comments#action_37651 ] 

Niall Pemberton commented on WW-1347:
-------------------------------------

Although DynaActionForm has the getMap() method (and LazyDynaBean) - not all implementations do, including BasicDynaBean. The problem as well with the way get Map() has been implemented (in both DynaActionForm and LazyDynaBean) is to expose the DynaBean's internal Map circumventing the DynaBean's "type safety". While this isn't an issue for reading properties, it will be if S2 uses the Map to populate using OGNL. The solution to this is for the getMap() method to return a Map which decorates the DynaBean, calling the DynaBean's get/set methods - I attached such an implementation to the following issue recently:

   http://issues.apache.org/jira/browse/BEANUTILS-185

The problem is BeanUtils is in serious need of some TLC (85 open issues) and looks like its heading to a "dormant" status (if it isn't already). IMO it has also got too large and probably should be split into several smaller components - including splitting out DynaBeans. I almost proposed splitting out DynaBeans recently, but that would invlove at least one BeanUtils release and I'm not sure I have the appetite for it.

The other attempt to resolve the issue that other technologies outside of BeanUtils don't recognise DynaBeans was Laurie's change to use cglig to create to create a dynamic proxy for DynaBeans (STR-2596) that got backed out (STR-2671). The motivation for this (and for BEANUTILS-185) was that having to specify "fooForm.map.barProperty" seemed unnatural rather than "fooForm.barProperty". Part of me thinks that DynaBeans have had their day, since they were invented before all the EL technologies arrived on the scene. I think with hindsight it would have bean better to stick with a Map (?MapBean?) and used a "MapClass" to control property types.



> SAF1 Features to Implement
> --------------------------
>
>          Key: WW-1347
>          URL: http://issues.apache.org/struts/browse/WW-1347
>      Project: Struts 2
>         Type: Task

>   Components: Documentation
>     Reporter: Ted Husted
>      Fix For: 2.0.0

>
>  
>  * Wildcard Action Mappings - Complete
>  *  DynaForm as Model Object
>  *  Extends for action mappings

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/struts/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (WW-1347) SAF1 Features to Implement

Posted by "Don Brown (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/struts/browse/WW-1347?page=comments#action_37856 ] 
            
Don Brown commented on WW-1347:
-------------------------------

Try:

<s:form action="Registration" validate="false">

In the meantime, I'll look into the action name resolution mechanism further.

> SAF1 Features to Implement
> --------------------------
>
>                 Key: WW-1347
>                 URL: http://issues.apache.org/struts/browse/WW-1347
>             Project: Struts 2
>          Issue Type: Task
>          Components: Documentation
>            Reporter: Ted Husted
>         Assigned To: Don Brown
>             Fix For: 2.0.0
>
>
>  
>  * Wildcard Action Mappings - Complete
>  *  DynaForm as Model Object
>  *  Extends for action mappings

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/struts/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira