I found the solution. For anyone finding this thread through a search engine,
just do this in struts.xml:

                <action name="SomeActionNme" class="org.MyActionClass">
                        <result type="freemarker">
                                application/xhtml+xml
                                /page.ftl
                        </result>
                </action>

I also tried <mime-mapping> entries in web.xml but those didn't seem to do
anything.

I don't believe Struts supports a mechanism to specify a global default
other than text/html or to support XHTML MIME type for browsers that support
it but HTML for browsers that don't (IE).


Kenton wrote:
> 
> With .jsp files, I can do:
> <%@ page contentType="application/xhtml+xml;charset=ISO-8859-1" %>
> With .jspx files, I can do:
> <jsp:directive.page contentType="application/xhtml+xml;charset=UTF-8"/>
> 
> What is the equivalent with FreeMarker (.FTL) templates?
> 
> Or for the ultimate, could I set a global MIME type for all freemarker/jsp
> files of "application/xhtml+xml" for browsers that indicate that that they
> can accept that, and fallback to "text/html" for browsers that can't (IE).
> 

-- 
View this message in context: 
http://www.nabble.com/How-do-I-set-MIME-type-with-FreeMarker-Templates--tf4424108.html#a12682231
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to