3 Replies Latest reply on May 14, 2004 8:14 AM by Andreas Holtmann

    Negotiating the content type

    Andreas Holtmann Newbie

      Hi I'm a JBosss midbie, and have an application serving HTML, xHTML, iMode and WML :-/ content, all from the same JavaCode / Database. So far, everything works except for WML, which I found out negotiates HTTP content "text"/html". That makes the WML browser reject the pages. Does anybody know whether I can make JBoss negotiate the content type, or is it anywhere stored in some of the XML files for JBoss configuration?

      Thanks alot,
      Andreas

        • 1. Re: Negotiating the content type
          Steve Lewis Expert

          Can you not override the content type in the servlet API? Or are you having JSPs generate WML? I think there's a JSP tag you can use to set the content type.

          It's probably just defaulting, but you *should* be able to override it. I haven't tested it.

          • 2. Re: Negotiating the content type
            Andreas Holtmann Newbie

            Hi thanx for the answer. I have a second, similar application, where I don't have to negatiate content types. The JSP pages have a top index.jsp and that calls a method:

            String contextPath = request.getContextPath();
            request.getRequestDispatcher("/[start].do").forward(request, response);
            (Struts StartAction.java, leading to WML start.jsp, which is a preface page to index.jsp)

            That works 100% with my other application, but not here with the second one. So Ethereal network analyzer tells me "content-type text/html" before that start.jsp comes alive, and nowhere in my application I set it to html, so that's strange. Could it be a default value?

            I would be very glad if anyone can give me a hint on that issue ;-))

            Thanks alot,
            Andreas

            • 3. Re: Negotiating the content type
              Andreas Holtmann Newbie

              Hi,

              thanx and I have found out myself: I have to set the content type with a line like this in the preface:

              <%@ page contentType="text/vnd.wap.wml" %>

              Otherwise, it points to the defaults, which is html.

              So I can sleep better now ;-)))

              Andreas