You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Torsten Krah (JIRA)" <ji...@apache.org> on 2008/10/21 17:00:37 UTC
[jira] Updated: (WW-2846) s:url Tag with parameters does not work
or results in ClassCastException
[ https://issues.apache.org/struts/browse/WW-2846?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Torsten Krah updated WW-2846:
-----------------------------
Description:
Using Example 1 from s:url Tag
http://struts.apache.org/2.0.11.2/struts2-core/apidocs/org/apache/struts2/components/URL.html
does not work in an PortletEnvironment. Only the url is generated.
Debugging to PortletUrlHelper the params map is empty.
<s:url value="editGadget.action">
<s:param name="id" value="%{selected}" />
</s:url>
does not work. The params map is empty
<s:url value="editGadget.action">
<s:param name="id" value="abc" />
</s:url>
does not work. The params map is empty.
<s:url value="editGadget.action">
<s:param name="id" value="40" />
</s:url>
does not work. The param is in the Map, but its not a String, its an Integer - which results in a ClassCastException at:
String key = (String)it.next();
String val = (String)params.get(key);
Portlet Spec mentions to use Servlet for resource streaming and other things you can't do with portlets.
I need to generate servlet URLs containing parameters - but it seems i can't create them with struts.
Using "includeParams=ALL" (which you may use to get extraparams included), does result in
[Ljava.lang.String; cannot be cast to java.lang.String
because PortletUrlHelper gots a method called: ensureParamsAreStringArrays which is called when constructing the surrounding form ...
which does convert the entire map to hold string arrays - but than buildResourceUrl must fail everytime.
was:
Using Example 1 from s:url Tag
http://struts.apache.org/2.0.11.2/struts2-core/apidocs/org/apache/struts2/components/URL.html
does not work in an PortletEnvironment. Only the url is generated.
Debugging to PortletUrlHelper the params map is empty.
<s:url value="editGadget.action">
<s:param name="id" value="%{selected}" />
</s:url>
does not work. The params map is empty
<s:url value="editGadget.action">
<s:param name="id" value="abc" />
</s:url>
does not work. The params map is empty.
<s:url value="editGadget.action">
<s:param name="id" value="40" />
</s:url>
does not work. The param is in the Map, but its not a String, its an Integer - which results in a ClassCastException at:
String key = (String)it.next();
String val = (String)params.get(key);
Portlet Spec mentions to use Servlet for resource streaming and other things you can't do with portlets.
I need to generate servlet URLs containing parameters - but it seems i can't create them with struts.
> s:url Tag with parameters does not work or results in ClassCastException
> ------------------------------------------------------------------------
>
> Key: WW-2846
> URL: https://issues.apache.org/struts/browse/WW-2846
> Project: Struts 2
> Issue Type: Bug
> Components: Plugin - Portlet, Plugin - Tags
> Affects Versions: 2.0.11.2
> Environment: Pluto 1.1.6, Java5
> Reporter: Torsten Krah
>
> Using Example 1 from s:url Tag
> http://struts.apache.org/2.0.11.2/struts2-core/apidocs/org/apache/struts2/components/URL.html
> does not work in an PortletEnvironment. Only the url is generated.
> Debugging to PortletUrlHelper the params map is empty.
> <s:url value="editGadget.action">
> <s:param name="id" value="%{selected}" />
> </s:url>
> does not work. The params map is empty
> <s:url value="editGadget.action">
> <s:param name="id" value="abc" />
> </s:url>
> does not work. The params map is empty.
> <s:url value="editGadget.action">
> <s:param name="id" value="40" />
> </s:url>
> does not work. The param is in the Map, but its not a String, its an Integer - which results in a ClassCastException at:
> String key = (String)it.next();
> String val = (String)params.get(key);
> Portlet Spec mentions to use Servlet for resource streaming and other things you can't do with portlets.
> I need to generate servlet URLs containing parameters - but it seems i can't create them with struts.
> Using "includeParams=ALL" (which you may use to get extraparams included), does result in
> [Ljava.lang.String; cannot be cast to java.lang.String
> because PortletUrlHelper gots a method called: ensureParamsAreStringArrays which is called when constructing the surrounding form ...
> which does convert the entire map to hold string arrays - but than buildResourceUrl must fail everytime.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.