Let me give u one more example ! This one comes from an adaptation of our
existing code

<%@ taglib uri="web-inf/taglib.tld" prefix="custom" %>

<table align=center border=1>
<tr>
        <td>Empno
        <td>EName
        <td>Designation
        <td>Department
</tr>
<custom:EmployeeList
        from="<% request.getParameter("Emp_from") %>"
      to="<% request.getParameter("Emp_To") %>"  >

        <tr>
                <td><%=Empno %>
                <td><%=EName %>
                <td><%=Designation %>
                <td><%=Department %>
        </tr>
<custom:EmployeeList />
</table>

The best part of the above is that *this* kind of seperation is not even
possible by beans. What the above will do ( humour me, if u are already
aware of it) is that it will repeat the body of my "custom" tag producing
rows of tables. With a little modification i can produce a employee dropdown
list without altering the processing logic.

Hope this helps ..

Mayuresh

-----Original Message-----
From: A mailing list about Java Server Pages specification and reference
[mailto:[EMAIL PROTECTED]]On Behalf Of Joseph Ottinger
Sent: Wednesday, February 07, 2001 9:48 PM
To: [EMAIL PROTECTED]
Subject: Re: Advantages of Taglibs over JavaBeans


Compare something like <%= mybean.getSomething() %> to <jsp:getProperty
name="mybean" property="something" /> - one is well-formed, and more likely
to be understood by less-aware JSP programmers.

It also means your JSP isn't clogged with tons of scriptlets that interface
with beans; JSP doesn't use beans for actions so much as for data
repositories. You can, for example, use a bean to hold your data and then a
tag to act upon it. That's what most of *my* taglibs do, and that's the
model I've found to be most efficient to me.


>From: Ganesh MohanRao <[EMAIL PROTECTED]>
>Reply-To: A mailing list about Java Server Pages specification and
>     reference <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]
>Subject: Advantages of Taglibs over JavaBeans
>Date: Wed, 7 Feb 2001 09:44:33 -0600
>
>Hi All,
>
>Can anyone tell me the Advantatges of Taglib in JSP?
>
>Separating Business logic from Presentation is already done using Java
>Beans.
>
>In what way it is advantageous than Java Bean.
>
>Can you tell something which can be done using Taglib(Custom Tags) and not
>possible using JavaBean?
>
>If possible give me some lights on Taglibs.
>
>
>Thanx in Advance.
>
>Ganesh
>
>===========================================================================
>To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
>JSP-INTEREST".
>For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
>DIGEST".
>Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to