Fórum

When to use PortletServlet

thumbnail
Raghu N N, modificado 15 Anos atrás.

When to use PortletServlet

New Member Postagens: 14 Data de Entrada: 20/10/08 Postagens Recentes
hi all,
I'm novice to liferay, Recently i came across PortletServlet in ICEfaces+Seam+Liferay shocase example(web.xml). could you plz explain
1)When I need to use PortletServlet configuration in web.xml
2)As of now i know that ,portlet configuration in portlet.xml. but I want to understand what could be the difference between PortletServlet configuration in web.xml and portlet.xml
Fragment of web.xml from icefaces+seam+liferay showcase:

<servlet>
<servlet-name>components_table_sortableHeader</servlet-name>
<servlet-class>com.liferay.portal.kernel.servlet.PortletServlet</servlet-class>
<init-param>
<param-name>portlet-class</param-name>
<param-value>com.icesoft.faces.webapp.http.portlet.MainPortlet</param-value>
</init-param>
<load-on-startup>0</load-on-startup>
</servlet>

3)Here what is the purpose of MainPortlet class.

Please explain me this points. I think these points are little advanced but I need to understand all ...

thanks
raghu
thumbnail
Tobias Amon, modificado 15 Anos atrás.

RE: When to use PortletServlet

Liferay Master Postagens: 546 Data de Entrada: 08/08/07 Postagens Recentes
Hi,

the portlet.xml is for configuration of the portlet itself. ICEfaces and Seam were not designed to be portlets, they are web application frameworks. This is why you need to configure your web application with the web.xml file. But as you run it as a portlet you need to have a bridge between the normal web application (servlets) and the portlets. This is why you have the portletservlet...

So to make it short: If you have ICEfaces webapplications which shall run as portlets, you need both the web.xml and the portlet.xml

kind regards
Tobias
thumbnail
Raghu N N, modificado 15 Anos atrás.

RE: When to use PortletServlet

New Member Postagens: 14 Data de Entrada: 20/10/08 Postagens Recentes
Hi Tobias

thanks for your reply..

I'm frustratingly working on seam and liferay integration. But I need to figure it out.
I'm able to run Icefaces showcase example in liferay/glassfish. Icefaces have it's own bridge for portlets,
this may not be useful for seam. Yes , Seam is not developed for portlets it's web-app framework.

Is there any way to achieve or develop or use existing framework to integrate seam and liferay ?
( I dont think existing liferay-seam1 liferay official pportlet plugin will help, because it's for seam1) ..

thanks
raghu
Kiran Kasturi, modificado 13 Anos atrás.

PortletServlet issue

New Member Mensagem: 1 Data de Entrada: 20/10/10 Postagens Recentes
Hi,

I have written a servlet which extends PortletServlet, I have configured this servlet to be called for every portlet in my application.In one of the jsps when i am submitting the form i am unable to get the hidden attributes in my servlet.Below is my servlet

package com.fa.web.inter.view;



import java.io.IOException;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Map;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;


import com.liferay.portal.kernel.servlet.PortletServlet;


/** This Servlet reads the Request Params and puts in httpSession.
* @author 128361
*
*/
public class FAPortletCommandServlet extends PortletServlet{

/**
* This is a serialVersionUID
* serialVersionUID long
*/
private static final long serialVersionUID = 1L;
/**
* request param
*/
private static final String REQUEST_PARAM = "requestParam";
/**
* Variable to check if this is an ajax call
*/
private static final String AJAX_CALL = "ajaxCall";
/**
* Attribute appended to the URL
*/
private static final String RAW = "RAW";
/**
* True
*/
private static final String TRUE="true";

public void renderValues(HttpServletRequest request){
Enumeration reqParamNames= request.getSession().getAttributeNames();
Object nextElement = null;
String nextReqParam = null;
if(reqParamNames != null){
if(reqParamNames.hasMoreElements()){
nextElement = reqParamNames.nextElement();
if(nextElement != null && nextElement instanceof String){
nextReqParam = (String)nextElement;
System.out.println("renderValues Request Parameter: "+nextReqParam +" and value is: "+request.getParameter(nextReqParam));
}else{
System.out.println("renderValues Request Parameter is not of type String: "+nextElement);
}
}else{
System.out.println(" renderValues End of ReqParam Names: ");
}
}
}

public void service(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
System.out.println("Request class"+request.getClass().getName());
renderValues(request);
super.service(request, response);
return;
}



}


Thanks,
Kiran