File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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: 13036
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
It's not a secret anymore!