struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jose Luis Martinez Avial" <>
Subject Redirect non-exisings URLs to a default one creates akward URLs
Date Tue, 09 Nov 2010 16:21:52 GMT
Helllo all,
    I'm using Struts with two packages defined as follow:
<package name="eco-default" extends="json-default">
 <default-action-ref name="root"/>
  <result name="Login" type="tiles">Login</result>
 <action name="root">
  <result type="redirectAction">main/Dashboard</result>
<package name="eco-main" namespace="/main" extends="eco-default">
 <default-action-ref name="Dashboard"/>
 <action name="Dashboard"
  <result type="tiles" >MenuCliente</result>
If I input http://myserver/main/whatever it automatically redirects me
to http://myserver/main/Dashboard The same happens if I input
http://myserver/whatever But if whatever contains a forward slash, I got
problems. For example http://myserver/main/ redirects me to
<http://myserver/main/main/Dashboard> , which is not correct. The same
happens if I go to http://myserver/main/aaa/bbbb . The second case mades
sense, since the namespace /main/aaaa does not exists, so it looks for
the default action in namespace /. and redirects to main/DashBoard,
creating the http://myserver/main/main/Dashboard. How can I make it
redirect that case to http://myserver/main/main/Dashboard
<http://myserver/main/main/Dashboard>  (without using the
http://myserver in the redirection)? And what happens with the first
case? shouldn't that request be redirected to Dashboard,(since there is
a namespaces "/main" with that default action) insted of being
redirected to main/Dashboard. It seems is looking in the namespaces "/"
rather than in the namespaces "/main"

Internet communications are not secure and therefore Banco 
Santander International does not accept legal responsibility for 
the contents of this message. Any views or opinions presented are 
solely those of the author and do not necessarily represent those 
of Banco Santander International unless otherwise specifically 

Las comunicaciones via Internet no son seguras y por lo tanto 
Banco Santander International no asume responsabilidad legal ni 
de ningun otro tipo por el contenido de este mensaje. Cualquier 
opinion transmitida pertenece unicamente al autor y no 
necesariamente representa la opinion del Banco Santander 
International a no ser que este expresamente detallado.

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message