On Friday 12 August 2005 09:22, Craig McClanahan wrote:
> On 8/12/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> > It looks like the implicit Object map is missing the following:
> >
> > application
> > request
> > session
>
> Personally, I would suggest that we *not* try to make implicit
> variables for these objects. The main reason is that they will be
> different in a servlet and in a portlet environment, and you're likely
> to write code that binds you to one environment or the other. You
> should strive to acquire anything you need via the ExternalContext
> API. (It would also be a potential backwards compatibility issue to
> reserve these names in 1.2 when they weren't reserved in 1.0/1.1.)
I completely agree with Craig. It is not that often that one needs the request
object itself, and getting request.params should be done through
requestScope.
> > > > I don't see a "request" predefined object. I see "requestScope"
> > > >
> > > > Shouldn't there be a predefined object "request" that would return
> > > > the HttpServletRequest object....that "requestScope" just returns the
> > > > requestMap...I would think the resolver would resolve the "request"
> > > > variable to the HttpServletRequest somewhere in there but it doesn't
> > > > look that way...
According to the spec, there is no "request" implicit object.
> > > > > > > no, what you are trying to do is *exactly* correct. the only
> > > > > > > problem is that 'request' isn't being resolved by MyFaces.
> > > > > > >
> > > > > > > when you say 'request', you are getting the request object
> > > > > > > (HttpServletRequest) and can access any of its bean properties,
> > > > > > > including 'serverName'.
What you see as "request" in VariableResolverImpl is the scope name used in
the config file for Managed Beans.
This is not an implicit object, and if used in a Value Binding would return
null, not HttpServletRequest. See Craig's second email on how to access the
HttpServletRequest itself.
> > > > > > > when you say 'requestScope', you are getting the request's
> > > > > > > attribute map... same as request.getAttribute(name).
> > > > > > >
> > > > > > > Galen Dunkleberger wrote:
> > > > > > > >so am I way off base here trying to call #{request.serverName}
> > > > > > > > since that's an actual propeties of the request object and
> > > > > > > > not in the attribute map? If so I guess there is no easy way
> > > > > > > > to get to the request object except wrapping it in a managed
> > > > > > > > bean or something.
Regards,
Anton