How do I use a scriptlet to initialize a newly instantiated bean?



How do I use a scriptlet to initialize a newly instantiated bean?..

Answer / Ilesh Kumar

<html><body>To initialize a newly instantiated bean using a scriptlet, create the bean instance within a scriptlet and set its properties using attribute values. Here's an example:<br><br>n<%nBean bean = new Bean();<br>bean.nsetProperty1(request.getParameter("property1"));<br>bean.nsetProperty2(request.getParameter("property2"));<br>%>n</body></html>

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More JSP Interview Questions

What are the life-cycle methods for a jsp?

1 Answers  


What is custom tag library?

1 Answers  


Explain JSP directives.

1 Answers  


What is the difference between hide comment and output comment?

1 Answers  


What are the types of directives in jsp?

1 Answers  


What is a expression?

1 Answers  


What is the use of?

1 Answers  


Tell us about the jsp life cycle methods.

1 Answers  


what is the difference between jsp and servlets ?

1 Answers   Cap Gemini,


what is the extended star schema

1 Answers  


What is the need of jsp?

1 Answers  


What is jsp in html?

1 Answers  


Categories