aspose file tools
The moose likes JSP and the fly likes Jsp standard action tag (usebean) Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » JSP
Reply Bookmark "Jsp standard action tag (usebean)" Watch "Jsp standard action tag (usebean)" New topic
Author

Jsp standard action tag (usebean)

chaitanya sri
Greenhorn

Joined: Jan 25, 2012
Posts: 2
Hi,


I could not understand the jsp use bean tag

<jsp:usebean id="x" Class= "com.code.Employee" Scope=" request">

what does dis tag exactly do ?? i was confused wid the id attribute wat does the id attribute is used for?


Bear Bibeault
Author and opinionated walrus
Marshal

Joined: Jan 10, 2002
Posts: 50693

The <jsp:useBean> tag (not usebean, case counts) hooks up a scoped variable to a scripting variable. Because scriptlets have been discredited for 10 years now as they were replaced with the JSTL and EL in JSP 2, this tag is used a lot less than it used to be.

There are some arrangements where this tag may cause the scoped variable to be created if it does not already exist, and this side effect is the only really useful part of the the tag when used in modern script-less pages.

P.S. The id attribute names the scoped variable to be targeted and the scripting variable to be created.


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
chaitanya sri
Greenhorn

Joined: Jan 25, 2012
Posts: 2
Thank you that was helpful. Sorry about that i was new to form thanks for the information.
 
 
subject: Jsp standard action tag (usebean)
 
Threads others viewed
Form based authentication with Struts login form
Whats wrong with <H:FORM> Tag
i18n taglib
How to insert at runtime using AJAX
use of scope in useBean tag and session in page tag
developer file tools