Stripes: I can pre-populate a form, but after submit the formBean is null -
I can pre-populate one object, client
in my case, my strippers JSP form I am, but when I submit this form, then my object is empty.
I have created a second "temp" object which is a parallel duplicate of client
and retains its value, so I have a problem passing through an object in the request Can not see
My form is as follows:
& lt; S: form beanclass = "com.jameselsey.salestracker. Action.ViewClientAction" & gt; & Lt; S: Hidden name = "client A" value = "$ {actionBean.clientA}" /> & Lt; S: hidden name = "customer id" value = "$ {actionBean.clientId}" /> & Lt; Table & gt; & Lt; TR & gt; & Lt; Td> Name: & lt; / Td> & Lt; Td> & Lt; S: Text name = "client.name" /> gt; & Lt; / Td> & Lt; / TR & gt; & Lt; TR & gt; & Lt; Td> Sector: & lt; / Td> & Lt; Td> & Lt; S: Text name = "client.sector" /> gt; & Lt; / Td> & Lt; / TR & gt; & Lt ;! - Some attributions were omitted; here no need - & gt; & Lt; / Table & gt; & Lt; / S: Forms & gt;
looks like my action
Public class ViewClientAction expands base {@SpringBean ClientService clientService; // = new client service (); Private integer customer; Private client client; Private Client Client A; Public Zero Set Client (Client Client) {this.client = client; } Public Integer getClientId () {Return Client ID; } Public Zero Set ClientId (Integer Customer ID) {this.clientId = clientId; } Public customer getClientA () {Return Client A; } Public Zero Set Client A (Customer Client A) {this.clientA = clientA; } Public customer getClient () {return client; } @defaulthandler Public Solutions QuickView () {clientA = clientService.getClientById (clientId); Client = clientService.getClientById (clientId); Return to the new forward resolution ("/ jsp / viewClientQuickView.jsp"); } Save public resolution () {clientService.persistClient (client); Return new forward resolution ("/ jsp / reports.jsp"); } Public resolution viewClientInfo () {client = clientService.getClientById (clientId); New forward reply return ("/ jsp / viewClientClientInfo.jsp"); } ...
If I set a breakpoint on clientService.persistClient (client);
I can see that the original value of all the objects in ClientA
, however, the customer
is terminated.
Am I missing something that binds Farm Bean for the customer
object in my action?
Thanks
Add this line to your JSP:
< Pre> & lt; S: Hidden name = "customer" value = "$ {actionBean.client}" />
Comments
Post a Comment