Hi, when I create the bean object using the following code <jsp:useBean = "book1" scope="session" class="myClass.Books" /> How can I pass this object book1 as an hidden type request parameter to another html page. Is this the right way to do it? <input type=hidden name="book" vaue=book1> Thanks in Advance
Carl Trusiak
Sheriff
Joined: Jun 13, 2000
Posts: 3340
posted
0
The naming policy States : "Do not use the names of celebrities." Please reregister with a nmae that meets http://www.javaranch.com/name.jsp
If the HTML page is being called by the same page where the bean instance (<jsp:useBean> action is defined then there is no need to pass it as hidden field as you have already given a "session" scope. Also note that the syntax should be: <jsp:useBean id="book1" scope="session" class="myClass.Books" /> HTH
ken chou
Ranch Hand
Joined: Feb 08, 2001
Posts: 68
posted
0
<jsp:useBean id="book1" scope="session" class="myClass.Books" /> For the above, you define the bean "book1" with the scope of "session", you can always get the same bean as long as it's in any page with the same session. For the following: <input type=hidden name="book" vaue=book1>
You define a hidden Variable named "book" with a String value "book1". It will be totally different thing since it's not a bean.
hemang patel
Greenhorn
Joined: Mar 06, 2001
Posts: 8
posted
0
try changing the scope of the bean to application. Then, you can use the same bean in the html if that html is a part of the application ....