You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Nicola de Saint-Aubert <ns...@lavanguardia.es> on 2009/10/05 11:49:54 UTC

domains and aplication name mapping

Hi,

 

Basically, struts 2 considers url as the following: 

http://domain/appContextName/packageNameSpace/actionOrMethodName.

 

Now consider the following scheme:

Internet  -> /public name spacing/ -> Apache -> /private name spacing/ ->
Jboss.

In your public namespacing , you may want your "domain/appContexName" part
of the url be only some www.pepe.com <http://www.pepe.com/> , while in your
private one /pepe:8080/pepeWeb.

Thus (for SEO reasons .)  you might need a different "domain/appContextName"
in your public and private namespacing which implies defining a mapping on
them that allows the UrlHelper to construct public nameSpacing while the
Controler still working on the private Namespacing.

 

As what we know, Struts 2 does allow a lot of url assembling tecnics, but
does not address with the "adomain/appContextName" part of the url.

But we may consider implementing a simple patch on that point: 

-          the entry point would be the UrlHelper, change the line getting
the ContextName for a mapping module that transform private name spacing to
private name spacing, so that all tags (form, urlassembler.) will construct
the right public url.

-          In the proper struts.xml (or in another xml), configuring the
mapping (something like <appContext private="pepeWeb" public=www.pepe.com
<http://www.pepe.com/> />).

 

We would be gratefull to tell us if there already exists a legal solution to
our problem or if we do have to implement the patch.

 

Best regards,

 

Nicolas

 

 


Re: domains and aplication name mapping

Posted by Nils-Helge Garli Hegvik <ni...@gmail.com>.
If I understand correctly, I believe this is a proxy configuration
issue. Here you can find some reference to how I solved it when I
faced the same problem:

http://portletwork.blogspot.com/2009/04/rewriting-urls-in-web-application-using.html

Nils-H

On Mon, Oct 5, 2009 at 11:49 AM, Nicola de Saint-Aubert
<ns...@lavanguardia.es> wrote:
> Hi,
>
>
>
> Basically, struts 2 considers url as the following:
>
> http://domain/appContextName/packageNameSpace/actionOrMethodName.
>
>
>
> Now consider the following scheme:
>
> Internet  -> /public name spacing/ -> Apache -> /private name spacing/ ->
> Jboss.
>
> In your public namespacing , you may want your "domain/appContexName" part
> of the url be only some www.pepe.com <http://www.pepe.com/> , while in your
> private one /pepe:8080/pepeWeb.
>
> Thus (for SEO reasons .)  you might need a different "domain/appContextName"
> in your public and private namespacing which implies defining a mapping on
> them that allows the UrlHelper to construct public nameSpacing while the
> Controler still working on the private Namespacing.
>
>
>
> As what we know, Struts 2 does allow a lot of url assembling tecnics, but
> does not address with the "adomain/appContextName" part of the url.
>
> But we may consider implementing a simple patch on that point:
>
> -          the entry point would be the UrlHelper, change the line getting
> the ContextName for a mapping module that transform private name spacing to
> private name spacing, so that all tags (form, urlassembler.) will construct
> the right public url.
>
> -          In the proper struts.xml (or in another xml), configuring the
> mapping (something like <appContext private="pepeWeb" public=www.pepe.com
> <http://www.pepe.com/> />).
>
>
>
> We would be gratefull to tell us if there already exists a legal solution to
> our problem or if we do have to implement the patch.
>
>
>
> Best regards,
>
>
>
> Nicolas
>
>
>
>
>
>

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


RE: domains and aplication name mapping

Posted by Nicola de Saint-Aubert <ns...@lavanguardia.es>.
Thanks, i ll do that; i didn t know mod_proxy had it implemented.

Best regards

-----Mensaje original-----
De: Wes Wannemacher [mailto:wesw@wantii.com] 
Enviado el: lunes, 05 de octubre de 2009 15:10
Para: Struts Developers List
Asunto: Re: domains and aplication name mapping

I'm not sure you're aware, but IIRC, if your application is named
'ROOT' (i.e. ROOT.war), then the application server will serve it up
without appending the appcontext name onto the URL. After that, I
agree with Nils, it is a reverse proxy issue. You would probably get
more feedback on the user@struts.apache.org mailing list, since many
users have probably dealt with this very issue.

-Wes

On Mon, Oct 5, 2009 at 5:49 AM, Nicola de Saint-Aubert
<ns...@lavanguardia.es> wrote:
> Hi,
>
>
>
> Basically, struts 2 considers url as the following:
>
> http://domain/appContextName/packageNameSpace/actionOrMethodName.
>
>
>
> Now consider the following scheme:
>
> Internet  -> /public name spacing/ -> Apache -> /private name spacing/ ->
> Jboss.
>
> In your public namespacing , you may want your "domain/appContexName" part
> of the url be only some www.pepe.com <http://www.pepe.com/> , while in
your
> private one /pepe:8080/pepeWeb.
>
> Thus (for SEO reasons .)  you might need a different
"domain/appContextName"
> in your public and private namespacing which implies defining a mapping on
> them that allows the UrlHelper to construct public nameSpacing while the
> Controler still working on the private Namespacing.
>
>
>
> As what we know, Struts 2 does allow a lot of url assembling tecnics, but
> does not address with the "adomain/appContextName" part of the url.
>
> But we may consider implementing a simple patch on that point:
>
> -          the entry point would be the UrlHelper, change the line getting
> the ContextName for a mapping module that transform private name spacing
to
> private name spacing, so that all tags (form, urlassembler.) will
construct
> the right public url.
>
> -          In the proper struts.xml (or in another xml), configuring the
> mapping (something like <appContext private="pepeWeb" public=www.pepe.com
> <http://www.pepe.com/> />).
>
>
>
> We would be gratefull to tell us if there already exists a legal solution
to
> our problem or if we do have to implement the patch.
>
>
>
> Best regards,
>
>
>
> Nicolas
>
>
>
>
>
>



-- 
Wes Wannemacher

Head Engineer, WanTii, Inc.
Need Training? Struts, Spring, Maven, Tomcat...
Ask me for a quote!

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


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


Re: domains and aplication name mapping

Posted by Wes Wannemacher <we...@wantii.com>.
I'm not sure you're aware, but IIRC, if your application is named
'ROOT' (i.e. ROOT.war), then the application server will serve it up
without appending the appcontext name onto the URL. After that, I
agree with Nils, it is a reverse proxy issue. You would probably get
more feedback on the user@struts.apache.org mailing list, since many
users have probably dealt with this very issue.

-Wes

On Mon, Oct 5, 2009 at 5:49 AM, Nicola de Saint-Aubert
<ns...@lavanguardia.es> wrote:
> Hi,
>
>
>
> Basically, struts 2 considers url as the following:
>
> http://domain/appContextName/packageNameSpace/actionOrMethodName.
>
>
>
> Now consider the following scheme:
>
> Internet  -> /public name spacing/ -> Apache -> /private name spacing/ ->
> Jboss.
>
> In your public namespacing , you may want your "domain/appContexName" part
> of the url be only some www.pepe.com <http://www.pepe.com/> , while in your
> private one /pepe:8080/pepeWeb.
>
> Thus (for SEO reasons .)  you might need a different "domain/appContextName"
> in your public and private namespacing which implies defining a mapping on
> them that allows the UrlHelper to construct public nameSpacing while the
> Controler still working on the private Namespacing.
>
>
>
> As what we know, Struts 2 does allow a lot of url assembling tecnics, but
> does not address with the "adomain/appContextName" part of the url.
>
> But we may consider implementing a simple patch on that point:
>
> -          the entry point would be the UrlHelper, change the line getting
> the ContextName for a mapping module that transform private name spacing to
> private name spacing, so that all tags (form, urlassembler.) will construct
> the right public url.
>
> -          In the proper struts.xml (or in another xml), configuring the
> mapping (something like <appContext private="pepeWeb" public=www.pepe.com
> <http://www.pepe.com/> />).
>
>
>
> We would be gratefull to tell us if there already exists a legal solution to
> our problem or if we do have to implement the patch.
>
>
>
> Best regards,
>
>
>
> Nicolas
>
>
>
>
>
>



-- 
Wes Wannemacher

Head Engineer, WanTii, Inc.
Need Training? Struts, Spring, Maven, Tomcat...
Ask me for a quote!

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