Java Reference
In-Depth Information
}
public void setAge(int age) {
this.age = age;
}
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
}
Tag Library View Helper
The JavaBean-based view helper is simple to use. The best part is it works even without
any support from the Spring Framework. However, it still mixes programming logic into
JSPs. It also does not allow for a component-based view helper. Let us consider a case
where you need a pagination display of search results in an HTML table. It would be very
convenient if we had a reusable component that displayed paged search results given the
search result list. This component can be further extended to support sorting search
results on any of the columns.
The JSP pages in eInsure mixed HTML and JavaBeans to display components such as
select boxes and drop-down menus. These can best be handled as reusable components.
All these components can easily be developed using tag libraries. Tag libraries provide
generic reusable components that cater to different requirements handled until now
using JavaBeans helpers or scriptlets. Besides, efficient third-party component-based tag
libraries are available to ease the development of flexible and robust view components.
Using JSTL Tags
The JSP Standard Tag Library ( JSTL) provides a simple yet powerful tag library that
encapsulates common functions required by any JSP-based view. The JSTL Expression
 
Search WWH ::




Custom Search