2012-04-08 39 views
1
I am using Liferay 6 . 

我创建了一个页面,并添加6周的portlet它和内部配置portal-ext.properties文件 auth.forward.by.last.path =真 default.landing.page.path = /用户/测试/家如何提交有效的用户请求到Liferay默认着陆页

用我所有的6个门户这个私有页面仅显示当我使用Liferay的登录的Portlet(Liferay的默认登录页面)

同样,我有我的自定义Portlet由struts2组成,显示在输入http:loca lhost:8086如下图所示

enter image description here

<s:form action="helloForm" method="POST" theme="simple"> 
    Enter Your Name:<s:textfield name="namer" /> 
    Enter Your Name:<s:textfield name="passer" /> 
    <s:submit/> 
</s:form> 

目前,当用户点击提交Struts2的Action类recivies的是,如图

public String execute() throws Exception { 
    HttpServletRequest request = ServletActionContext.getRequest(); 
    String name = ParamUtil.getString(request, "namer"); 
    // does Database check and decides the return page 
    return ActionSupport.SUCCESS;   
} 

现在,我的要求是,如果他是一个有效的用户,我想将他/她重定向到配置的登陆页面

请告诉我怎么做?

回答

1
HttpServletResponse response = ServletActionContext.getResponse(); 
String targetUrl = "/user/test/home"; 
response.sendRedirect(targetUrl); 
+0

非常感谢,这是非常非常有用的。 – Pawan 2012-04-09 07:17:40