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/29 14:50:45 UTC

[jira] Created: (WW-2969) Convention Plugin breaks DWR integration

Convention Plugin breaks DWR integration
----------------------------------------

                 Key: WW-2969
                 URL: https://issues.apache.org/struts/browse/WW-2969
             Project: Struts 2
          Issue Type: Bug
          Components: Plugin - Convention
    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.


[jira] Commented: (WW-2969) Convention Plugin breaks DWR integration

Posted by "Musachy Barroso (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2969?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=45533#action_45533 ] 

Musachy Barroso commented on WW-2969:
-------------------------------------

I didnt "upgrade" it to use convention, I just added it a dependency on convention and set

 <constant name="struts.convention.package.locators.basePackage" value="org.apache.struts2.showcase.convention"/>

so it didn't start matching weird stuff. I wanted to see if the unknown handler was doing something weird.

> Convention Plugin breaks DWR integration
> ----------------------------------------
>
>                 Key: WW-2969
>                 URL: https://issues.apache.org/struts/browse/WW-2969
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Convention
>    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.


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

Posted by "Musachy Barroso (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/WW-2969?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Musachy Barroso resolved WW-2969.
---------------------------------

    Resolution: Won't Fix

Thanks for the research Brian. I don't know of any way to make Struts ignore certain requests.

> 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.


[jira] Commented: (WW-2969) Convention Plugin breaks DWR integration

Posted by "Brian Curnow (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2969?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=45527#action_45527 ] 

Brian Curnow commented on WW-2969:
----------------------------------

With DWR correctly configured, you should get a list of the classes that are exposed via DWR. Basically the /dwr URL should be handled by the dwr-invoker servlet.

> Convention Plugin breaks DWR integration
> ----------------------------------------
>
>                 Key: WW-2969
>                 URL: https://issues.apache.org/struts/browse/WW-2969
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Convention
>    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.


[jira] Commented: (WW-2969) Convention Plugin breaks DWR integration

Posted by "Musachy Barroso (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2969?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=45526#action_45526 ] 

Musachy Barroso commented on WW-2969:
-------------------------------------

I am trying to troubleshoot this in showcase, when I hit "http://localhost:8080/struts2-showcase/dwr" I get the showcase home page, not an error, what was I supposed to get there? I don't know DWR so I am not sure what the expected result is.

> Convention Plugin breaks DWR integration
> ----------------------------------------
>
>                 Key: WW-2969
>                 URL: https://issues.apache.org/struts/browse/WW-2969
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Convention
>    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.


[jira] Commented: (WW-2969) Convention Plugin breaks DWR integration

Posted by "Brian Curnow (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2969?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=45525#action_45525 ] 

Brian Curnow commented on WW-2969:
----------------------------------

Yes, I've also set it to false, same problem.

> Convention Plugin breaks DWR integration
> ----------------------------------------
>
>                 Key: WW-2969
>                 URL: https://issues.apache.org/struts/browse/WW-2969
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Convention
>    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.


[jira] Commented: (WW-2969) Convention Plugin breaks DWR integration

Posted by "Musachy Barroso (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2969?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=45530#action_45530 ] 

Musachy Barroso commented on WW-2969:
-------------------------------------

yup those work, with and without convention

> Convention Plugin breaks DWR integration
> ----------------------------------------
>
>                 Key: WW-2969
>                 URL: https://issues.apache.org/struts/browse/WW-2969
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Convention
>    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.


[jira] Commented: (WW-2969) Convention Plugin breaks DWR integration

Posted by "Brian Curnow (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2969?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=45532#action_45532 ] 

Brian Curnow commented on WW-2969:
----------------------------------

I see that the first one (http://localhost:8080/struts2-showcase-2.1.6/dwr/index.html) works fine with showcase, but the second one (http://localhost:8080/struts2-showcase-2.1.6/dwr/test/validator ) I get a Struts Problem Report: "No class by name: showcase.jsp".

If you upgrade showcase to use DWR 2.0.3 (just replace the dwr JAR in WEB-INF/lib) than you get a different problem: "Script names may only contain Java Identifiers".

Also, the showcase application doesn't use the convention plugin, it uses codebehind. Did you actually upgrade the showcase application to use convention?

> Convention Plugin breaks DWR integration
> ----------------------------------------
>
>                 Key: WW-2969
>                 URL: https://issues.apache.org/struts/browse/WW-2969
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Convention
>    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.


[jira] Commented: (WW-2969) Convention Plugin breaks DWR integration

Posted by "Musachy Barroso (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2969?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=45528#action_45528 ] 

Musachy Barroso commented on WW-2969:
-------------------------------------

I dont get that page even without convention in showcase, could it me miss configured? It looks right tho

> Convention Plugin breaks DWR integration
> ----------------------------------------
>
>                 Key: WW-2969
>                 URL: https://issues.apache.org/struts/browse/WW-2969
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Convention
>    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.


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

Posted by "Brian Curnow (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2969?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=45538#action_45538 ] 

Brian Curnow commented on WW-2969:
----------------------------------

In an attempt to build to very small applications that illustrate the problem I was seeing I found that the Convention plugin isn't required to get this to not work. It looks like since the main DWR page (http://localhost:8080/dwr/index.html) has an extension, that Struts is smart enough to just delegate to the container. However, when the URL doesn't contain an extension (http://localhost:8080/dwr/test/validator) there isn't enough information there to tell Struts that it shouldn't be handling that URL.

I've worked around this problem by building a filter that you can map to URLs you want the container to handle:

{code}
import java.io.IOException;

import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;

import org.apache.struts2.RequestUtils;
import org.apache.struts2.dispatcher.ServletDispatcherResult;
import org.apache.struts2.dispatcher.mapper.ActionMapping;

/**
 * Ensures that the request is handled correctly by the servlet container instead of by Struts
 */
public class Struts2SkipFilter implements Filter {

	public void destroy() {
		// do nothing
	}

	public void doFilter(ServletRequest servletRequest, ServletResponse servletReponse, FilterChain filterChain)
			throws IOException, ServletException {
		String requestPath = RequestUtils.getServletPath((HttpServletRequest) servletRequest);

		// Create a new ActionMapping that points to the request path and indicates that the ServletDispatcher should handle it
		ActionMapping actionMapping = new ActionMapping(new ServletDispatcherResult(requestPath));

		// Set the name to "" to ensure we skip some of the find requests for JSPs
		actionMapping.setName("");

		// Put the action mapping in the request where the PrepareFilter will find it
		servletRequest.setAttribute("struts.actionMapping", actionMapping);

		filterChain.doFilter(servletRequest, servletReponse);
	}

	public void init(FilterConfig filterConfig) throws ServletException {
		// do nothing
	}

}
{code}

By mapping this filter to the /dwr/* pattern, I seem to get what I want. All the functionality of Struts2 and all the functionality of DWR. While the core DWR functionality (remoting) was working fine before this filter, the handle information pages were not. This isn't a big deal except I was also using the DWR namespace in my Spring application context to map the classes. Without those information page I didn't have a good way to view that information.

Is there a better way to get the Struts2 filters to ignore requests? If not, then I think this issue can be closed, it's resolved from my end.

> 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.


[jira] Commented: (WW-2969) Convention Plugin breaks DWR integration

Posted by "Brian Curnow (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2969?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=45529#action_45529 ] 

Brian Curnow commented on WW-2969:
----------------------------------

Try one of the following:

http://localhost:8080/struts2-showcase-2.1.6/dwr/index.html

http://localhost:8080/struts2-showcase-2.1.6/dwr/test/validator

Those should work just fine with the 2.1.6 version of showcase.

> Convention Plugin breaks DWR integration
> ----------------------------------------
>
>                 Key: WW-2969
>                 URL: https://issues.apache.org/struts/browse/WW-2969
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Convention
>    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.


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

Posted by "Brian Curnow (JIRA)" <ji...@apache.org>.
     [ 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.


[jira] Commented: (WW-2969) Convention Plugin breaks DWR integration

Posted by "Musachy Barroso (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2969?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=45531#action_45531 ] 

Musachy Barroso commented on WW-2969:
-------------------------------------

The only thing that the convention plugin does at request time, happens in org.apache.struts2.convention.ConventionUnknownHandler, the rest is just configuration loading on start up, you might want to put a breakpoint in handleUnknownAction, and see what is going on.

> Convention Plugin breaks DWR integration
> ----------------------------------------
>
>                 Key: WW-2969
>                 URL: https://issues.apache.org/struts/browse/WW-2969
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Convention
>    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.


[jira] Commented: (WW-2969) Convention Plugin breaks DWR integration

Posted by "Musachy Barroso (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2969?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=45524#action_45524 ] 

Musachy Barroso commented on WW-2969:
-------------------------------------

Is struts.convention.redirect.to.slash set to true?

> Convention Plugin breaks DWR integration
> ----------------------------------------
>
>                 Key: WW-2969
>                 URL: https://issues.apache.org/struts/browse/WW-2969
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Convention
>    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.