Wendy Smoak wrote:

From: "Vinicius Caldeira Carvalho" <[EMAIL PROTECTED]>


I have two actions cuz:
The first one is triggered after the user clicks in a link from a page
that displays a list of prospects.
so it find the prospect attributes and then sets it for the form in the
next page. got it?



Yes, but you'll find 'Action Chaining' is generally frowned upon. Your first action does not have an 'input' attribute, it just goes straight to the second action when it's done. And if you're setting a form property in the first action that you say is NOT there in the second action, it makes me think that a new request [and thus a new form] is being created somewhere along the line.

First, I'd put a debug statement in before:


reservaForm.setIdProponente(proponente.getId());


and print out proponente.getId() to make sure it really has a value.  Maybe
you're setting the form property to the empty String without realizing it.

What does the log file say?  The RequestProcessor is *very* verbose, you
should see things like:

09:50:24,202 - DEBUG org.apache.struts.action.RequestProcessor -  Looking
for Action instance for class edu.asu.vpia.struts.DevilsDenRegisterAction
09:50:24,202 - DEBUG org.apache.struts.action.RequestProcessor -   Creating
new Action instance
09:50:24,311 - DEBUG edu.asu.vpia.struts.DevilsDenRegisterAction -
unspecified begin
09:51:08,155 - DEBUG org.apache.struts.action.RequestProcessor - Processing
a 'GET' for path '/denLogin'
09:51:08,155 - DEBUG org.apache.struts.action.RequestProcessor -  Storing
ActionForm bean instance in scope 'request' under attribute key 'loginForm'
09:51:08,155 - DEBUG org.apache.struts.action.RequestProcessor -  Populating
bean properties from this request

If you put a debug statement in the constructor or the 'setIdProponente'
method, you should be able to see when the form gets created and when that
property gets set.  If you then see a second form creation, well, that's
where your value went!



Well I think I got it. I used to debug a log when the constructor of my form is called and guess what.

Back in the good old struts in action (struts sequence diagram page)
The action servlet looks for an action (first action) finds a form associated (great!!! let's instantiate it for you). The value is set. Now, forward to the jsp, oops, it has a form element with an action associated, (wow! now lets look for its formbean and instantiate it.) oops, now I have a new instance with empty fields ....
well...
webwork??? jsf??? maybe...


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



Reply via email to