Struts2.0 porlet
-----------------
Key: WW-3527
URL: https://issues.apache.org/jira/browse/WW-3527
Project: Struts 2
Issue Type: Bug
Components: Core Actions
Affects Versions: 2.0.14
Environment: Websphere Portal Server6.1.5, JSR168 API,
Reporter: Praveen Kumar Ralla
Fix For: 2.0.14
I am working on login page using struts2.0 portlet on wps 6.1.5. When I submit
the form I am getting an exception,
11/2/10 20:06:25:227 IST 0000002e ActionRespons E
com.ibm.ws.portletcontainer.core.impl.ActionResponseImpl setRenderParameter
EJPPC0161E: Cannot set RenderParameter after sendRedirect has been called
11/2/10 20:06:25:243 IST 0000002e ActionRespons E
com.ibm.ws.portletcontainer.core.impl.ActionResponseImpl setRenderParameter
EJPPC0161E: Cannot set RenderParameter after sendRedirect has been called
Here is my code..
Portlet Class
=============
public class LoginBasePortlet extends Jsr168Dispatcher{
static Logger log;
public LoggerService LoggerService;
public Factory Factory;
private Context ctx = null;
private Object home = null;
private PortletServiceHome portletServiceHome = null;
public AuthenticationPortletService loginService = null;
boolean resumeSession = true;
@Override
public void init() throws PortletException {
// TODO Auto-generated method stub
Factory = Factory.getInstance();
LoggerService = Factory.getLoggerServiceInstance();
LoggerService.getLogger();
log = Logger.getLogger(LoginBasePortlet.class);
loginService = (AuthenticationPortletService) getLoginService();
super.init();
}
@Override
protected void doView(RenderRequest renderRequest, RenderResponse
renderResponse)
throws PortletException, IOException {
log.debug("LoginBasePortlet :: Enter into doView() method");
super.doView(renderRequest, renderResponse);
// TODO Auto-generated method stub
}
@Override
public void processAction(ActionRequest actionRequest, ActionResponse
actionResponse)
throws PortletException, IOException {
log.debug("LoginBasePortlet :: Enter into processAction() method");
String userName = actionRequest.getParameter("userName");
String password = actionRequest.getParameter("password");
try{
PortletSession session = actionRequest.getPortletSession();
if(loginService != null){
loginService.doLogin(userName, password, resumeSession, actionRequest,
actionResponse);
// Exception occurs when the dologin method is called...
session.setAttribute("authFlag", true);
}else{
session.setAttribute("authFlag", false,
PortletSession.APPLICATION_SCOPE);
}
super.processAction(actionRequest, actionResponse);
// TODO Auto-generated method stub
}catch(Exception e){
}
}
private AuthenticationPortletService getLoginService(){
try {
ctx = new InitialContext();
home =
ctx.lookup("portletservice/com.ibm.wps.portletservice.authentication.AuthenticationPortletService");
if (home != null)
portletServiceHome = (PortletServiceHome) home;
if (portletServiceHome != null){
loginService = (AuthenticationPortletService)
portletServiceHome.getPortletService(AuthenticationPortletService.class);
}
} catch (NamingException ne) {
}catch(Exception psue){
}
return loginService;
}
}
Here is my struts Action Class
==============================
@Override
public String execute() throws Exception {
// TODO Auto-generated method stub
//Factory Factory = null;
try {
PortletSession session = portletRequest.getPortletSession();
authFlag = (Boolean) session.getAttribute("authFlag");
if (authFlag == true ){
resultType = "fwdTOHome";
}else{
resultType = "Login";
}
}catch(Exception e){
// authFlag = false;
}
return resultType;
}
Am I doing anything wrong
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.