Available implicit objects Liferay JSP page
Now, lets ebter the liferay context:
On a normal JSP page, some objects are implicitly available. In addition, we can get several others in Liferay
using the taglibs. But we don't know all. So, lets become a technical James Bond and investigate about it. :D
Lets see about normal JSP first:
These objects are created by the container automatically and the container makes them available to us.
Lets see about normal JSP first:
These objects are created by the container automatically and the container makes them available to us.
Since these objects are created automatically by the container and are accessed using standard variables;
and that is why, they are called implicit objects. They are parsed by the container. They are available only
within the jspService method and not in any declaration.
These are 9 objects.
1
2
3
4
5
6
7
8
9
| request (javax.servlet.ServletRequest) response (javax.servlet.ServletResponse) out (javax.servlet.jsp.JspWriter) pageContext (javax.servlet.jsp.PageContext) session (javax.servlet.http.HttpS) application (javax.servlet.ServletContext) config (javax.servlet.ServletConfig) page (java.lang.Object) exception (java.lang.Throwable)
|
The following statements will give 14 default objects :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
<portlet:defineObjects />
actionRequest (javax.portlet.ActionRequest)
actionResponse (javax.portlet.ActionResponse) eventRequest (javax.portlet.EventRequest) eventResponse, (javax.portlet.EventResponse) portletConfig, (javax.portlet.PortletConfig) portletName, (java.lang.String portletName ; portletPreferences, (javax.portlet.PortletPreferences) portletPreferencesValues, (java.util.Map) portletSession, (javax.portlet.PortletSession) portletSessionScope, (java.util.Map) renderRequest, (javax.portlet.RenderRequest) renderResponse, (javax.portlet.RenderResponse) resourceRequest, (javax.portlet.ResourceRequest) resourceResponse (javax.portlet.ResourceResponse)
And the following statements will give 18 default objects :
and the type of each object as follows :
These default objects can be acquired using pageContext which is an implicit object of JSP.
Use the following code for getting default objects
|
No comments:
Post a Comment