Setting page content Type
Hi, I'm looking at internationalizing a series of pages, which cover different character sets. I've been planning to store the content type value in a properties files along wit hthe rest of the internationalized text, but I've run into some problems. I have been experiementing with jsp:directive.page contentType=... / @ page contentType=... / but none of them seem to be able to take a variable value for contentType, e.g. c:set fmt:message key=contentType/ /c:set %@ page contentType=${pageContentType} % or jsp:directive.page contentType=jsp:expressioncontentType/jsp:expression / Neither of them support EL, or sxpressions in the statement. Are there any plans to make these tags EL enabled? In the meantime I guess I'll have to look at filters. Cheers, Keith - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Setting page content Type
I have been experiementing with jsp:directive.page contentType=... / @ page contentType=... / but none of them seem to be able to take a variable value for contentType, These constructs will indeed not work (and they never will work in future versions either). The constructs you use are directives (the first one in XML syntax, the second in JSP syntax). Directives are interpreted at page translation time. The tags you attempt to use are not executed at page translation time but at page execution time (when a request is received for the page). Directives can not have variables as attributes, since the value of these variables can never be known at the time the page is translated to a servlet. Regards, Ronald. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Setting page content Type
On 03/12/2004 12:23 PM Keith Hyland wrote: I'm looking at internationalizing a series of pages, which cover different character sets. I've been planning to store the content type value in a properties files along wit hthe rest of the internationalized text, but I've run into some problems. I have been experiementing with jsp:directive.page contentType=... / @ page contentType=... / but none of them seem to be able to take a variable value for contentType, e.g. c:set fmt:message key=contentType/ /c:set %@ page contentType=${pageContentType} % or jsp:directive.page contentType=jsp:expressioncontentType/jsp:expression / Neither of them support EL, or sxpressions in the statement. Are there any plans to make these tags EL enabled? In the meantime I guess I'll have to look at filters. If you are using TC5, there is more flexibility for configuring the content-type and character-set, especially with JSTL standard taglibs. Regarding dynamic variables for JSP directives, it doesn't sound very plausible. You can map content-type to locales in your web.xml, and you can set it with fmt: tags, so I would say you'd be better off examining these methods first. I guess it also depends on how you are going to set the locale in the first place - is it a user choice or browser-setting dependent, or an application definition? Adam -- struts 1.1 + tomcat 5.0.16 + java 1.4.2 Linux 2.4.20 Debian - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Setting page content Type
Thanks for the replies, The locale will default to the users browser setting initially, but can also be selected (I have a filter that will dectect this parameter and set the locale in the javax.servlet.jsp.jstl.core.Config class), as well as stored in a cookie for future visits. I didn't know about the local-encoding-mapping-list settings in web.xml though, so I'll look into that. Keith Adam Hardy wrote on 12/03/2004, 12:55: On 03/12/2004 12:23 PM Keith Hyland wrote: I'm looking at internationalizing a series of pages, which cover different character sets. I've been planning to store the content type value in a properties files along wit hthe rest of the internationalized text, but I've run into some problems. I have been experiementing with jsp:directive.page contentType=... / @ page contentType=... / but none of them seem to be able to take a variable value for contentType, e.g. c:set fmt:message key=contentType/ /c:set %@ page contentType=${pageContentType} % or jsp:directive.page contentType=jsp:expressioncontentType/jsp:expression / Neither of them support EL, or sxpressions in the statement. Are there any plans to make these tags EL enabled? In the meantime I guess I'll have to look at filters. If you are using TC5, there is more flexibility for configuring the content-type and character-set, especially with JSTL standard taglibs. Regarding dynamic variables for JSP directives, it doesn't sound very plausible. You can map content-type to locales in your web.xml, and you can set it with fmt: tags, so I would say you'd be better off examining these methods first. I guess it also depends on how you are going to set the locale in the first place - is it a user choice or browser-setting dependent, or an application definition? Adam -- struts 1.1 + tomcat 5.0.16 + java 1.4.2 Linux 2.4.20 Debian - 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]