This looks like it might be a good situation to use the "MultiViewsTool" to find the appropriate header.vm file:
http://velocity.apache.org/tools/devel/javadoc/org/apache/velocity/tools/view/i18n/MultiViewsTool.html I haven't used it myself, but my understanding is that you use it to find the appropriate template name for a specified locale (or the default locale if there is none for the specified locale). And then you use the #parse() or #include() directives to load that template/file. So, assuming that you are using VelocityTools and the MultiViewsTool is in the context as $i18n, you would probably do something like: #parse( $i18n.findLocalizedResource("header.vm", $request.locale) ) of course, i don't know if you are using VelocityTools or the VelocityViewServlet. You mentioned portlets. Are you using a specific portlet framework? You might consider asking them for advice on this too. It could be challenging to set up VelocityTools with that framework; i'm not really sure how that would work... On 4/16/07, santas <[EMAIL PROTECTED]> wrote:
Hi What i want to do is that whenever i change "Locale " of my application depending on that locale i want to change my "header.vm" files contetnt for Meta tag. On my first page i am having one link that will chage my "Locale " of application now suppose i click on link and now new Locale is "en" then i want <meta > tag for en to be used by browser. Whenever i change my Locale one portlet is called and that calls another class to set this locale in session for that user. I tryid to put that in Velocity context but Now i am very much new to this velocity and trying lot many things but getting nothing. And my big confusion is that is this "header.vm" is called before that portlet is called. Can anybody give me proper direction please. Thanks -- View this message in context: http://www.nabble.com/Changing-Header.vm-file-on-Locale-change-tf3589047.html#a10029907 Sent from the Velocity - Dev mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]