Hi Tauri,

I don't have time to try it myself right now, but what I meant was create an additional default package that contains no actions. I'm not sure if it will help though. The idea is that when the default action mapper can't match the namespace, it falls back to an empty back.

Like this:

<package name="default" namespace="" extends="struts-default"></package>
<package name="register" namespace="/register" extends="tiles-default">
...normal actions...
</package>


ie. create an empty back in the "" namespace. If that doesn't work also try the "/" namespace.

If that doesn't work, there's also some poorly documented options for the default ActionMapper. Try setting the struts property "struts.mapper.alwaysSelectFullNamespace" to true. It may be the one you need. Put it in struts.properties or a const in struts.xml.

Hope that helps,
Jeromy Evans

Tauri Valor wrote:
Thanks Jeromy!

Ive tried creating a package with empty name space ie :

<package name="register" namespace="/" extends="tiles-default">

then the following url :

http://localhost:8080/MY_WEB/acc.register.RegistrationForm.do

without the namespace works fine ..

But any other way to keep my namespace in tact in the url because the above
may not be acceptable?

Thanks,
Tauri




http://localhost:8080/MY_WEB/register/acc.register.RegistrationForm.do









Jeromy Evans - Blue Sky Minds wrote:
No mistake. AFAIK that's a design flaw of the default action mapper. See: http://www.planetstruts.org/struts2-blank/example/somecrap/HelloWorld.action

If there's no match in a package namespace it falls back to the default package and matches a little to generously.

You may be able to avoid it by creating a package with an empty namespace containing no actions. Not sure about that one...

Tauri Valor wrote:
Hi

I have the following problem with url in my web application:

I run my app using Struts2 and Tomcat6.

Context name of webapp: MY_WEB

Namespace in my package tag of struts-config.xml:

package name="register" namespace="/register" extends="tiles-default"


Mapping of Action class in my struts-config.xml :

action name= acc.register.RegistrationForm


A Href link in my jsp page:


a href="register/acc.register.RegistrationForm.do"


Now, the following url works fine when I launch my app:

http://localhost:8080/MY_WEB/register/acc.register.RegistrationForm.do


But the problem is the url when added something between my
packagename(register)and my uri (acc.register.RegistrationForm.do) like
following:

http://localhost:8080/MY_WEB/register/somecrap/acc.register.RegistrationForm.do

it still works fine instead of displaying the error page. I need to get
an
error page if I give wrong url like the above.

What is my mistake ?

Pls advise.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to