tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Masataka Kurihara <kurih...@gluegent.com>
Subject Re: RequestContext#getHeader(String)
Date Thu, 15 Jan 2004 00:55:35 GMT
Thanks for your replying,

  I see, ofcource we can get HttpServletRequest object from
RequestContext and I seem too, Tapestry's APIs will grow
up.

> no need to extend the interface for RequestContext itself.
                                                     ~~~~~~
Please tell me "itself" means(sorry, I'm not native English
speaker, I can't understand your easy word means). Will you
delete getParameter*(*) methods from RequestContext? Or will
you move getParameter*(*) and create getHeader*(*) methods 
in IRequestCycle? or do nothing in this matter?

Regards,
Masataka Kurihara

> The origional idea behind RequestContext was to bundle up HttpServletRequest, HttpServletResponse
> and HttpSession together so that we could pass a single facade object around as a parameter,
rather
> than all three. As Tapestry grew, IRequestCycle ended up wrapping around RequestContext.
Because the
> facade is transparent (you can get from IRequestCycle to RequestContext to HttpServletRequest)
> there's no need to extend the interface for RequestContext itself.
> 
> The best APIs are the leanest, and Tapestry is (to my mind) a little too fat (reflecting
my growing
> experience in Java over the last four years).
> 
> --
> Howard M. Lewis Ship
> Independent J2EE / Open-Source Java Consultant
> Creator, Tapestry: Java Web Components 
> http://jakarta.apache.org/tapestry/
> http://javatapestry.blogspot.com
> 
> > -----Original Message-----
> > From: Masataka Kurihara [mailto:kurihara@gluegent.com] 
> > Sent: Tuesday, January 13, 2004 9:53 PM
> > To: tapestry-dev@jakarta.apache.org
> > Subject: RequestContext#getHeader(String)
> > 
> > 
> > Hellow,
> > 
> >  I want org.apache.tapestry.request.RequestContext
> > #getHeader(String):String, #getHeaders(String):Enumeration
> > and getHeaderNames():Enumeration. 
> > 
> > 
> >  I am switching my own company's web site from Cocoon2
> > to Tapestry3 now.
> > This web site will be for Windows users, *nix users
> > and Mac users. So site design is adjusted by using multiple
> > css.
> >  I think that selecting css needs HTTP request header
> > "User-Agent". I am coding follow in page object because
> > org.apache.tapestry.request.RequestContext has not 
> > how to get request-headers directly.
> > --
> > import javax.servlet.http.HttpRequest; //<-- Wmmm.
> > public IAsset getStylesheet() {
> >   HttpRequest req = getPage().getRequestCycle()
> >     .getRequestContext().getRequest();
> >   String agent = req.getHeader("User-Agent");
> >   ......
> > }
> > --
> >  Tapestry wraps all other useful Servlet API and Spindle
> > make default project which has not servlet*.jar. I think that
> > RequestContext must have getter methods for request-header.
> > (#setHeader(String, String) and #addHeader(String, String)
> > needs???)
> > 
> > Thanks,
> > Masataka Kurihara
> > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
> > 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org


Mime
View raw message