You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Brian Curnow (JIRA)" <ji...@apache.org> on 2009/01/30 13:26:45 UTC

[jira] Updated: (WW-2969) DWR class information pages don't work with Struts2

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

Brian Curnow updated WW-2969:
-----------------------------

    Component/s:     (was: Plugin - Convention)
        Summary: DWR class information pages don't work with Struts2  (was: Convention Plugin breaks DWR integration)

I'm updating the component and the summary to reflect the fact that this isn't a Convention plugin issue, it's a more general Struts "feature"

> DWR class information pages don't work with Struts2
> ---------------------------------------------------
>
>                 Key: WW-2969
>                 URL: https://issues.apache.org/struts/browse/WW-2969
>             Project: Struts 2
>          Issue Type: Bug
>    Affects Versions: 2.1.6
>         Environment: Jetty 6.1.14 on Windows XP Pro
> Struts2 2.1.6 with Convention plugin
> DWR 2.0.3
>            Reporter: Brian Curnow
>
> This may not be an actual bug and be "broken" this way be design. In reading through the documentation (http://struts.apache.org/2.1.6/docs/webxml.html) it's recommended that you map the Struts FilterDispatcher/StrutsPrepareAndExecuteFilter to the URL pattern "/*". This seems to work fine with what I'll call traditional Struts2 (i.e. no Convention plugin) and also with the Convention plugin.
> I'm attempting to use DWR 2.0 and their documentation has you map the dwr-invoker (I'm using the Spring version: org.directwebremoting.spring.DwrSpringServlet) to the URL pattern "/dwr/*" (http://directwebremoting.org/dwr/server/servlet). This works fine in traditional Struts2 but breaks when using the Convention plugin.
> What I get  when I attempt to hit http://localhost:8080/dwr is an error: "There is no Action mapped for namespace / and action name dwr." I can work around that error by using http://localhost:8080/dwr/index.html however, when clicking on a link on the DWR page (to see information about one of my exposed classes) I get a similar error: "There is no Action mapped for namespace /dwr/test and action name MessageBean."
> I believe this is caused because the Convention plugin treats URLs it can't resolve as errors instead of falling back on the web container to handle them. This doesn't seem to be an issue for URLs which actually map back to files, for example, http://localhost:8080/styles/menu.css works just fine and returns the menu.css file in my <web app root>/styles directory. Like I said earlier, this may have been by design.
> I've worked around this two ways:
> 1. Resetting struts.action.extension to be simply "action", since none of the DWR URLs using .action, this is working but now I have that darn .action in my URLs again
> 2. Adding a package-info.java to my base Action package and setting a namespace (@org.apache.struts2.convention.annotation.Namespace(value="/action")) and then changing the filter mapping in web.xml to only look for /action/* (and moving the results files as well)
> Neither of those solutions is, in my opinion, very attractive and it seems that if traditional struts2 can support the DWR URLs that the Convention plugin should be able to support them too.
> Is this an actual bug and can it be fixed or is there another workaround?

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