Re: Mounting URLs with locale prefix

2012-08-28 Thread asfernandes
I succedded to make it work without mess with autoLinking seeting, but it's
just for my case. I believe this is a Wicket bug, but I have no idea on a
better fix.

I installed a new RequestCycleProvider to override the UrlRenderer. I
recreated UrlRenderer#renderContextRelativeUrl replacing:

for (int i = 0; i  getBaseUrl().getSegments().size() - 1; ++i)

by:

for (int i = 1; i  getBaseUrl().getSegments().size() - 1; ++i)

So now it doesn't strip the ${locale} part of the URL to relativize
resources paths.



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Mounting-URLs-with-locale-prefix-tp4651528p4651560.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Mounting URLs with locale prefix

2012-08-28 Thread asfernandes

Martin Grigorov-4 wrote
 
 The segment with the locale should be removed by the IRequestMapper as
 LocaleFirstMapper does.
 

But on UrlRenderer#renderContextRelativeUrl, getBaseUrl() shows pt-br/home
when I'm accessing http://localhost:8990/Site/pt-br/home

This caused my tags to be rewritten from:
link rel=stylesheet type=text/css href=styles/cssreset-min.css /
to:
link rel=stylesheet type=text/css 
href=../styles/cssreset-min.css /

The first is the one I want, since the resources is also mounted with
LocaleFirstMapper, and I want it there.

So maybe some setBaseUrl call is missing, to adjust the URL on the
UrlRenderer.


Martin Grigorov-4 wrote
 
 But in your case you have the locale hardcoded in the .css file, or at
 least this is what I understood, and Wicket should not remove anything
 that is not added by it.
 

It's not hardcoded. It's relative and I want Wicket to preserve the locale
on the URL, but it's stripping it.

My resources are not localized, but looks better for me to mount them under
the locale prefix, since Wicket could not rewrite embedded or inline CSS,
and I want to use relative paths there too.



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Mounting-URLs-with-locale-prefix-tp4651528p4651562.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Mounting URLs with locale prefix

2012-08-27 Thread asfernandes
Martin,

Thanks for the Mapper hint, but things still don't work well in my case
(html files without wicket:id tags).

I had it almost working, but I need to call
getMarkupSettings().setAutomaticLinking(true), but this caused another
problem: Wicket is putting an onclick in   tags inside   redirecting to the
image (via window.location.href). I do not want it, I want just my links ( )
work.

When I remove setAutomaticLinking(true), Wickets sets wrong directory. It
appends a ../ before src, hrefs, etc.

This is what I said initially on the need to mount things in two different
places. I mount my resources inside the locale directory, so CSS
background-image in HTML files work, but then it fails on the other
resources (caused by this ../ prefix).



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Mounting-URLs-with-locale-prefix-tp4651528p4651539.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org