|
INTERVIEW QUESTIONS
J2EE
EJB
DETAILS
Question: How to transfer a bulk amount of tabular data from a jsp page to an ejb thru a servlet and viceversa
Answer: 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").
|
|
|
Category |
EJB Interview Questions & Answers -
Exam Mode /
Learning Mode
|
Rating |
(0.3) By 7802 users |
Added on |
7/14/2011 |
Views |
72391 |
Rate it! |
|
|
Question:
How to transfer a bulk amount of tabular data from a jsp page to an ejb thru a servlet and viceversa
Answer:
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"). Source: CoolInterview.com
If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-
- There should not be any Spelling Mistakes.
- There should not be any Gramatical Errors.
- Answers must not contain any bad words.
- Answers should not be the repeat of same answer, already approved.
- Answer should be complete in itself.
|
|
Related Questions |
View Answer |
|
What is an EJB Context?
|
View Answer
|
|
Why we need the transactions?
|
View Answer
|
|
Just by seeing the signature of the bean how can you specify whether it is a Stateful or Stateless Session Bean?
|
View Answer
|
|
What is the importance of the Narrow class in RMI?
|
View Answer
|
|
What is the diff between interface and abstract class?
|
View Answer
|
|
When should we use session bean/entity bean?I was unable to judge?For Example :For Airline Project where we can use EJB's? How can we differentiate the stateful and stateless session beans?
|
View Answer
|
|
What is return type of create method of an entity bean
|
View Answer
|
|
What is default state of session bean in a ejbjar.xml
|
View Answer
|
|
Can we deploy two ejbs with same JNDI name in separate ears
|
View Answer
|
|
How EjbQL ara impemented when it is necessary?
|
View Answer
|
|
How to configure the jdbc driver in welogic server? What are all the necessary jar files to be used?
|
View Answer
|
|
How do J2EE application servers in general and the Weblogic servers in particular help software development?
|
View Answer
|
|
How to achieve clustering and connection pooling in ejb
|
View Answer
|
|
Where is JNDI located (In client or server). If its server, how a client can get the information about which EJB is registered in JNDI ?. How EJB will be registered in JNDI.
|
View Answer
|
|
What is ejbdoc? difference between connector,server,container?
|
View Answer
|
|
What is session synchronization in EJB
|
View Answer
|
|
What is the default transaction attribute in transactions
|
View Answer
|
|
What kind of bean(entity/session) will you use if there are no database transactions and all you use is a read-only database.
|
View Answer
|
|
What is the use of activate, passivate methods in EJB?
|
View Answer
|
|
What are the file used in hibernate?
|
View Answer
|
Please Note: We keep on updating better answers to this site. In case you are looking for Jobs, Pls Click Here Vyoms.com - Best Freshers & Experienced Jobs Website.
View All EJB Interview Questions & Answers - Exam Mode /
Learning Mode
|