tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From talley_angel...@emc.com
Subject Web Start and Tomcat 4.1.29 after upgrade
Date Fri, 16 Apr 2004 21:24:26 GMT
Hello! We have a simple servlet that basically just queries a few things off
of the HttpServletRequest and spits back a dynamically generated JNLP file
for Java Web Start. For some reason, when we were running with Tomcat 4.0.6
this worked fine, but with the upgrade to Tomcat 4.1.29 it does not. IE
always prompts to open or save the file - it never just launches JWS
automatically anymore. Currently, we basically just use Tomcat 4.1.29 right
out of the box, no special modifications.

Any suggestions on what we can fix? I'll put the interesting parts of the
servlet below. Notice I already set the content type and turn on caching.
But, could I possibly do more? Or is it a Tomcat configuration problem? I
noticed Tomcat often appends the charset to a content type - is there some
way to avoid that?

Thanks in advance!

-Angelina Talley

public class JNLPServlet extends HttpServlet{

public void doGet(HttpServletRequest request, HttpServletResponse response) 
throws IOException, ServletException {
    try { 
        response.setHeader("Cache-Control", "public");
        response.setContentType("application/x-java-jnlp-file"); 

        String sessionId = getSessionId(request);
        ServletOutputStream out = response.getOutputStream();

        java.net.InetAddress[] hostNetAddrs = 
        java.net.InetAddress.getAllByName(request.getServerName());
        String hostIpAddr = hostNetAddrs[0].getHostAddress();
        out.println(generateJNLP(sessionId, request.getServerName(),
                    hostIpAddr, request.getRemoteUser()));
        out.flush(); 
    }
    catch (IOException ex) {
        response.sendError(javax.servlet.http.HttpServletResponse.
                           SC_SERVICE_UNAVAILABLE, ex.getMessage());
    }
    catch (Exception ex) {
        response.sendError(javax.servlet.http.HttpServletResponse.
                           SC_INTERNAL_SERVER_ERROR, ex.getMessage());
    }
}
...
}


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message