Fórumok
The struts path X does not belong to portlet Y.
François LE QUEMENER, módosítva 14 év-val korábban
The struts path X does not belong to portlet Y.
Junior Member Bejegyzések: 48 Csatlakozás dátuma: 2009.09.18. Legújabb bejegyzések
Hi,
Im trying to do a portlet in EXT, which will launch a search. Basically, it's just a form that sends the data to /search/search action.
It works great, except when I'm logged in. When it's the case (logged as user or power user) , I have this message :
The struts path ext does not belong to portlet EXT_8. Check the definition in liferay-portlet.xml
I also have this message instead of the portlet :
You do not have the roles required to access this portlet.
It seems that the guest user has more rights than the others !
How is it possible, and how do I fix it ?
Here is my portlet code :
Im trying to do a portlet in EXT, which will launch a search. Basically, it's just a form that sends the data to /search/search action.
It works great, except when I'm logged in. When it's the case (logged as user or power user) , I have this message :
The struts path ext does not belong to portlet EXT_8. Check the definition in liferay-portlet.xml
I also have this message instead of the portlet :
You do not have the roles required to access this portlet.
It seems that the guest user has more rights than the others !
How is it possible, and how do I fix it ?
Here is my portlet code :
<%
String namespace = "_" + PortletKeys.SEARCH + "_";
long groupId = ParamUtil.getLong(request, "groupId");
Group group = layout.getGroup();
String defaultKeywords = LanguageUtil.get(pageContext, "search") + "...";
String unicodeDefaultKeywords = UnicodeFormatter.toString(defaultKeywords);
String keywords = ParamUtil.getString(request, namespace + "keywords", defaultKeywords);
PortletURL portletURL = new PortletURLImpl(request, PortletKeys.SEARCH, 18805, PortletRequest.RENDER_PHASE);
portletURL.setWindowState(WindowState.MAXIMIZED);
portletURL.setPortletMode(PortletMode.VIEW);
portletURL.setParameter("struts_action", "/search/search");
%>
<div class="search-form">
<h1><liferay-ui:message key="search.rechercher" /></h1>
<div class="content">
<form action="<%= portletURL.toString() %>" method="post" name="<%= namespace %>fm" onSubmit="submitForm(this); return false;">
<input name="<%= namespace %>keywords" size="30" type="text" value="<%= HtmlUtil.escape(keywords) %>" onBlur="if (this.value == '') { this.value = '<%= unicodeDefaultKeywords %>'; }" onFocus="if (this.value == '<%= unicodeDefaultKeywords %>') { this.value = ''; }">
<input type="hidden" name="<%= namespace %>groupId" value="0">
<input align="absmiddle" border="0" src="<%= themeDisplay.getPathThemeImages() %>/icons/icon_puce.png" title="<liferay-ui:message key=" search">" type="image" />
</form>
</div>
</div>
Juan Fernández, módosítva 14 év-val korábban
RE: The struts path X does not belong to portlet Y.
Liferay Legend Bejegyzések: 1261 Csatlakozás dátuma: 2008.10.02. Legújabb bejegyzések
Hi!
This error happens when you use a struts path of a portlet that is not yours. I mean, in your portlet, you have to use your own paths.
If your new portlet is called for example "my_portlet" you have to write in your file this:
And then, in struts, call the class you want to be executed
I hope you understand
Regards
Juan Fernández
This error happens when you use a struts path of a portlet that is not yours. I mean, in your portlet, you have to use your own paths.
If your new portlet is called for example "my_portlet" you have to write in your file this:
portletURL.setParameter("struts_action", "/my_portlet/search");
And then, in struts, call the class you want to be executed
I hope you understand
Regards
Juan Fernández
François LE QUEMENER, módosítva 14 év-val korábban
RE: The struts path X does not belong to portlet Y.
Junior Member Bejegyzések: 48 Csatlakozás dátuma: 2009.09.18. Legújabb bejegyzések
OK that's one point I understood. Howerver, the problem is still there.
I insist on the fact that works when I'm guest, and not when I'm logged in (that's why I doubt about a wrong struts configuration)
I insist on the fact that works when I'm guest, and not when I'm logged in (that's why I doubt about a wrong struts configuration)
Juan Fernández, módosítva 14 év-val korábban
RE: The struts path X does not belong to portlet Y.
Liferay Legend Bejegyzések: 1261 Csatlakozás dátuma: 2008.10.02. Legújabb bejegyzésekFrançois LE QUEMENER:
I insist on the fact that works when I'm guest, and not when I'm logged in (that's why I doubt about a wrong struts configuration)
Ok:
check these properties in portlet-ext.xml:
<security-role-ref>
<role-name>administrator</role-name>
</security-role-ref>
<security-role-ref>
<role-name>guest</role-name>
</security-role-ref>
<security-role-ref>
<role-name>power-user</role-name>
</security-role-ref>
<security-role-ref>
<role-name>user</role-name>
</security-role-ref>
I think it may have something to do with that
Regards
Juan Fernández
François LE QUEMENER, módosítva 14 év-val korábban
RE: The struts path X does not belong to portlet Y.
Junior Member Bejegyzések: 48 Csatlakozás dátuma: 2009.09.18. Legújabb bejegyzések
That's what I guessed first, but I already had these lines.
Here is my portlet-ext.xml :
Here is my portlet-ext.xml :
<!-- ARDI Search -->
<portlet>
<portlet-name>EXT_8</portlet-name>
<display-name>ARDI Search</display-name>
<portlet-class>com.liferay.portlet.StrutsPortlet</portlet-class>
<init-param>
<name>view-action</name>
<value>/ext/search</value>
</init-param>
<expiration-cache>0</expiration-cache>
<supports>
<mime-type>text/html</mime-type>
</supports>
<resource-bundle>com.liferay.portlet.StrutsResourceBundle</resource-bundle>
<security-role-ref>
<role-name>administrator</role-name>
</security-role-ref>
<security-role-ref>
<role-name>guest</role-name>
</security-role-ref>
<security-role-ref>
<role-name>power-user</role-name>
</security-role-ref>
<security-role-ref>
<role-name>user</role-name>
</security-role-ref>
</portlet>
William B, módosítva 13 év-val korábban
RE: The struts path X does not belong to portlet Y.
New Member Bejegyzések: 13 Csatlakozás dátuma: 2010.07.05. Legújabb bejegyzések
I'm having the EXACT same problem...
Anyone care to help?
Anyone care to help?
Andrés Cerezo, módosítva 13 év-val korábban
RE: The struts path X does not belong to portlet Y.
Junior Member Bejegyzések: 92 Csatlakozás dátuma: 2010.11.11. Legújabb bejegyzések
Me too, anyone jnows the solution?
Thanks.
Thanks.
Seyed Mohammad Hossein Jamali, módosítva 10 év-val korábban
RE: The struts path X does not belong to portlet Y.
Junior Member Bejegyzések: 77 Csatlakozás dátuma: 2009.12.13. Legújabb bejegyzések
Is there any solution? I have the same problem.