2013年12月4日星期三

jsp advice on how to submit multiple records form

For example
department information , a person's name , contact information
( input ) XXX department Zhang 123345
( input ) XXX department Doe 123345
( input ) XXX department Zhang 123345
( input ) XXX department Doe 123345

submit button

Then I want to submit to the action.
But the question is , will it be how to submit it . I can not put the name of each are set once , and then submit it. That that's the case , then the number of parameters ah , even if the problem is not that argument , action receiver it? I feel so unscientific .

So I would like to ask you , this situation should be how to do it .
------ Solution ---------------------------------------- ----
with a list users; collection of generic
name = user [i]. name
------ Solution ---------------------------- ----------------
struts2 , then you can use

with a list users ;/ / set of generic
name = user [i]. name

json , etc. can also be used to parse js way then action
visual LZ using struts1
------ For reference only ---------------------------- -----------
with javaBean, own custom forms into the reference category , there are several on the new number of entities , and 1L almost right
------ For reference only - --------------------------------------
assembled into json, actoin then parse
------ For reference only --------------------------------------- < br> with a hash table should be right, and you can try
------ For reference only -------------------- -------------------
ah, not quite understand .
I use struts framework , to be submitted to the struts .

write a model that can do it .
------ For reference only -------------------------------------- -
directly defined as the same name it ! Submit to the background when an array of arrays take back their own .
------ For reference only -------------------------------------- -
write an entity emp, entities are: departmental information, a person's name , contact information, this entity , the page is worth taking the time to write emp.name in action get, set (), emp.tel ; . . . so you can get all the values ​​of the
------ For reference only ------------------------- --------------
try to use the same type request.getParameterValues ​​(name) with the same name, the background.
------ For reference only -------------------------------------- -
NAME consistent control settings for each column , but the client ID can be set for different values

jsp request can be submitted in addition to the controls FORM NAME Gets a value that can also be used

String thisNameValues[] = request.getParameterValues(name) 


Gets an array of the same name

Note CheckBox control, if unchecked, will not be passed to the client , if there is a checkbox, the line will cause inconsistencies
------ For reference only --------- ------------------------------

this should be the landlord can try . Tried before , and then spread to the background according to the insert array .
------ For reference only -------------------------------------- -
understand, thank you
------ For reference only ----------------------------- ----------
landlord ah , your question is really sharp , and I also have a problem , can you share some of your code , or directly to me , I really do not understand ah
Thank you, landlord ah !

没有评论:

发表评论