Community Sites
Create your own community website and start earning today !
It's Free !
 
Communities Members BookmarksPolls Fresher Jobs Strange Photos Academic Projects New Member FAQ  



My Profile
Active Members
TodayLast 7 Days more...



Awards & Gifts
Online Exams

Fresher Jobs


Our fresher job section is exclusively for fresh graduates! Find jobs for freshers in major Indian cities including Bangalore, Chennai, Hyderabad, Pune or Kochi

Resources


Find educational articles, blogs, discussion threads and other resources.

Colleges


Find details about any college in India or search for courses.

website counter



Tags and Tag Libraries


Posted Date: 17 Mar 2008    Resource Type: Articles/Knowledge Sharing    Category: General

Posted By: Aparanjitha       Member Level: Gold
Rating:     Points: 5



What Is a Tag Library?

•JSP technology has a set of pre- defined tags



•These are HTML like but…

•… have limited functionality

•Can define new tags

–Look like HTML

–Can be used by page authors

–“Java code” is executed when tag is encountered

–Allow us to keep Java code off the page

•Better separation of content and logic

May Have Tags To…

•Process an SQL command

•Parse XML and output HTML

•Automatically call into an “EJB component” (EJB ™ technology- based component)

•Get called on every request to initialize script variables

•Iterate over a ResultSet and display the output in an HTML table

Primary Tag Classes (javax.servlet.jsp.tagext.Tag)


Simple Tag Example :

<%@ taglib uri=“/WEB-INF/mylib.tld” prefix=“test” %>








public class HelloTag extends TagSupport {

private String name = “World”;

public void setName(String name) { this.name = name; }

public int doEndTag() { pageContext.getOut().println(“Hello “ + name); }

}


mylib.tld

……

hello

com.pramati.HelloTag

empty

name





How Tag Handler methods are invoked :


attr1=“value1” ------------ setAttr1(“value1”)

attr2=“value2” ------------ setAttr2(“value2”)

> ------------ doStartTag()

This tags's body

------------ doEndTag()

•Implementation of JSP page will use the tag handler for each ‘action’ on page.

Summary

•The JSP specification is a powerful system for creating structured web content

•JSP technology allows non- programmers to develop dynamic web pages

•JSP technology allows collaboration between programmers and page designers when building web applications

•JSP technology uses the Java programming language as the script language

•The generated servlet can be managed by directives

•JSP components can be used as the view in the MVC architecture

•Authors using JSP technology are not necessarily programmers using Java technology

•Want to keep “Java code” off a “JSP Page”

•Custom actions (tag libraries) allow the use of elements as a replacement for Java code





Responses

Author: Deepu    19 Mar 2008Member Level: Diamond   Points : 1
Good work Aparanjitha.Keep going with your postings.


Author: Aparanjitha    19 Mar 2008Member Level: Gold   Points : 3
thanks for ur suggestions and encouragement keep on reading my resoucres and give me some more advises . As you said before i want to gain knowledge in all fields and place resources that will be help ful to non cs . Thank you



Author: Deepu    19 Mar 2008Member Level: Diamond   Points : 3
Sure,I will go on reading your postings.If you go on accepting my advices i will give more advises for your development in the site.Keep going.But just keep in mind that your postings are going to be read by hundreds of people throughout the world.


Author: Aparanjitha    19 Mar 2008Member Level: Gold   Points : 2
thnx for your reply to my msg. i mine it that my postings will be read by hundreds of people . so im sure that i will place good resources


Feedbacks      
Popular Tags   What are tags ?   Search Tags  
(No tags found.)

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: jsp to servlet translation
Previous Resource: Jsp Q & A
Return to Discussion Resource Index
Post New Resource
Category: General


Post resources and earn money!
 
Related Resources

Watch TV Channels



Contact Us    Editors    Privacy Policy    Terms Of Use   

SpiderWorks Technologies Pvt Ltd. 2006 - 2007 All Rights Reserved.