Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Sujeet Rai
null is not a valid include in Generic portlet
October 25, 2012 9:52 PM
Answer

Sujeet Rai

Rank: New Member

Posts: 9

Join Date: October 21, 2012

Recent Posts

null is not a valid include in Generic portlet..Can u plz help me?
Priyanka Dhingra
RE: null is not a valid include in Generic portlet
October 25, 2012 10:02 PM
Answer

Priyanka Dhingra

Rank: Liferay Master

Posts: 501

Join Date: December 19, 2011

Recent Posts

Please give the stacktrace here.
and something on what you did in the code.
Jitendra Rajput
RE: null is not a valid include in Generic portlet
October 25, 2012 11:00 PM
Answer

Jitendra Rajput

Rank: Liferay Master

Posts: 858

Join Date: January 7, 2011

Recent Posts

It means you are passing parameter value as null in include(viewJSp , request , response) method.
Sujeet Rai
RE: null is not a valid include in Generic portlet
October 25, 2012 11:34 PM
Answer

Sujeet Rai

Rank: New Member

Posts: 9

Join Date: October 21, 2012

Recent Posts

I am creating portlet using Generic portlet class. Thats it.I am not written any code. Just creating the portlet using Generic portlet class and deploy it in the server.

This is the error am getting in the console


ERROR [http-bio-8080-exec-12][ThreadPortlet:49] null is not a valid include
Jitendra Rajput
RE: null is not a valid include in Generic portlet
October 26, 2012 12:06 AM
Answer

Jitendra Rajput

Rank: Liferay Master

Posts: 858

Join Date: January 7, 2011

Recent Posts

Post your portlet class and portlet.xml
parikshit sharma
RE: null is not a valid include in Generic portlet
October 26, 2012 12:47 AM
Answer

parikshit sharma

Rank: Junior Member

Posts: 48

Join Date: October 18, 2012

Recent Posts

Sujeet,

You are using genericPortlet if error raised just after deployment (i.e. when init() method is called), then something is missing in init method ,it should always have code super.init(config) and if the error raised at the time of view then ,probably your are passing null value as the jsp path ,below is the code i have used and it's working fine ,may be it's helpful .

 1
 2public class PortletRenderer extends GenericPortlet {
 3
 4public void doView(RenderRequest request, RenderResponse response)
 5        throws PortletException, IOException {
 6    String viewTemplate =     getInitParameter("view-template");;
 7    PortletContext portletContext = getPortletContext();
 8
 9    PortletRequestDispatcher portletRequestDispatcher = portletContext.getRequestDispatcher(viewTemplate);
10    portletRequestDispatcher.include(request, response);
11    //super.doView(request, response);
12}
13}