-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Eric,

Eric B. wrote:
| Multiple reasons, one main one primary one being that we have styles
defined
| on a per-user basis, stored in a database.  So rather than generate an
| entire CSS file on the fly, this allows us to display certain
customizations
| to the styles without any major hassles.

FWIW, I would have written a plain-old servlet to grab the user-specific
CSS and just dump it to the output stream. Since the JSP isn't really
needed to generate content, why complicate things with a JSP? Not that
it really matters, but you /are/ finding yourself having to code around
these issues...

| My
| immediate thought, however, would be to subclass the HttpServletResponse
| class and ignore the setContentType() and equv setHeader(
"Content-Type"...)
| methods if they have already been set by my filter or something like
that.
| I'm not sure what you mean by HttpServletRequestFilter, or if you mean
| exactly the same thing that I just described.

Er, I think I meant HttpServletResponseWrapper (not ...Filter).
HttpServlteResponse is an interface, not a class, so you can't subclass
it. You'd have to implement the entire interface, which can be tedious.
The HttpServletResponseWrapper is part of the servlet spec and was
written for just this purpose: wrapping an existing request, and
overriding just a few of the methods. All the other methods just call
_wrappedResponse.whatever(). It's exactly what you're looking for.

You'd end up doing something like this:

public void doFilter(...)
{
~    response.setContentType("text/html; charset=utf8");

~    chain.doFilter(request, new IgnoreContentTypeResponse(response));
}

...and then you write the IgnoreContentTypeResponse class as a subclass
of HttpServletResponseWrapper.

Hope that helps,
- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkeWD5kACgkQ9CaO5/Lv0PAh6ACfYJhTRBdI0+NmK1V2N/lDlOai
X94An0KScjXo2pGD5nmIyAMdmfIfHftv
=79YX
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to