Re: Best Practice with WW2.2.1 Crud / Validation / State Methods
Peter Pilgrim <[email protected]>
| Newsgroups | gmane.comp.java.open-symphony.webwork |
|---|---|
| Message-ID | <596869.1145353361498.JavaMail.os-j2ee@opensymphony01.managed.contegix.com> |
Philip
I created my own validation workflow stack and added the interceptor parameter there.
[pre]
<interceptors>
<!-- Copy of sample validation and workflow stack -->
<interceptor-stack name="[b]myValidationWorkflowStack[/b]">
<interceptor-ref name="basicStack"/>
<interceptor-ref name="validation" >
<param name="excludeMethods">
input,back,cancel,browse,default
</param>
</interceptor-ref>
<interceptor-ref name="workflow"/>
</interceptor-stack>
</interceptors>
[/pre]
[pre]
<action name="createUserMember"
class="com.javawug.networking.ui.webwork.EditUserMemberAction"
method="createUserMember" >
<interceptor-ref name="[b]myValidationWorkflowStack[/b]" />
<result name="input">member-create.jsp</result>
<result name="success">members-view.jsp</result>
</action>
[/pre]
This example ``Aliasing with configuration'' then worked as expected.
The irony is I still had to add configuration for the interceptor, but that's cool though!
The doDefault() method is called in EditUserMemberAction when the URI is "createUserMember!default.action"
My question is with the CRUD example in the book Chapter 15 page 417?
[pre]
public void prepare() throws Exception {
if ( categoryId != null ) {
category = categoryDAO.getCategoryId( categoryId, false );
}
}
[/pre]
Presumably this prepare() is called by the PreparedInterceptor. By testing that
categoryId is not null or null, are you differentiate between an Update and
Create operation? If the categoryId is not null then I think it means you have
a category to edit, and if it is null then it is create category call. This is not
clearly explained.
Peter
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.opensymphony.com/thread.jspa?threadID=24936&messageID=51814#51814
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]