You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Michael P (JIRA)" <ji...@apache.org> on 2010/02/23 12:46:28 UTC
[jira] Issue Comment Edited: (WW-2525) default-action-ref not
working!
[ https://issues.apache.org/jira/browse/WW-2525?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12837199#action_12837199 ]
Michael P edited comment on WW-2525 at 2/23/10 11:46 AM:
---------------------------------------------------------
I can confirem this one is still active. Though maybe not a bug.
But the thing is, it will work if you type any url like this .../MyWebApp/xxx.action or .../MyWebApp/xxx.do. so if the .action or the .do is present the default action gets loaded. but not otherwise. struts does not map urls without the ending.
Workaround: create an empty file with the name of your default action (e.g. "home.action") at the place where the url would find it (e.g. "WebContent"). And in your web.xml:
<welcome-file-list>
<welcome-file>home.action</welcome-file>
</welcome-file-list>
was (Author: kw4nta):
I can confirem this one is still active.
But the thing is, it will work if you type any url like this .../MyWebApp/xxx.action or .../MyWebApp/xxx.do. so if the .action or the .do is present the default action gets loaded. but not otherwise. struts does not map urls without the ending.
> default-action-ref not working!
> -------------------------------
>
> Key: WW-2525
> URL: https://issues.apache.org/jira/browse/WW-2525
> Project: Struts 2
> Issue Type: Bug
> Affects Versions: 2.0.11
> Environment: RAD 7, Windows XP
> Reporter: Vijay
> Assignee: Don Brown
>
> It looks like default-action-ref feature is not working (even using struts blank war) ---
> web.xml
> <filter-mapping>
> <filter-name>struts2</filter-name>
> <url-pattern>/*</url-pattern>
> </filter-mapping>
> struts.xml
> <package name="example" namespace="/example" extends="struts-default">
> <default-action-ref name="HelloWorld" />
> <action name="HelloWorld" class="example.HelloWorld">
> <result>/example/HelloWorld.jsp</result>
> </action>
> The URL such as: http://localhost:9080/struts2-blank-2.0.11/example/
> throws 404. My understanding is the default path should bring up action referenced in default-action-ref.
> Thanks.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.