JSP-urgent
  1. JSP-urgent (2 messages)

    hi all
    can anyone please help me to solve my problem..
    1)the thing is that i have 'N' no of fields which is generated dynamically by the
    user..after filling the fields the user submits the data that should be taken to next
    JSP page(say like page1,page2, etc)..so my values from page + values entered in page
    passed to the server for further manipulation..this is normal
    2)but if my user again goes back to pageno1 & reenters the values then this should
    also be carried to pageno2 and the changes in the pageno2 must reflect..
    ..my problem is i can't use hidden values to pass from one page to another b'cos the
    fields are generated dynamically and also very large in no..say 1000 fields..
    ..and also if i store the values in an array in JAVASCRIPT..i can't pass this array
    to the server along with its value..
    i have a doubt that if i use a java file in <jsp:use bean>so that my bean collects
    all the values in an array and stores that value so that whenever needed i can collect
    that??but from my html fields how to interact with the bean which collects the value
    from my html fields(again i should go for javascript-which collects the values from
    the fields and puts in a hidden field..so iam back to score1 where i can't use hidden
    fields)..so is there any other way to do this????please help me its very urgent
    thanx in advance
    awaiting for your reply
    ram

    Threaded Messages (2)

  2. JSP-urgent[ Go to top ]

    The logic is like this.

    Store the results of the servlet or JSP ( that is generating dynamically) into the bean and use the usebean in the JSP to get the values. use
    req.setAttirbute("foo",f)
    f being object that stores the value of your variable inside your JSP.
    While coding the jsp use the bean and get the values of the object u stored the value with. This is how i know to store and retrieve as per MVC model

    Prasath
  3. JSP-urgent[ Go to top ]

    ok hereĀ“s my solution depending on my interpretation of ur problem. what u can do is store all the fields that are entered by the user in the java.util.Properties (this has a key and value format). so the keys will represent the names of the fields entered by the user and the values will be the values entered by the user. now u may put this properties in to the session and in the next page generate the html such that the field names and their corresponding values will be populated from the properties key and value pairs respectively. hope this will solve ur problem. best of luck.