Forums de discussion

Struts Redirections (Terms of Use)

thumbnail
Justen L Britain, modifié il y a 15 années.

Struts Redirections (Terms of Use)

Junior Member Publications: 38 Date d'inscription: 16/01/07 Publications récentes
Hello all,

I have been working with liferay for over a year now but this is the first time that I have had to use the Struts/Tiles portion of the system. I am implementing a system where after the users agrees to the terms of use they are redirected to a little page where I get them to update their screenName, change their password and select their locale. My problem is this, I have looked at the struts and tiles configuration files and believe I have added the correct information but the forwarding process isn't working properly I am ending up with a blank page. I will post my code below. This may be a more appropriate question for a struts forum, if so please inform me and I will post there. Thanks in advance for any information that you can provide me with.

struts-config.xml

<struts-config>
	<action-mappings>
		<action path="/portal/update_terms_of_use" type="com.ext.portal.action.UpdateTermsOfUseAction" />

		<action path="/portal/update_user_activation" type="com.ext.portal.action.UpdateAdditionalUserInfoAction" />			
		
		<action path="/portal/additional_user_info" forward="portal.additional_user_info" />	
	</action-mappings>
</struts-config>


tiles-defs.xml

<definition name="portal.additional_user_info" extends="portal">
	<put name="title" value="user-info" />
	<put name="content" value="/portal/update_activation_user.jsp" />
</definition>


UpdateTermsOfUseAction(edited in ext)

public ActionForward execute(
		ActionMapping mapping, ActionForm form, HttpServletRequest req,
		HttpServletResponse res)
	throws Exception {

	long userId = PortalUtil.getUserId(req);

	UserServiceUtil.updateAgreedToTermsOfUse(userId, true);

	return mapping.findForward("portal.additional_user_info");
}


UpdateAdditionalUserAction(my class)

public ActionForward execute(
		ActionMapping mapping, ActionForm form, HttpServletRequest req,
		HttpServletResponse res)
	throws Exception {
       
        ......
        //if there is an error
        return mapping.findForward("portal.additional_user_info");
        //if there are no errors
        return mapping.findForward(ActionConstants.COMMON_REFERER);
}    


update_activation_user.jsp

<fieldset> <legend>Create Login</legend> <input name="doAsUserId" type="hidden" value="<%= themeDisplay.getDoAsUserId() %>"> <input name="<%= WebKeys.REFERER %>" type="hidden" value="<%= themeDisplay.getPathMain() %> /portal/layout?doAsUserId=<%= themeDisplay.getDoAsUserId() %>"> </fieldset>


~Justen