javaconfigurationstruts2web.xmlstruts2-config-browser

What is "default location" for Struts actions (in config-browser)?


I have been seen there is a "default location" for all my actions when debugging using the Struts plugin "config-browser". Something like the below one:


Action information - list*

Action name:    list*
Namespace:  
Action class:   listAction
Action method:  {1}
Parameters: 
Default location:   /mysite/list*.action 

I'm wondering what is this "default location" means anything? Can I change it? How can I change it?

BTW: I've changed my struts filter in web.xml to only listen to /test/* and /action/*. I'm not sure why it's still says the "default location" is /mysite/list*.action.


Solution

  • There's no such concept "default location". There's "default action".

    Usually, if an action is requested, and the framework can't map the request to an action name, the result will be the usual "404 - Page not found" error. But, if you would prefer that an omnibus action handle any unmatched requests, you can specify a default action. If no other action matches, the default action is used instead.

    If you look at the ActionMapping class you see that it has not the location attribute. Instead ServletDispatcherResult and ServletRedirectResult has such parameter. So, using it with mapping can figure out the final location.

    there's also default namespace and default class concepts that is mentioned when calculating the final location.

    Also, the term location could be treated as the path and map to the configuration file where the action is configured.