info JSP page directive with Example

info JSP page directive with Example


1. What is info JSP attribute and where it is used in coding?
  • "info" is one of the 14 attributes of page directive supported by JSP.
  • Programmer uses info attribute to give some information or description about the JSP page like a) when the project started b) Programmers involved c) functionality of the page etc.
  • This information is seen in the source code only.
  • This information is not forward to client as container ignores the information given in info attribute.
2. What is the syntax of info JSP attribute?

Syntax: <%@ page info="some text" %>

Example:
<%@ page info="Project started on 01-08-2014" %>

3. Can we retrieve the information given as string for info attribute?

Yes, getServletInfo() method returns.

14 Page directive Attributes and Examples

  1. import
  2. contentType
  3. errorPage, isErrorPage, exception
  4. pageEncoding
  5. buffer
  6. autoFlush
  7. info
  8. session
  9. isThreadSafe
  10. language
  11. extends
  12. isELIgnored

With all the 9 implicit objects, 4 implicit methods, 3 directives with their attributes and linking with JavaBeans you accept that writing server side code with JSP is very much easier than writing with Servlets. JSP occupies less code than Servlets and code productivity increases.

Some Programmers are assuming Ruby on Rails and Grails for Groovy (then, JSP container will change) also worth to get supported. This is only assumption and not sure.

Pass your comments and suggestions to improve the quality of this tutorial "info JSP page directive with Example".

Leave a Reply

Your email address will not be published. Required fields are marked *