You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by smart acer <sm...@gmail.com> on 2008/02/22 17:40:14 UTC

welcome file setup for namespace URL

Our domain is http://www.example.com
Our app context is products, so URL for the app is
http://www.example.com/products
We have a package/namespace defined as follows,

<package name="sub_product" namespace="/sub_product"
extends="tiles-default">
<action name="content">
<result type="tiles">page.productDetails</result>
</action>
</package>

http://www.example.com/products -- works fine
http://www.example.com/products/sub_product/content.action --- works fine
http://www.example.com/products/sub_product -- - throws 404 --- We are
unable to figure out where to configure welcome file for the namespace

Any help is greatly appreciated.

Thanks
-VJ

Re: welcome file setup for namespace URL

Posted by smart acer <sm...@gmail.com>.
Our app context is "products", so URL for the app is
http://www.example.com/products

We want sub-directory like URL for each major feature, so we have package
for each section, like below

<package name="sub_product" namespace="/sub_product"
extends="tiles-default">
<action name="content">
  <result type="tiles">page.productDetails</result>
 </action>
</package>

So the path to this section is ==
http://www.example.com/products/sub_product/content.action

The issue we are facing is, when accessed like,
http://www.example.com/products/sub_product/<http://www.example.com/products/sub_product/content.action>
it
throws 404. Upon accessing this URL, we want it goto a JSP page or some
other way ultimately redirecting to
http://www.example.com/products/sub_product/content.action

Thanks
Vijay

On 2/22/08, Dave Newton <ne...@yahoo.com> wrote:
>
> Why not just put a redirect into a "normal" welcome file?
>
> --- smart acer <sm...@gmail.com> wrote:
>
> > I tried these and it is not working, it immediately brings up 404. I
> think
> > I
> > put something after URL (asd.action) then the wildcard logic kicks in.
> > anyone using like below? help pls!
> >
> > Thanks
> > VJ
> >
> > On 2/22/08, Laurie Harper <la...@holoweb.net> wrote:
> > >
> > > smart acer wrote:
> > > > Our domain is http://www.example.com
> > > > Our app context is products, so URL for the app is
> > > > http://www.example.com/products
> > > > We have a package/namespace defined as follows,
> > > >
> > > > <package name="sub_product" namespace="/sub_product"
> > > > extends="tiles-default">
> > > > <action name="content">
> > > > <result type="tiles">page.productDetails</result>
> > > > </action>
> > > > </package>
> > > >
> > > > http://www.example.com/products -- works fine
> > > > http://www.example.com/products/sub_product/content.action --- works
> > > fine
> > > > http://www.example.com/products/sub_product -- - throws 404 --- We
> are
> > > > unable to figure out where to configure welcome file for the
> namespace
> > > >
> > > > Any help is greatly appreciated.
> > > >
> > > > Thanks
> > > > -VJ
> > > >
> > >
> > > I haven't tried it, but adding an action mapping with name="/" might
> > > work; using name="*" will probably do the trick if not (but you should
> > > probably list that mapping last in the package since '*' is a
> > > match-anything wildcard). In either case, your URL might need a
> trailing
> > > '/' (as in .../products/sub_product/).
> > >
> > > L.
> > >
> > >
> > > ---------------------------------------------------------------------
> > > 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
>
>

Re: welcome file setup for namespace URL

Posted by Dave Newton <ne...@yahoo.com>.
Why not just put a redirect into a "normal" welcome file?

--- smart acer <sm...@gmail.com> wrote:

> I tried these and it is not working, it immediately brings up 404. I think
> I
> put something after URL (asd.action) then the wildcard logic kicks in.
> anyone using like below? help pls!
> 
> Thanks
> VJ
> 
> On 2/22/08, Laurie Harper <la...@holoweb.net> wrote:
> >
> > smart acer wrote:
> > > Our domain is http://www.example.com
> > > Our app context is products, so URL for the app is
> > > http://www.example.com/products
> > > We have a package/namespace defined as follows,
> > >
> > > <package name="sub_product" namespace="/sub_product"
> > > extends="tiles-default">
> > > <action name="content">
> > > <result type="tiles">page.productDetails</result>
> > > </action>
> > > </package>
> > >
> > > http://www.example.com/products -- works fine
> > > http://www.example.com/products/sub_product/content.action --- works
> > fine
> > > http://www.example.com/products/sub_product -- - throws 404 --- We are
> > > unable to figure out where to configure welcome file for the namespace
> > >
> > > Any help is greatly appreciated.
> > >
> > > Thanks
> > > -VJ
> > >
> >
> > I haven't tried it, but adding an action mapping with name="/" might
> > work; using name="*" will probably do the trick if not (but you should
> > probably list that mapping last in the package since '*' is a
> > match-anything wildcard). In either case, your URL might need a trailing
> > '/' (as in .../products/sub_product/).
> >
> > L.
> >
> >
> > ---------------------------------------------------------------------
> > 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


Re: welcome file setup for namespace URL

Posted by smart acer <sm...@gmail.com>.
I tried these and it is not working, it immediately brings up 404. I think I
put something after URL (asd.action) then the wildcard logic kicks in.
anyone using like below? help pls!

Thanks
VJ

On 2/22/08, Laurie Harper <la...@holoweb.net> wrote:
>
> smart acer wrote:
> > Our domain is http://www.example.com
> > Our app context is products, so URL for the app is
> > http://www.example.com/products
> > We have a package/namespace defined as follows,
> >
> > <package name="sub_product" namespace="/sub_product"
> > extends="tiles-default">
> > <action name="content">
> > <result type="tiles">page.productDetails</result>
> > </action>
> > </package>
> >
> > http://www.example.com/products -- works fine
> > http://www.example.com/products/sub_product/content.action --- works
> fine
> > http://www.example.com/products/sub_product -- - throws 404 --- We are
> > unable to figure out where to configure welcome file for the namespace
> >
> > Any help is greatly appreciated.
> >
> > Thanks
> > -VJ
> >
>
> I haven't tried it, but adding an action mapping with name="/" might
> work; using name="*" will probably do the trick if not (but you should
> probably list that mapping last in the package since '*' is a
> match-anything wildcard). In either case, your URL might need a trailing
> '/' (as in .../products/sub_product/).
>
> L.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: welcome file setup for namespace URL

Posted by Laurie Harper <la...@holoweb.net>.
smart acer wrote:
> Our domain is http://www.example.com
> Our app context is products, so URL for the app is
> http://www.example.com/products
> We have a package/namespace defined as follows,
> 
> <package name="sub_product" namespace="/sub_product"
> extends="tiles-default">
> <action name="content">
> <result type="tiles">page.productDetails</result>
> </action>
> </package>
> 
> http://www.example.com/products -- works fine
> http://www.example.com/products/sub_product/content.action --- works fine
> http://www.example.com/products/sub_product -- - throws 404 --- We are
> unable to figure out where to configure welcome file for the namespace
> 
> Any help is greatly appreciated.
> 
> Thanks
> -VJ
> 

I haven't tried it, but adding an action mapping with name="/" might 
work; using name="*" will probably do the trick if not (but you should 
probably list that mapping last in the package since '*' is a 
match-anything wildcard). In either case, your URL might need a trailing 
'/' (as in .../products/sub_product/).

L.


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