[开发] 请教一个liferay路径问题
liushl2001
2007-05-22
我有个问题想请教,
在liferay的开发中,我遇到了这个问题 在struts-config.xml中我定义了转发路径如下: <action path="/noticelist/viewnotice" type="mtn.gfkd.site.action.Notice_viewcontextAction" > <forward name="success" path="/noticelist/index" redirect="true" /></action> 但是,在liferay中运行总是在第一个action响应到 return mapping.findForward("success")的时候就没有响应了,2个action独立访问都没有错误,请问是否是还要进行其他配置,liferay才能转发路径呢,我看liferay整个的源代码都没有这种例子,是它不支持这种方式吗? 如蒙答复,至为感谢。 liushl2001@163.com |
|
pikachu
2007-05-28
没试过,从tss http://www.theserverside.com/discussions/thread.tss?thread_id=37292 上查到的方法
This has since been fixed in CVS. As a workaround, you will need to have your forward name be the same as the new action-mapping that you'd like to redirect to. <action path="/portal/test_redirect" type="com.liferay.portal.action.TestRedirectAction"> <forward name="/c/portal/test" path="/c/portal/test" redirect="true" /> </action> Note how the forward name and the path are the same. Cheers, Brian Kim Liferay, LLC |
|
fb1984
2008-09-26
http://172.17.193.146:8080/user/olive/home?p_p_id=79&p_p_lifecycle=0&p_p_state=maximized&p_p_mode=view&_79_struts_action=%2Fenterprise_admin%2Fedit_user&_79_redirect=http%3A%2F%2F172.17.193.146%3A8080%2Fuser%2Folive%2Fhome%3Fp_p_id%3D79%26p_p_lifecycle%3D0%26p_p_state%3Dmaximized%26p_p_mode%3Dview%26_79_struts_action%3D%252Fenterprise_admin%252Fview%26_79_tabs1%3Dusers%26_79_advancedSearch%3Dfalse%26_79_andOperator%3Dtrue%26_79_active%3Dtrue%26_79_organizationId%3D0%26_79_roleId%3D0%26_79_userGroupId%3D0%26_79_cur%3D1&_79_screenName=
假设Structs-path 中含有Porlet的名称79 此名称与porlet-custom.xml文件中的<porlet-name>79</portlet-name>中的值相对应 对应的xml文件中存在的 <init-param> <name>view-action</name> <value>/open_id/view</value> </init-param> value值与struts-config.xml文件中的 <action path="/open_id/view" type="com.liferay.portlet.openid.action.ViewAction"> <forward name="portlet.open_id.view" path="portlet.open_id.view" /> </action> path值对应,对应的ation中的<forward name="portlet.open_id.view" 与tiles-def.xml文件中的 <definition name="portlet.open_id.view" extends="portlet.open_id"> <put name="portlet_content" value="/portlet/open_id/view.jsp" /> </definition> <definition name="portlet.open_id.view" 的值对应 最后定向到value="/portlet/open_id/view.jsp"显示view.jsp的页面 |