开发者

JSF2, i18n and SEO

开发者 https://www.devze.com 2023-01-21 23:37 出处:网络
I am migrating an application from Struts2 to JSF2. In struts2 I had mapped most of the actions so that the same action returned different locale content depending on the URL. For example:

I am migrating an application from Struts2 to JSF2. In struts2 I had mapped most of the actions so that the same action returned different locale content depending on the URL. For example:

http://site.com/en/content.action http://site.com/es/content.action

The action returned the same JSP which showed spanish or english depending on the URL. With this approach I have "SEO" bookmarkable localized URLs.

Is there any approach for doing this with JSF2? If not, which is the r开发者_如何学JAVAecommended approach for making the same JSF (xhtml) show different locale content depending on a request parameter (?locale=en for example) I have solved it using a changeLocale method in a managed bean, which works OK, but as it uses Post, the pages are not SEO as cannot be crawled.

Thanks for any ideas/approach. Ignacio


I would suggest you to look at PrettyFaces

Any business knows how important Search Engine Optimization can be for sales. PrettyFaces allows SEO-friendly URLs, and improved customer experience. Give your site a uniform, well understood feeling, from the address bar to the buy button.

I have personally used this in one of my app.

in your case if i understood it correctly you can make something like

yourdomain.com/en/login
0

精彩评论

暂无评论...
验证码 换一张
取 消