Setting the content type when using Generator with Middle Ware
Generator can use middle ware as a data source in the same way that it can use a text file as a data source.
If you use this technique, then you have to set the correct content type so that your middle ware returns a text file, and not an html page.
Here is how to set the content type in various middle ware languages :
- ASP : response.contentType = “text/plain”
- Java Servlet : javax.servlet.http.HttpServletResponse.setContentType(“text/plain”);
- JSP : <%@ page contentType=“text/plain”%>
- PHP : Header(“Content-Type:text/plain”);
- Cold Fusion :
- Perl / CGI : print “ContentType:text/plain”;
The only requirement is that you set the content type before you write anything (including blank spaces) to the browser or Generator.
Tags: