June 20 2015

Jsp usebean example

Jsp usebean example

<jsp:useBean> action tag is used to instantiate or locate java bean instance and associate it with a jsp scripting variable.

Attributes

id – represents the name of java bean

scope – represents the scope of the java bean. Valid values are page, request, session and application. The default values is page.

class – takes the qualified class name to create a java bean if java bean is not available in specific scope

type – takes the qualified class name or interface name. A bean can implement many interfaces, the desired interface type can be specified in type attribute. Type attribute can be used with or without class or beanName attributes. If only type attribute is specified and no matching object is found, jsp container throws InstantiationException exception Continue reading

Category: Jsp | LEAVE A COMMENT