You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Struts Newsgroup (@Basebeans.com)" <st...@basebeans.com> on 2002/06/15 22:25:01 UTC

How to add an attribute to the request in the validate() method?

Subject: How to add an attribute to the request in the validate() method?
From: "Kriss" <k....@gmx.net>
 ===
Hi all,

I�m trying to add an parameter in the validate method in a form bean to the
request like
request.setAttribute("id", commentID);

Unfortunately, this has no effect when the validate method redirects to the
target given in the "input" attribute in the struts-config.xml; the target
is not a jsp, but another action, wich normally works fine.

Any hints or suggestions?

Thanks in advance,
Kriss



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


forwarding a request to action class from ActionForm

Posted by rayaku <ya...@nous.soft.net>.
Hi,
I have a requirement to forward to an action (based on a user selected
information in a form)
from ActionForm, if so then how could it be?

Ex. validate(----------------){
		String actionby= request.getParameter("actionFrom");
		if(actionby.equals("3")){
			//here i would like to forward to action2 class
			// rather to compare in action1 class and forwarding form there to
action2

		}
   }
//validate method returns ActionErrors so is it possible to forward to
another action class.

TIA
rayaku



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: How to add an attribute to the request in the validate() method?

Posted by Andrew Hill <an...@gridnode.com>.
Perhaps you could add an attribute and have the action it goes to check for
this attribute instead of or as well as the parameter of the same name?
(Bit bothersome though, and seems inelegant.)

-----Original Message-----
From: Vincent Aumont [mailto:vincent.aumont@vsl.ca]
Sent: Sunday, June 16, 2002 11:21
To: Struts Users Mailing List
Subject: Re: How to add an attribute to the request in the validate()
method?


> I´m trying to add an parameter in the validate method in a form bean to
the
> request like
> request.setAttribute("id", commentID);

As the name indicates, setAttribute sets an attribute, not a parameter.
A possible solution would be to define a hidden field in your form.

-vincent.



--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: How to add an attribute to the request in the validate() method?

Posted by Vincent Aumont <vi...@vsl.ca>.
> I´m trying to add an parameter in the validate method in a form bean to the
> request like
> request.setAttribute("id", commentID);

As the name indicates, setAttribute sets an attribute, not a parameter.
A possible solution would be to define a hidden field in your form.

-vincent.



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>