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/11/10 15:56:37 UTC

[jira] Updated: (WW-2862) s:form generates wrong action url - ".action" suffix is missing

     [ https://issues.apache.org/struts/browse/WW-2862?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Torsten Krah updated WW-2862:
-----------------------------

    Description: 
Hi.
I am using Struts2 in a portlet / servlet environment.
Using portlets s:form behaves well.
But if i use actions through the FilterDispatcher, the url generated is wrong:

It should look like:

<form action="abc.action">
...
</form>

but using <s:form action="acb" namespace="rules"> ... it generates:


<form action="abc">

Where

and this is a non functional form as there is no url names abc, but abc.action. The rules namespace is child of the root view namespace. (/view/rules/index.action is the url which generates the form and to which the post should go back).

Interesting notes about action config stuff:

Using the initial "request" when calling the url namespace is "/view/rules" and action="index" - getActionConfig in DefaultConfiguration XWork class does find an action config.
When the form is rendered the namespace only reads "rules" instead of "/view/rules" and i get this warning:

15:48:28,520 WARN  [org.apache.struts2.components.Form] No configuration found for the specified action: 'index' in namespace: 'rules'. Form action defaulting to 'action' attribute's literal value.

I am using it primarily for portlets and my default namespace is /view - this does work fine in s:form tags requested through portletDispachter - using the same with FilterDispatcher won't work, because the /view is missing.
This is inconsistent because it won't allow me to use a page from portlet and servlets.
Any ideas how to solve this? Is there a way to tell the FilterDispatcher he should "prepend" the "/view"?

  was:
Hi.
I am using Struts2 in a portlet / servlet environment.
Using portlets s:form behaves well.
But if i use actions through the FilterDispatcher, the url generated is wrong:

It should look like:

<form action="abc.action">
...
</form>

but using <s:form action="acb"> ... it generates:

<form action="abc">

and this is a non functional form as there is no url names abc, but abc.action.


> s:form generates wrong action url - ".action" suffix is missing
> ---------------------------------------------------------------
>
>                 Key: WW-2862
>                 URL: https://issues.apache.org/struts/browse/WW-2862
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Portlet, Plugin - Tags
>    Affects Versions: 2.0.11.2
>         Environment: Pluto 1.1.6, JDK 1.5, Tomcat 6.0.13
>            Reporter: Torsten Krah
>
> Hi.
> I am using Struts2 in a portlet / servlet environment.
> Using portlets s:form behaves well.
> But if i use actions through the FilterDispatcher, the url generated is wrong:
> It should look like:
> <form action="abc.action">
> ...
> </form>
> but using <s:form action="acb" namespace="rules"> ... it generates:
> <form action="abc">
> Where
> and this is a non functional form as there is no url names abc, but abc.action. The rules namespace is child of the root view namespace. (/view/rules/index.action is the url which generates the form and to which the post should go back).
> Interesting notes about action config stuff:
> Using the initial "request" when calling the url namespace is "/view/rules" and action="index" - getActionConfig in DefaultConfiguration XWork class does find an action config.
> When the form is rendered the namespace only reads "rules" instead of "/view/rules" and i get this warning:
> 15:48:28,520 WARN  [org.apache.struts2.components.Form] No configuration found for the specified action: 'index' in namespace: 'rules'. Form action defaulting to 'action' attribute's literal value.
> I am using it primarily for portlets and my default namespace is /view - this does work fine in s:form tags requested through portletDispachter - using the same with FilterDispatcher won't work, because the /view is missing.
> This is inconsistent because it won't allow me to use a page from portlet and servlets.
> Any ideas how to solve this? Is there a way to tell the FilterDispatcher he should "prepend" the "/view"?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.