Conditional Bean Operations
Bean conditionally created
jsp:useBean results in new bean object only if no bean 
with same id and scope can be found 
If a bean with same id and scope is found, the preexisting 
bean is simply bound to variable referenced by id
Bean properties conditionally set
replaced by
statements
The statements (jsp:setProperty elements) are executed 
only if a new bean is created, not if an existing bean is 
found
73
JSP
www.corewebprogramming.com
Conditional Bean Creation:
AccessCountBean
public class AccessCountBean {
private String firstPage;
private int accessCount = 1;
public String getFirstPage() {
return(firstPage);
}
public void setFirstPage(String firstPage) {
this.firstPage = firstPage;
}
public int getAccessCount() {
return(accessCount);
}
public void setAccessCountIncrement(int increment) {
accessCount = accessCount + increment;
}
}
74
JSP
www.corewebprogramming.com
37




  

Home

About Services Network Support FAQ Order Contact
 

Java Web Hosting

Our partners:Jsp Web Hosting Unlimited Web Hosting Cheapest Web Hosting  Java Web Hosting Web Templates Best Web Templates PHP Mysql Web Hosting Interland Web Hosting Cheap Web Hosting PHP Web Hosting Tomcat Web Hosting Quality Web Hosting Best Web Hosting  Mac Web Hosting 

Lunarwebhost.net  Business web hosting division of Vision Web Hosting Inc. All rights reserved