concept JSP page in category java

appears as: JSP pages, JSP page, JSP pages, The JSP pages, The JSP page
Portlets in Action

This is an excerpt from Manning's book Portlets in Action.

Portlet content can be generated by writing directly to the PrintWriter object, as you did in the Hello World example in chapter 1, or by dispatching a request to a JSP, servlet, or HTML page. But if the markup fragment generated by the portlet is complex, it’s better to pass on the responsibility of content generation to a JSP page, using the PortletRequestDispatcher object.

Figure 3.1. The Book Catalog portlet makes use of the BookServlet to generate content and process actions. The BookServlet generates HTML markup using JSP pages, and it interacts with the database to obtain or store book information.
  • <defineObjects>—Used to make portlet objects available to the JSP page
  • The JSP page declares the portlet tag library using the taglib directive . The value of the uri attribute is http://java.sun.com/portlet_2_0 if you want to use the Portlet 2.0 tag library. If you’re using the Portlet 1.0 tag library, you should specify the value of uri as http://java.sun.com/portlet. The <defineObjects> tag in Portlet 2.0 introduced additional variables, such as portletSessionScope, portletSession, and so on, which makes it easy to develop portlets using JSP as the view technology.

    The <defineObjects> tag is used to introduce scripting variables in the JSP page.