Total Pageviews

Friday, September 30, 2011

Available implicit objects Liferay JSP page

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. 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.
Now, lets ebter the liferay context:

The following statements  will give 14 default objects :
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.

So, here are the objects that I found. Hope this will help.

Wednesday, September 21, 2011

Extracting HttpServletRequest object from RenderRequest object

In daily coding scenario, we use some minor problem that keeps you stuck on something else for long time. The thing I'm writing today is one amongst them.
This is how we can extract the object of HttpServletRequest form RendeRequest object.
This will work for you in when simple getParamater() method doesn't respond well.
Surely, it'll help you someday.