You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Laurie Harper <la...@holoweb.net> on 2007/01/15 00:07:59 UTC
s2 Code Behind bug?
I'm trying to get a project running with the Zero Config and Code Behind
Plugin features of S2 and I'm seeing something which looks like a bug. I
thought I'd raise it here before posting it to JIRA and/or trying to dig
through the plugin code to track it down, in case this is 'by design' or
something.
The problem is when I create a page for which there is no action, and
the package the action would be in doesn't exist. E.g.:
- actionPackages set to com.foo.action
- page located at /foo/bar.jsp
When I request the page, code behind reports "Trying to locate unknown
action template with extension .jsp in directory /" -- it should, of
course, be looking in /foo. The request therefore fails.
However, if I create the package com.foo.action.foo (and put a dummy
class in there so the package will exist at runtime), everything works
as it should.
That seems wrong to me... am I missing anything? And if not, where
should I start looking to debug and fix it?
Cheers,
L.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org
Re: s2 Code Behind bug?
Posted by Don Brown <do...@gmail.com>.
Oversight, file a ticket and I'll look at it. The core issue is that
the default action mapper doesn't properly determine the namespace and
action name, so the plugin will probably have to compensate.
Don
On 1/16/07, Laurie Harper <la...@holoweb.net> wrote:
> Yup, that gets it working. I mis-spoke before; an empty public class
> Dummy{} in the package isn't enough, but an empty public class Dummy
> extends ActionSupport {} (or a POJO class named xxxAction) is.
>
> So: by design, or oversight? :-)
>
> L.
>
> Don Brown wrote:
> > I'm assuming you were calling the page with
> > http://localhost/myapp/foo/bar.action? If so, I wonder if the plugin
> > only works when there is at least one action class in a package. Try to
> > create a different action like com.foo.action.foo.BazAction in that same
> > package, and see if the plugin then works.
> >
> > Don
> >
> > Laurie Harper wrote:
> >> I'm trying to get a project running with the Zero Config and Code
> >> Behind Plugin features of S2 and I'm seeing something which looks like
> >> a bug. I thought I'd raise it here before posting it to JIRA and/or
> >> trying to dig through the plugin code to track it down, in case this
> >> is 'by design' or something.
> >>
> >> The problem is when I create a page for which there is no action, and
> >> the package the action would be in doesn't exist. E.g.:
> >>
> >> - actionPackages set to com.foo.action
> >> - page located at /foo/bar.jsp
> >>
> >> When I request the page, code behind reports "Trying to locate unknown
> >> action template with extension .jsp in directory /" -- it should, of
> >> course, be looking in /foo. The request therefore fails.
> >>
> >> However, if I create the package com.foo.action.foo (and put a dummy
> >> class in there so the package will exist at runtime), everything works
> >> as it should.
> >>
> >> That seems wrong to me... am I missing anything? And if not, where
> >> should I start looking to debug and fix it?
> >>
> >> Cheers,
> >>
> >> L.
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> >> For additional commands, e-mail: dev-help@struts.apache.org
> >>
> >>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org
Re: s2 Code Behind bug?
Posted by Laurie Harper <la...@holoweb.net>.
Yup, that gets it working. I mis-spoke before; an empty public class
Dummy{} in the package isn't enough, but an empty public class Dummy
extends ActionSupport {} (or a POJO class named xxxAction) is.
So: by design, or oversight? :-)
L.
Don Brown wrote:
> I'm assuming you were calling the page with
> http://localhost/myapp/foo/bar.action? If so, I wonder if the plugin
> only works when there is at least one action class in a package. Try to
> create a different action like com.foo.action.foo.BazAction in that same
> package, and see if the plugin then works.
>
> Don
>
> Laurie Harper wrote:
>> I'm trying to get a project running with the Zero Config and Code
>> Behind Plugin features of S2 and I'm seeing something which looks like
>> a bug. I thought I'd raise it here before posting it to JIRA and/or
>> trying to dig through the plugin code to track it down, in case this
>> is 'by design' or something.
>>
>> The problem is when I create a page for which there is no action, and
>> the package the action would be in doesn't exist. E.g.:
>>
>> - actionPackages set to com.foo.action
>> - page located at /foo/bar.jsp
>>
>> When I request the page, code behind reports "Trying to locate unknown
>> action template with extension .jsp in directory /" -- it should, of
>> course, be looking in /foo. The request therefore fails.
>>
>> However, if I create the package com.foo.action.foo (and put a dummy
>> class in there so the package will exist at runtime), everything works
>> as it should.
>>
>> That seems wrong to me... am I missing anything? And if not, where
>> should I start looking to debug and fix it?
>>
>> Cheers,
>>
>> L.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
>> For additional commands, e-mail: dev-help@struts.apache.org
>>
>>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org
Re: s2 Code Behind bug?
Posted by Don Brown <mr...@twdata.org>.
I'm assuming you were calling the page with
http://localhost/myapp/foo/bar.action? If so, I wonder if the plugin
only works when there is at least one action class in a package. Try to
create a different action like com.foo.action.foo.BazAction in that same
package, and see if the plugin then works.
Don
Laurie Harper wrote:
> I'm trying to get a project running with the Zero Config and Code
> Behind Plugin features of S2 and I'm seeing something which looks like
> a bug. I thought I'd raise it here before posting it to JIRA and/or
> trying to dig through the plugin code to track it down, in case this
> is 'by design' or something.
>
> The problem is when I create a page for which there is no action, and
> the package the action would be in doesn't exist. E.g.:
>
> - actionPackages set to com.foo.action
> - page located at /foo/bar.jsp
>
> When I request the page, code behind reports "Trying to locate unknown
> action template with extension .jsp in directory /" -- it should, of
> course, be looking in /foo. The request therefore fails.
>
> However, if I create the package com.foo.action.foo (and put a dummy
> class in there so the package will exist at runtime), everything works
> as it should.
>
> That seems wrong to me... am I missing anything? And if not, where
> should I start looking to debug and fix it?
>
> Cheers,
>
> L.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org