What is difference between custom JSP tags and beans?,Java, C ,C++, ASP, ASP.net C# ,Struts ,Questions & Answer, Struts2, Ajax, Hibernate, Swing ,JSP , Servlet, J2EE ,Core Java ,Stping, VC++, HTML, DHTML, JAVASCRIPT, VB ,CSS, interview ,questions, and answers, for,experienced, and fresher
What is difference between custom JSP tags and beans?

JSP has its own tag library that you can use in any nuber of pages. You can also create your own tags (Cusustom tags), define attributes and body of the tags and then group your tags into collections called tag library.


To use custom JSP tags, you need to define three separate components:


  * Tag handler class.

  * Tag library descriptor file.

  * JSP file that uses the tag library.

When the first two components are done, you can use the tag by using taglib directive.


JavaBeans are Java utility classes you defined. Beans have a standard format for Java classes. Custom tags and beans accomplish the same goals � encapsulating complex behavior into simple and accessible forms.

Difference between custom JSP tags and beans :


  * Custom tags require more work to set up than do beans.

  * Custom tags can manipulate JSP content, beans cannot.

  * Custom tags usually define relatively self-contained behavior, whereas beans are often defined in one servlet and used in a different servlet or JSP page.

More interview questions and answers
What is a output comment?
What are the differences between a session and a cookie?
What is HttpTunneling?
Why in Servlet 2.4 specification SingleThreadModel has been deprecated?
How can I set a cookie?
How will you delete a cookie?
What is the difference between Context init parameter and Servlet init parameter?
What are the different ways for getting a servlet context?
What is the difference between an attribute and a parameter?
How to make a context thread safe?
What is the difference between setting the session time out in deployment descriptor and setting the time out programmatically?
How can my application get to know when a HttpSession is removed?
How many cookies can one set in the response object of the servlet? Also, are there any restrictions on the size of cookies?
When a session object gets added or removed to the session, which event will get notified ?
What is URL Encoding and URL Decoding ?
What is the difference between an applet and a servlet?
What is life cycle of servlet?
When init() and Distroy() will be called.
What is the use of setComment and getComment methods in Cookies ?
Why we are used setMaxAge() and getMaxAge() in Cookies ?
What is the use of setSecure() and getSecure() in Cookies ?
How do you communicate between the servlets?
What is Servlet chaining?
How will you communicate from an applet to servlet?
Can we call a servlet with parameters in the URL?
How do servlets handle multiple simultaneous requests?
Explain the directory structure of a web application?
What is pre initialization of a servlet?
What are the uses of ServletRequest?
What are the uses of ServletResponse interface?
How HTTP Servlet handles client requests?
Is HTML page a web component?
What is the web container?
What is deployment descriptor?
Do objects stored in a HTTP Session need to be serializable? Or can it store any object?
How can you implement singleton pattern in servlets ?
What is the difference between an application server and a web server?
What is servlet exception?
What is a WAR file?
What is a servlet filter?
What is JSP?
What is lifecycle of JSP?
What is the difference between JSP and Servlets ?
What is difference between custom JSP tags and beans?
What are the different ways for session tracking?
What mechanisms are used by a Servlet Container to maintain session information?
Difference between GET and POST
What is servlet mapping?
What is servlet context ?
How many JSP scripting elements are there and what are they?
How do I include static files within a JSP page?
How can I implement a thread-safe JSP page?
What is the difference in using request.getRequestDispatcher() and context.getRequestDispatcher()?
What are context initialization parameters?
What is a Expression?
What is a Declaration?
What is a Scriptlet?
What are the implicit objects?
What\'s the difference between forward and sendRedirect?
What are the different scopes available ?
Is JSP extensible ?
What is the difference between <%@ include ...> (directive include) and ?
Can I just abort processing a JSP?
What are the parameters for service method ?
How do I prevent the output of my JSP or Servlet pages from being cached by the browser?
How to refer the \"this\" variable within a JSP page?
Can we implement an interface in JSP ?
How do I use a scriptlet to initialize a newly instantiated bean?
What are JSP Actions?
What is the difference between ServletContext and ServletConfig?
What is a Hidden Comment?
How to pass information from JSP to included JSP?
How do you pass data (including JavaBeans) to a JSP from a servlet?
How can I set a cookie?
How will you delete a cookie?
What JSP lifecycle methods we can override?
How will you include a static file in a JSP page?
How you can perform browser redirection?
Can we use ServletOutputStream object from a JSP page?
How can I invoke a JSP error page from a servlet?
How can I enable session tracking for JSP pages if the browser has disabled cookies?
How can you declare methods in your JSP page?
How can we set the inactivity period on a per-session basis?
How do you pass an init parameter to a JSP?
How can my application get to know when a HttpSession is removed?
How many cookies can one set in the response object of the servlet? Also, are there any restrictions on the size of cookies?
When a session object gets added or removed to the session, which event will get notified ?
What is URL Encoding and URL Decoding ?
What is the difference between an applet and a servlet?
What are the different web servers available name few of them?
What are the different types of ServletEngines?
What is a Session Id?
What is the use of setComment and getComment methods in Cookies ?
Why we are used setMaxAge() and getMaxAge() in Cookies ?
What is the use of setSecure() and getSecure() in Cookies ?
Is HTML page a web component?
What is the container?
What is deployment descriptor?
How can I print the stack trace of an exception from a JSP page?
Do objects stored in a HTTP Session need to be serializable? Or can it store any object?