You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by GF <ga...@gmail.com> on 2011/05/07 10:41:30 UTC

Same .war handling more Context Path

Hello, the only way i found to handle with a single .war more than one
context path is the following in the server.xml


      <Context docBase="myApp" path="/en" reloadable="true" />
      <Context docBase="myApp" path="/it" reloadable="true" />

But this cause myApp being "loaded" TWICE (or many times if i wish to
handle many languages, it, en, fr, and so)

Is there some alternative way? I have the underlying .war written in
struts2 and it's context-path indipendent, so the best choice for me
would be to place the "language" information in the context-path
section of the url.

Thank you

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Same .war handling more Context Path

Posted by GF <ga...@gmail.com>.
Thank you for your answer.
The problem is that the underlying technology i'm using (Struts2)
doesn't make this very simple to handle in the folloowing url
generation tasks.

On Sat, May 7, 2011 at 2:32 PM, Ognjen Blagojevic
<og...@gmail.com> wrote:
> GF,
>
> On 7.5.2011 10:41, GF wrote:
>>
>> Is there some alternative way? I have the underlying .war written in
>> struts2 and it's context-path indipendent, so the best choice for me
>> would be to place the "language" information in the context-path
>> section of the url.
>
> I use one webapp at ROOT context which handles all languages.
> Urlrewritefilter changes URLs from /en/something/123 into
> /something.jsf?id=123&lang=en, and then one JSF phase listener checks for
> "lang" request parameter and sets the appropriate language for the
> framework.
>
> YMMV.
>
> Regards,
> Ognjen
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Same .war handling more Context Path

Posted by Ognjen Blagojevic <og...@gmail.com>.
GF,

On 7.5.2011 10:41, GF wrote:
> Is there some alternative way? I have the underlying .war written in
> struts2 and it's context-path indipendent, so the best choice for me
> would be to place the "language" information in the context-path
> section of the url.

I use one webapp at ROOT context which handles all languages. 
Urlrewritefilter changes URLs from /en/something/123 into 
/something.jsf?id=123&lang=en, and then one JSF phase listener checks 
for "lang" request parameter and sets the appropriate language for the 
framework.

YMMV.

Regards,
Ognjen

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org