tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Cox, Charlie" <c...@cincom.com>
Subject RE: Using filters to transform output
Date Mon, 09 Dec 2002 18:29:31 GMT
you may want to look at the compression filter examples the come with
tomcat.

Charlie

> -----Original Message-----
> From: Andreas Hucks [mailto:andreas@duochrome.de]
> Sent: Monday, December 09, 2002 5:34 AM
> To: tomcat-user@jakarta.apache.org
> Subject: Using filters to transform output
> 
> 
> Hi,
> 
> I have an existing PHP application I want to port to Java 
> servlets (I am an
> experienced programmer, but new to Java servlets). It is 
> basically an admin
> interface for managing user accounts for community sites. To 
> keep this as
> flexible and true to a MVC-pattern as possible, I figured I'd have my
> servlet generate a custom response object from a custom 
> request object. I
> then would write filters to translate the request parameters 
> to my custom
> request and on the way back, create the actual output from my custom
> response. This way I should be able to make the same app 
> usable by different
> clients by just throwing in another filter (required client 
> types at the
> moment are (X)HTML, Flash/XML, and Flash/FlashRemoting).
> 
> From what I understand, this is one of the main uses of 
> filters. My question
> is, how do I pass the custom request/response objects between 
>  my filters
> and the servlet? I guess it involves 
> HttpServletResponseWrappers, but I
> can't figure out how (you can overwrite getWriter() and such, 
> but that is of
> no use to me). What I would need is to attach my result as a 
> generic object
> to the HttpServletResponse, and have my filter retrieve it, 
> format it, and
> write the response to the client.
> 
> I can do the above by having my servlet output XML, and then having my
> filter transform the XML to the actual output. But this seems to be
> unnecessary overhead to me (unless I want to use XSLT anyway, which I
> don't).
> 
> Thanks,
> Andreas
> 
> 
> --
> To unsubscribe, e-mail:   
<mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:tomcat-user-help@jakarta.apache.org>

--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message