How to transfer a bulk amount of tabular data from a jsp page to an ejb thru a servlet and viceversa

Questions by radhu

Showing Answers 1 - 3 of 3 Answers

gautam

  • Oct 20th, 2005
 

very nice site.

  Was this answer useful?  Yes

ratul_dg

  • Oct 20th, 2005
 

First of all, I don't quite get what you mean by tabular data.Please explain in detail.

Anyway, if you want to send huge amount of data from the jsp to an ejb via servlet what you can do is write a data-object class where you declare a certain number of instance fields and define getter and setter methods for those fields. Now in the JSP, set the values of those fields in hidden variables. In the servlet, extract the values of those fields using request.getParameter("param-name"). Create an object of the data-object class that you had written earlier and use the setter methods in that class to set the values of the parameters that you have extracted in the servlet.Now pass this object to the ejb (session bean) method. In the ejb, you can get the values of the fields using getter methods of the data-access object.

By tabular data if you mean, that the same form field can contain multiple values, then in the servlet use request.getParameterValues("param-name").

  Was this answer useful?  Yes

shekhar

  • Jan 21st, 2006
 

yes u create a class that implements serializable interface. make public attributes equals to fields u want and set values in attributes this make a complete row and pass it to jsp/servlet/bean methods.if u want to send multiple rows then create a ArraList and add objects of ur class in it and receive as Collection. :-)

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions