You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Ryan Sims <rw...@gmail.com> on 2011/05/13 16:00:02 UTC

Convention plugin seems to add "blank" action to default namespace?

I'm new to Struts; working on getting a small app running with the
Convention plugin. It seems to work perfectly well in finding the
actions I have - a little *too* well, actually. The problem is that if
I visit a url like localhost:8080/foo/bar/baz/ I get my IndexAction,
which should only work for the localhost:8080/ url. I have
@Namespace("/") on IndexAction. I checked config-browser, and "index"
is only under the "/" namespace, as it should be, but there's also an
action with no name, in both "default" and "/" namespaces.

This "blank" action maps to the IndexAction class, and obviously
(since its in default) gets called whenever there's an unknown action.
If I remove or rename the IndexAction class, I don't get the blank
action.

My struts.xml is empty, I have namespaces declared on all my classes.
What else do I need to do? Please let me know if there's anything else
I can post to help debug.

--
rwsims

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Convention plugin seems to add "blank" action to default namespace?

Posted by Jeffrey Black <je...@yahoo.com>.
Hey Ryan, what drop of Struts2 are you running?

Just curious, have you tried configuring your app via struts.xml vs. annotations?

Best,

jb

Sent from my iPad
Follow me on Twitter @jeffblack360


On May 13, 2011, at 9:00 AM, Ryan Sims <rw...@gmail.com> wrote:

> I'm new to Struts; working on getting a small app running with the
> Convention plugin. It seems to work perfectly well in finding the
> actions I have - a little *too* well, actually. The problem is that if
> I visit a url like localhost:8080/foo/bar/baz/ I get my IndexAction,
> which should only work for the localhost:8080/ url. I have
> @Namespace("/") on IndexAction. I checked config-browser, and "index"
> is only under the "/" namespace, as it should be, but there's also an
> action with no name, in both "default" and "/" namespaces.
> 
> This "blank" action maps to the IndexAction class, and obviously
> (since its in default) gets called whenever there's an unknown action.
> If I remove or rename the IndexAction class, I don't get the blank
> action.
> 
> My struts.xml is empty, I have namespaces declared on all my classes.
> What else do I need to do? Please let me know if there's anything else
> I can post to help debug.
> 
> --
> rwsims
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org