voyent
ICEFaces 1.8.2 wraps HttpServletRequest disallowing Servlet 3 functionality  XML
Forum Index -> General Help
Author Message
thomasa

Joined: 23/Apr/2014 02:28:34
Messages: 3
Offline


When running JSF 1.2, it should be possible to get at the actual HttpServletRequest by calling FacesContext.getCurrentInstance().getExternalContext().getRequest(). However, in ICEFaces 1.8.2 the original request is wrapped by an anonymous inner class which is a ServletEnvironmentRequest. This class _does_ implement HttpServletRequest, but since getRequest() does not return the _actual_ underlying HttpServletRequest, it cannot use features when running in a Servlet 3 environment (such as the very important login() method).

I have changed the source locally to add a method that actually returns the original request to get around this, but isn't the purpose of the getRequest() method to get access to the real runtime, and not a (limiting) wrapper?
thomasa

Joined: 23/Apr/2014 02:28:34
Messages: 3
Offline


Just to follow up. From the specification:

getRequest()
Return the environment-specific object instance for the current request.

Returning a wrapper is probably not "environment-specific"?
ted.goddard

Joined: 26/Oct/2004 00:00:00
Messages: 874
Offline


ICEfaces 1.8 is much older than Servlet 3, so a good option would be to upgrade to ICEfaces 4.

The ServletEnvironmentRequest helps adapt between Servlet, Portlet, and Asynchronous push lifecycles, so there are complexities outside the Servlet case that lead to this. Another option would be to contact product.support@icesoft.com with an enhancement request.
[Email]
thomasa

Joined: 23/Apr/2014 02:28:34
Messages: 3
Offline


Hi Ted.

Yes, migrating is definitely a better option, just wondering about the behavior of 1.8 since the spec-defined ExternalContext was meant to address precisely these cases, if I am not mistaken. (Direct access to the environment-specific request).
ted.goddard

Joined: 26/Oct/2004 00:00:00
Messages: 874
Offline


This is true, although ICEfaces 1.8 creates a virtual request/response for push requests, which isn't covered by the spec. ICEfaces 2 replaced this behaviour with push notification causing a standard JSF request and no longer makes use of custom ViewHandler or ExternalContext classes.
[Email]
 
Forum Index -> General Help
Go to:   
Powered by JForum 2.1.7ice © JForum Team