<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Sorry, just found the static CmsFlexController.getController(request) method to answer the first part of my last email.<div><br></div><div>As for the second part, I attempted this:</div><div><font class="Apple-style-span" face="Helvetica, monospace, Fixedsys"><br></font></div><div><span class="Apple-style-span" style="font-family: 'courier new', monospace, Fixedsys; font-size: 13px; line-height: 15px; white-space: pre; ">HttpServletResponse topLevelResponse = CmsFlexController.getController(request).getTopResponse();</span><br><div><br></div><div>But calls to modify the headers on topLevelResponse don't seem to be taking effect.</div><div><br></div><div>Any pointers?</div><div><br></div><div>-Mike</div><div><br><div><div>On Jun 15, 2009, at 5:01 PM, Stephan Hartmann wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Hi Mike,<br><br>the reason why your attempts for setting the content type by either <br>using the response object or the contentType attribute in the page <br>directive is that the JSP is usually embedded by using the include <br>dispatcher of the request. From within an included webapp resource <br>(either servlet or JSP or filter) there is no way to modify response <br>headers, as defined in the servlet spec.<br>For your case, it would be sufficent to set the cache property of your <br>JSP to "bypass" which will lead to a forward instead of an include, what <br>will give you control over your response headers as well. Note that you <br>will lose flex cache functionality with that property set.<br>Another way to set response headers from an included JSP would be to get <br>hold of the top response object through the CmsFlexController object of <br>your request.<br><br>Regards,<br>Stephan<br><br>Mike Dikan schrieb:<br><blockquote type="cite">I have need for a jsp that spits out dynamic javascript called  <br></blockquote><blockquote type="cite">something like javascript_dynamic_variable_init.jsp.  In opencms, if  <br></blockquote><blockquote type="cite">you have a file on the vfs that has extension .js, the content-type  <br></blockquote><blockquote type="cite">header that is returned is of type 'application/x-javascript', and if  <br></blockquote><blockquote type="cite">you have a file that ends in extension .jsp, the content-type header  <br></blockquote><blockquote type="cite">is 'text/html'.  I need to change the content-type header returned for  <br></blockquote><blockquote type="cite">a file ending in .jsp to the .js header, but any attempts to do so  <br></blockquote><blockquote type="cite">either by using the <%@page contentType="" %> tag, or operating on the  <br></blockquote><blockquote type="cite">response directly is clobbered by opencms.  Does anyone know how to do  <br></blockquote><blockquote type="cite">this in opencms 7.0.5?<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">And to head off any questions, i can't rename the file to .js, because  <br></blockquote><blockquote type="cite">the file needs to be brought in as a jsp opencms 'type' via the  <br></blockquote><blockquote type="cite">synchronize functionality, which will only create types based on file  <br></blockquote><blockquote type="cite">extensions, as far as I know.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Thanks!<br></blockquote><blockquote type="cite">-Mike<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">_______________________________________________<br></blockquote><blockquote type="cite">This mail is sent to you from the opencms-dev mailing list<br></blockquote><blockquote type="cite">To change your list options, or to unsubscribe from the list, please visit<br></blockquote><blockquote type="cite"><a href="http://lists.opencms.org/mailman/listinfo/opencms-dev">http://lists.opencms.org/mailman/listinfo/opencms-dev</a><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><br><br>_______________________________________________<br>This mail is sent to you from the opencms-dev mailing list<br>To change your list options, or to unsubscribe from the list, please visit<br><a href="http://lists.opencms.org/mailman/listinfo/opencms-dev">http://lists.opencms.org/mailman/listinfo/opencms-dev</a><br></div></blockquote></div><br></div></div></body></html>