Re: Dynamic include of a CSS stylesheet
Alexander Baetz wrote: Hi, ok, this is not really a struts question but we came to it while creating tiles pages. it might be that i'm thinking wrong. scenario: in writing a tiles template. there i want to include an external stylesheet x. when an action (domain/namespace/myAction.action) is executed the result creates a page that uses this stylesheet. now the problem: i want to avoid to include the stylesheet with the full path, including the domain. i would rather like to use the relative path. But how can i do that? Correct me if i'm wrong, but the relative path differs, depending on the url of the action. how can i create a link to the stylesheet that works for all actions? I often use: href="${pageContext.request.contextPath}/css/main.css"> where ${initParam.css} refers to an init param in web.xml (useful if it needs to change with the deployment, such as a version number) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Dynamic include of a CSS stylesheet
> > I often use: > > > href="${pageContext.request.contextPath}/css/main.css"> > > > where ${initParam.css} refers to an init param in web.xml (useful if it > needs to change with the deployment, such as a version number) > Could you point me at some code examples on how to set this up. I've a need to load a different style sheet depending upon either the locale of the user, or a user selected locale. Regards - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Dynamic include of a CSS stylesheet
Roger wrote: I often use: where ${initParam.css} refers to an init param in web.xml (useful if it needs to change with the deployment, such as a version number) Could you point me at some code examples on how to set this up. I've a need to load a different style sheet depending upon either the locale of the user, or a user selected locale. If dealing with Locale, I'd take a different approach. Struts2 sets the locale on the response object, and the i18n interceptor allows it to be overridden with the request_locale parameter. So you could: a. Reference the locale directly eg. or b. use the s:text tag to reference a path specified in a resource bundle for the current locale eg. /main.css"> or c. Use Tiles and Sitemesh to include a different tile/decoration based on the locale (as both support this). eg. I don't have any non-trivial i18n experience, so there's probably better ways. It really depends on what else needs to change on the page; if you're using a lot of s:text then that's a good approach; if you're using different tiles then that seems a good approach. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Dynamic include of a CSS stylesheet
try this ? Martin Gainty __ Disclaimer and confidentiality note Everything in this e-mail and any attachments relates to the official business of Sender. This transmission is of a confidential nature and Sender does not endorse distribution to any party other than intended recipient. Sender does not necessarily endorse content contained within this transmission. > From: [EMAIL PROTECTED] > To: user@struts.apache.org > Subject: Re: Dynamic include of a CSS stylesheet > Date: Wed, 3 Sep 2008 14:02:10 +0300 > > > > > I often use: > > > > > > > href="${pageContext.request.contextPath}/css/main.css"> > > > > > > where ${initParam.css} refers to an init param in web.xml (useful if it > > needs to change with the deployment, such as a version number) > > > > Could you point me at some code examples on how to set this up. I've a need > to > load a different style sheet depending upon either the locale of the user, or > a user selected locale. > > Regards > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > _ See how Windows connects the people, information, and fun that are part of your life. http://clk.atdmt.com/MRT/go/msnnkwxp1020093175mrt/direct/01/
RE: Dynamic include of a CSS stylesheet
--- On Wed, 9/3/08, Martin Gainty wrote: > I'd be worried if that test failed. >href="${pageContext.request.contextPath}/css/main.css"> Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Dynamic include of a CSS stylesheet
Any reason not to use; or did I miss something? Al. Dave Newton wrote: --- On Wed, 9/3/08, Martin Gainty wrote: I'd be worried if that test failed. Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Al Sutton W: www.alsutton.com B: alsutton.wordpress.com T: twitter.com/alsutton - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Dynamic include of a CSS stylesheet
Al Sutton wrote: Any reason not to use; or did I miss something? Al. That had never occurred to me! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Dynamic include of a CSS stylesheet
I'm pretty sure that wouldn't work without modifying the Struts TLD file since you can't use JSTL EL in wrote: > > try this > > > href="${pageContext.request.contextPath}/css/main.css"> > > href="${initParam.css}/css/main.css"> > > ? > Martin Gainty > > __ > Disclaimer and confidentiality note > Everything in this e-mail and any attachments relates to the official > business of Sender. This transmission is of a confidential nature and Sender > does not endorse distribution to any party other than intended recipient. > Sender does not necessarily endorse content contained within this > transmission. > > > > From: [EMAIL PROTECTED] > > To: user@struts.apache.org > > Subject: Re: Dynamic include of a CSS stylesheet > > Date: Wed, 3 Sep 2008 14:02:10 +0300 > > > > > > > > I often use: > > > > > > > > > > > href="${pageContext.request.contextPath}/css/main.css"> > > > href="${initParam.css}/main.css"> > > > > > > where ${initParam.css} refers to an init param in web.xml (useful if it > > > needs to change with the deployment, such as a version number) > > > > > > > Could you point me at some code examples on how to set this up. I've a > need to > > load a different style sheet depending upon either the locale of the > user, or > > a user selected locale. > > > > Regards > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > _ > See how Windows connects the people, information, and fun that are part of > your life. > http://clk.atdmt.com/MRT/go/msnnkwxp1020093175mrt/direct/01/