This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Servlets and the fly likes Simple Question........JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Simple Question........JSP" Watch "Simple Question........JSP" New topic

Simple Question........JSP

Manohar Karamballi
Ranch Hand

Joined: Jul 17, 2001
Posts: 227
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

William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 12761
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.

author of:
I agree. Here's the link:
subject: Simple Question........JSP
Similar Threads
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 ?
Problem with <jsp:usebean tag>