hi lars,

return an instance of StreamResponse:

StreamResponse onActivate(String context) {
        return new StreamResponse() {
                // implement interface
                 public String getContentType() {
                        return"application/x-java-jnlp-file";
                }
        }
}

g,
kris



"Lars Kühne" <[EMAIL PROTECTED]> 
28.11.2007 15:33
Bitte antworten an
"Tapestry users" <users@tapestry.apache.org>


An
users@tapestry.apache.org
Kopie

Thema
T5: Controlling the content type in a page render request







Hi,

I'm trying to use a tml template to serve an XML file that has dynamic
content (in fact, a Java Web Start JNLP file):

<?xml version="1.0" encoding="utf-8"?>
<jnlp xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd";
  spec="1.5+"
...
</jnlp>

The content itself is rendered correctly, but I'm having problems
setting the correct content type for the response.

What I tried is this:

    @Inject
    private RequestGlobals requestGlobals;

    public void onActivate(String context) {
        // ... initialize internal state from context
        HttpServletResponse response = 
requestGlobals.getHTTPServletResponse();
        response.setContentType("application/x-java-jnlp-file");
    }

The response still comes out as text/html.

How can I convince Tapestry that the content type should be
application/x-java-jnlp-file?

Lars

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


Reply via email to