problem with page contentType of jsp
1 posts in topic
Flat View  Flat View

Posted By:   Madhukar_Reddy
Posted On:   Monday, August 9, 2004 01:44 AM

I have a situation where I have to set the content type of the jsp depending on a property in a property file.

I can get the value of the property as


the value will be either ISO-8859-1 or UTF-8.

So, how can I do something like...

<%@ page contentType="text/html; charset= <%= isCharse.getCharse() %>" %>

embedding jsp tags...or is there any other way i can do it?

Re: problem with page contentType of jsp

Posted By:   Serhiy_Brytskyy  
Posted On:   Friday, September 3, 2004 08:03 AM

Put at the first line of jsp:
String encoding = PropertyHandler.HagetProperty("site.local.web.charset.encoding");
((HttpServletResponse)response).setContentType("text/html; charset=" + encoding);

where PropertyHandler is some class, which can read property.
About | Sitemap | Contact