Forums Register Login

Simple Question........JSP

+Pie Number of slices to send: Send
Hai!
I have two doubts regarding JSP.
First one:

-- I have javabean whose constructor has Paramters.
How to pass parameters to constructor while initializing bean from JSP using Usebean tag?
Second one:
-- I have Javabean A in which one of the properties is of type Javabean B. Now problem is to get a property of B say x thorough the instance of A using get property tag in JSP .. Something like objA.getB().getX();
Any help in this regard is appreciable
Regards
Manohar

+Pie Number of slices to send: Send
1. If your constructor has parameters, it is NOT a JavaBean. You will have to reorganize your code. The JSP <jsp:useBean tag depends on there being a no-args constructor.
2. I don't think that JSP will write code to do that. You will have to code it yourself.
Bill

------------------
author of:
This looks like a job for .... legal tender! It says so right in this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 658 times.
Similar Threads
Problem with <jsp:usebean tag>
getting java bean in Servlet ,from JSP
How to get parameter using struts Tag
Connection Bean
Is it possible to pass a parameter to JavaBean before call his constructor ?
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 19, 2024 01:14:50.