| Author |
JSP
|
priya shankar
Ranch Hand
Joined: May 12, 2003
Posts: 51
|
|
In a JSp proj in what condition we use UseBean tag and Taglib..explanation pls thankx priya
|
 |
narasimharao konjeti
Ranch Hand
Joined: Apr 26, 2003
Posts: 130
|
|
If you want to encapsulate java code or to use the OO properties java(or logic, which is written in java). we shall go for jsp beans. And If you want to write your own tag like <jsp:include....> you should go for tag libs. Here in the case of bean we will retrive the info by using setXXX() and getXX() methods. But here in tag lib directly you can access the methods of a particular object/class. This is small and brief description about bean and taglib cheers
|
"Unwise to sweat petty stuff, wise to pet sweaty stuff."
|
 |
arul murug
Greenhorn
Joined: Aug 08, 2002
Posts: 24
|
|
In early days of JSP, people wrote the data retrieval, storage and formatting logics in the JSP page using scriplets and expressions. The cluttered logic in the JSP page reduced the Modularity, Reusability and readability of the application. Then the later versions of JSP brought the concept of including Java beans thru Usebean and Taglibs, which help us in removing these cluttered logic from the JSP pages. In a broader sense, Java Beans can be used to extract data retrieval and storage logic from the JSP. Taglib can be used to extract the logic for Formatting the output.(For example formatting a HTML table from a resultset etc..) Hope this helps..
|
SCJP2<br />SCWCD<br />UML & OOAD - IBM 486
|
 |
Sakthivel Palanivelu
Greenhorn
Joined: Mar 28, 2001
Posts: 3
|
|
Even now, in some cases we have to write some logic in JSP itself ( example.... after getting the result from a vector or some object.... You have to navigate to print the stuff. Else you have to have the HTML stuff inside your bean.... So cluttering will be still there
|
Sakthi
|
 |
arul murug
Greenhorn
Joined: Aug 08, 2002
Posts: 24
|
|
Hi Sakthi In Existing JSP pages, I try(not always) to extract whenever I come across java code into a bean or custom tag. New pages can be designed with out them. In your case, I think custom Tag is a suitable candidate to replace the logic of printing values from vector and formatting inside a HTML table.
|
 |
 |
|
|
subject: JSP
|
|
|