Liferay Portal Doubts

R

rajesh.shiggaon

Hi Guys:-

Why the struts controller component configured in the struts-config.xml
is not being called?? I searched a lot finally i found that in the
PortletActionServlet they are instantating a PortletRequestProcessor
and storing it in the context. Why the hell they are doing this ?? I am
placing a the class code below



* Copyright © 2000-2004 Liferay, LLC. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining
a copy
* of this software and associated documentation files (the "Software"),
to deal
* in the Software without restriction, including without limitation the
rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be
included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE
* SOFTWARE.
*/

package com.liferay.portal.struts;

import com.liferay.portal.util.WebKeys;

import javax.servlet.ServletContext;
import javax.servlet.ServletException;

import org.apache.struts.Globals;
import org.apache.struts.action.ActionServlet;
import org.apache.struts.config.ModuleConfig;
import org.apache.struts.config.ControllerConfig;

/**
* <a href="PortletActionServlet.java.html"><b><i>View
Source</i></b></a>
*
* @author Brian Wing Shun Chan
* @version $Revision: 1.3 $
*
*/
public class PortletActionServlet extends ActionServlet {

public void init() throws ServletException {
super.init();

ServletContext ctx = getServletContext();

ModuleConfig moduleConfig =
(ModuleConfig)ctx.getAttribute(Globals.MODULE_KEY);

ControllerConfig ctrlConfig=moduleConfig.getControllerConfig();
System.out.println("class PortletActionServlet method init method
ctrlConfig.getProcessorClass()"+ ctrlConfig.getProcessorClass() + "
toString " + ctrlConfig.toString());
PortletRequestProcessor portletReqProcessor =
new PortletRequestProcessor(this, moduleConfig);

ctx.setAttribute(WebKeys.PORTLET_STRUTS_PROCESSOR,
portletReqProcessor);

}
public void process(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response){

try{
super.process(request,response);
}catch(Exception e){System.out.println("Error occured in
PortleActionServlet"); }


}


}


Please help me out .... !!!!


Thanks
Rajesh S.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top