You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Wes Wannemacher (JIRA)" <ji...@apache.org> on 2008/04/21 05:31:05 UTC

[jira] Created: (WW-2607) Default Mappings are broken in the codebehind plugin

Default Mappings are broken in the codebehind plugin
----------------------------------------------------

                 Key: WW-2607
                 URL: https://issues.apache.org/struts/browse/WW-2607
             Project: Struts 2
          Issue Type: Bug
          Components: Plugin - CodeBehind
    Affects Versions: 2.1.x
            Reporter: Wes Wannemacher
         Attachments: bar.zip

When using the codebehind plugin, developers should be able to drop a JSP, freemarker or velocity template into their web-app and codebehind should map it to ActionSupport automagically. Right now, the app server gives an error that an interceptor class cannot be found in default-stack. Attached is a simple app to demonstrate. To reproduce, unzip the app, run mvn jetty:run then try to hit http://localhost:8080/bar/index.action .

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


[jira] Commented: (WW-2607) Default Mappings are broken in the codebehind plugin

Posted by "Jeromy Evans (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2607?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43704#action_43704 ] 

Jeromy Evans commented on WW-2607:
----------------------------------

Confirmed.

2.1.0 NOT PRESENT (works as expected)
2.1.1 CONFIRMED bug present


> Default Mappings are broken in the codebehind plugin
> ----------------------------------------------------
>
>                 Key: WW-2607
>                 URL: https://issues.apache.org/struts/browse/WW-2607
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - CodeBehind
>    Affects Versions: 2.1.x
>            Reporter: Wes Wannemacher
>         Attachments: bar.zip
>
>
> When using the codebehind plugin, developers should be able to drop a JSP, freemarker or velocity template into their web-app and codebehind should map it to ActionSupport automagically. Right now, the app server gives an error that an interceptor class cannot be found in default-stack. Attached is a simple app to demonstrate. To reproduce, unzip the app, run mvn jetty:run then try to hit http://localhost:8080/bar/index.action .

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


[jira] Resolved: (WW-2607) Default Mappings are broken in the codebehind plugin

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

Jeromy Evans resolved WW-2607.
------------------------------

       Resolution: Fixed
    Fix Version/s: 2.1.2
         Assignee: Jeromy Evans

The exact problem was that PackageConfig.getInterceptorConfig(name)  only returns the interceptors in the current package, not the package hierarchy.
Codebehind's unknown action handler passed the packageConfig to the InterceptorBuilder which failed to locate the defaultStack.

The patch worked because it substituted the PackageConfig.builder for the PackageConfig.  The builder's implementation of getInterceptorConfig(name) recurses the package hierarchy.  Although this was the right behaviour, I didn't think it was an appropriate use of the builder.

Instead I created an anonymous InterceptorLocator within the CodebehindUnknownHandler that recurses the package hierarchy.

Created a new unit test testBuildActionConfigForUknownAction that asserts an appropriate actionconfig is created.

Thanks Wes!

> Default Mappings are broken in the codebehind plugin
> ----------------------------------------------------
>
>                 Key: WW-2607
>                 URL: https://issues.apache.org/struts/browse/WW-2607
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - CodeBehind
>    Affects Versions: 2.1.x
>            Reporter: Wes Wannemacher
>            Assignee: Jeromy Evans
>             Fix For: 2.1.2
>
>         Attachments: bar.zip, WW-2607.patch
>
>
> When using the codebehind plugin, developers should be able to drop a JSP, freemarker or velocity template into their web-app and codebehind should map it to ActionSupport automagically. Right now, the app server gives an error that an interceptor class cannot be found in default-stack. Attached is a simple app to demonstrate. To reproduce, unzip the app, run mvn jetty:run then try to hit http://localhost:8080/bar/index.action .

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


[jira] Updated: (WW-2607) Default Mappings are broken in the codebehind plugin

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

Wes Wannemacher updated WW-2607:
--------------------------------

    Attachment: bar.zip

simple test app to demonstrate the issue.

> Default Mappings are broken in the codebehind plugin
> ----------------------------------------------------
>
>                 Key: WW-2607
>                 URL: https://issues.apache.org/struts/browse/WW-2607
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - CodeBehind
>    Affects Versions: 2.1.x
>            Reporter: Wes Wannemacher
>         Attachments: bar.zip
>
>
> When using the codebehind plugin, developers should be able to drop a JSP, freemarker or velocity template into their web-app and codebehind should map it to ActionSupport automagically. Right now, the app server gives an error that an interceptor class cannot be found in default-stack. Attached is a simple app to demonstrate. To reproduce, unzip the app, run mvn jetty:run then try to hit http://localhost:8080/bar/index.action .

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


[jira] Commented: (WW-2607) Default Mappings are broken in the codebehind plugin

Posted by "Wes Wannemacher (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2607?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43716#action_43716 ] 

Wes Wannemacher commented on WW-2607:
-------------------------------------

I took a look at this last night and the source of the error message is in InterceptorBuilder. There is a call that takes a PackageConfig, and treats it like an InterceptorLocator and calls - interceptorLocator.getInterceptorConfig(refName); In this case, refName is "struts-default" but a null is returned for some reason. 

> Default Mappings are broken in the codebehind plugin
> ----------------------------------------------------
>
>                 Key: WW-2607
>                 URL: https://issues.apache.org/struts/browse/WW-2607
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - CodeBehind
>    Affects Versions: 2.1.x
>            Reporter: Wes Wannemacher
>         Attachments: bar.zip
>
>
> When using the codebehind plugin, developers should be able to drop a JSP, freemarker or velocity template into their web-app and codebehind should map it to ActionSupport automagically. Right now, the app server gives an error that an interceptor class cannot be found in default-stack. Attached is a simple app to demonstrate. To reproduce, unzip the app, run mvn jetty:run then try to hit http://localhost:8080/bar/index.action .

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


[jira] Updated: (WW-2607) Default Mappings are broken in the codebehind plugin

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

Wes Wannemacher updated WW-2607:
--------------------------------

    Attachment: WW-2607.patch

This seems to fix it. There is no unit test though, since I really don't know how this works or why it didn't work before. I'll commit if we get to the wire, but I'd rather wait for someone with more knowledge to help me add a unit test.

> Default Mappings are broken in the codebehind plugin
> ----------------------------------------------------
>
>                 Key: WW-2607
>                 URL: https://issues.apache.org/struts/browse/WW-2607
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - CodeBehind
>    Affects Versions: 2.1.x
>            Reporter: Wes Wannemacher
>         Attachments: bar.zip, WW-2607.patch
>
>
> When using the codebehind plugin, developers should be able to drop a JSP, freemarker or velocity template into their web-app and codebehind should map it to ActionSupport automagically. Right now, the app server gives an error that an interceptor class cannot be found in default-stack. Attached is a simple app to demonstrate. To reproduce, unzip the app, run mvn jetty:run then try to hit http://localhost:8080/bar/index.action .

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