[opencms-dev] Setting manual Content-Type header from a jsp

Mike Dikan dikeman at gmail.com
Mon Jun 15 20:00:46 CEST 2009


I have need for a jsp that spits out dynamic javascript called  
something like javascript_dynamic_variable_init.jsp.  In opencms, if  
you have a file on the vfs that has extension .js, the content-type  
header that is returned is of type 'application/x-javascript', and if  
you have a file that ends in extension .jsp, the content-type header  
is 'text/html'.  I need to change the content-type header returned for  
a file ending in .jsp to the .js header, but any attempts to do so  
either by using the <%@page contentType="" %> tag, or operating on the  
response directly is clobbered by opencms.  Does anyone know how to do  
this in opencms 7.0.5?

And to head off any questions, i can't rename the file to .js, because  
the file needs to be brought in as a jsp opencms 'type' via the  
synchronize functionality, which will only create types based on file  
extensions, as far as I know.

Thanks!
-Mike



More information about the opencms-dev mailing list