How set Content-type during runtime in jsf
I need to set Content-type of the output jsp during runtime, because output can be either html or wml and have specific endoding
I tried this way:
// jsf action method
public String showPreview (){
HttpServletResponse response = (HttpServletResponse) getFacesContext().getExternalContext().getResponse();
try{
response.setContentType(getCurrentSite().getContentType());
}catch (CmsOperationException e){
// TODO Auto-generated catch block
e.printStackTrace();
}
return PREVIEW_CASE;
}
but this is overriden later as during execution of the jsp page the response have content-type "text/hml" , which is the default value.
I could probably do it with a scriptlet on the jsp page. Isn't there a more elegant solution?

