You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by HariniKaushik <kh...@yahoo.com> on 2009/04/19 14:09:37 UTC

Query regarding optional method attribute in action tag - struts.xml

Hi All,
I feel this is the correct Forum where in my doubts 'll be cleared.
I've created Login,UserRegistration page and UserView page(where in admin
only can view the users)
And this is my action tag for Register_createUser and Register_getUserList
 <action name="Register_*" class="com.test.action.UserRegister"
method="{1}">
        <result name="success">common/{1}.jsp</result>
        <result name="input">common/usersList.jsp</result>
        <result name="error">result/{1}.jsp</result>
        </action>

The problem is that for Register_getUserList action I ve defined the
getUserList  method that returns the List.Since it returns the correct List
I want the "success" result name to be executed and go to the UserList page.
But what happens is that though the correct List is returned the "input"
result gets executed and it goes again to the validation page.
That validation I ve given for "Register_createUser" action which I do not
want to get executed for "getUserList Action." I dunno why it goes to input
rather than success page.
If any body is aware of this please let me know!
Appreciate any help!!!!

Thanks,
Harini

-- 
View this message in context: http://www.nabble.com/Query-regarding-optional-method-attribute-in-action-tag---struts.xml-tp23122390p23122390.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Query regarding optional method attribute in action tag - struts.xml

Posted by Dave Newton <ne...@yahoo.com>.
HariniKaushik wrote:
> Hi All,
> I feel this is the correct Forum where in my doubts 'll be cleared.
> I've created Login,UserRegistration page and UserView page(where in admin
> only can view the users)
> And this is my action tag for Register_createUser and Register_getUserList
>  <action name="Register_*" class="com.test.action.UserRegister"
> method="{1}">
>         <result name="success">common/{1}.jsp</result>
>         <result name="input">common/usersList.jsp</result>
>         <result name="error">result/{1}.jsp</result>
>         </action>
> 
> The problem is that for Register_getUserList action I ve defined the
> getUserList  method that returns the List.Since it returns the correct List
> I want the "success" result name to be executed and go to the UserList page.
> But what happens is that though the correct List is returned the "input"
> result gets executed and it goes again to the validation page.
> That validation I ve given for "Register_createUser" action which I do not
> want to get executed for "getUserList Action." I dunno why it goes to input
> rather than success page.

What does getUserList() return?

Do you have any validation, either XML- or annotation-based, configured 
that would fire for this action?

Dave


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Query regarding optional method attribute in action tag - struts.xml

Posted by Dave Newton <ne...@yahoo.com>.
HariniKaushik wrote:
> getUserList would just return the List(java.util.List)
> And its just the method that 'll get called when the action
> Register_getUserList action is triggered.
> I have combined two actions together through Register_* action names.
> And no validation is done for getUserList method.
> 
> Actually if i give the viewusers.jsp in "Input" result , it gets executed
> but it doesnt get executed if given in success.I guess its not returning
> success.
> I dont know what result i can give for "java.util.list" one.
> Its confusing..

I think you've missed something very important about action method 
return values: these methods will generally return a string. That string 
is used to select the result that will be displayed to the user.

Dave


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Query regarding optional method attribute in action tag - struts.xml

Posted by HariniKaushik <kh...@yahoo.com>.
Thanks for the reply.
getUserList would just return the List(java.util.List)
And its just the method that 'll get called when the action
Register_getUserList action is triggered.
I have combined two actions together through Register_* action names.
And no validation is done for getUserList method.

Actually if i give the viewusers.jsp in "Input" result , it gets executed
but it doesnt get executed if given in success.I guess its not returning
success.
I dont know what result i can give for "java.util.list" one.
Its confusing..



HariniKaushik wrote:
> 
> Hi All,
> I feel this is the correct Forum where in my doubts 'll be cleared.
> I've created Login,UserRegistration page and UserView page(where in admin
> only can view the users)
> And this is my action tag for Register_createUser and Register_getUserList
>  <action name="Register_*" class="com.test.action.UserRegister"
> method="{1}">
>         <result name="success">common/{1}.jsp</result>
>         <result name="input">common/usersList.jsp</result>
>         <result name="error">result/{1}.jsp</result>
>         </action>
> 
> The problem is that for Register_getUserList action I ve defined the
> getUserList  method that returns the List.Since it returns the correct
> List I want the "success" result name to be executed and go to the
> UserList page.
> But what happens is that though the correct List is returned the "input"
> result gets executed and it goes again to the validation page.
> That validation I ve given for "Register_createUser" action which I do not
> want to get executed for "getUserList Action." I dunno why it goes to
> input rather than success page.
> If any body is aware of this please let me know!
> Appreciate any help!!!!
> 
> Thanks,
> Harini
> 
> 

-- 
View this message in context: http://www.nabble.com/Query-regarding-optional-method-attribute-in-action-tag---struts.xml-tp23122390p23123097.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org