Bug 299813 - [JSF2.0] - new Implicit Objects defined for use in EL expressions
Summary: [JSF2.0] - new Implicit Objects defined for use in EL expressions
Status: RESOLVED FIXED
Alias: None
Product: Java Server Faces
Classification: WebTools
Component: JSF Tools (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: 3.2 RC1   Edit
Assignee: Gerry Kessler CLA
QA Contact: Cameron Bateman CLA
URL:
Whiteboard: PMC_approved JSF2.0 post-m6-exception
Keywords:
Depends on:
Blocks:
 
Reported: 2010-01-15 15:44 EST by Xiaonan Jiang CLA
Modified: 2017-12-19 13:27 EST (History)
4 users (show)

See Also:
david_williams: pmc_approved+
raghunathan.srinivasan: pmc_approved? (naci.dai)
raghunathan.srinivasan: pmc_approved? (deboer)
raghunathan.srinivasan: pmc_approved? (neil.hauge)
raghunathan.srinivasan: pmc_approved? (kaloyan)
raghunathan.srinivasan: review?
raghunathan.srinivasan: review+


Attachments
Proposed solution (36.36 KB, patch)
2010-05-10 14:21 EDT, Gerry Kessler CLA
no flags Details | Diff
Updated solution (63.46 KB, patch)
2010-05-12 17:58 EDT, Gerry Kessler CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Xiaonan Jiang CLA 2010-01-15 15:44:25 EST
Build Identifier: wtp 3.2

JSF 2.0 - new Implicit Objects defined for use in EL expressions

Reproducible: Always

Steps to Reproduce:
In JSF 2.0, there defined several new keywords. Need to update the variable/property resolvers to handle them for the content assist/validation.

The keywords are:

    resource
    cc.attrs.
    cc.clientId
    viewScope
    flash
Comment 1 Cameron Bateman CLA 2010-01-19 13:31:45 EST
It appears that "component" is also new in 2.0:

resource -- the current resource handler from facesContext.getApplication().getResourceHandler().

component -- the last component pushed on the component stack using UIComponent.pushComponentToEL()

cc -- the component returned from
UIComponent.getCurrentCompositeComponent()

viewScope -- scope map for the new "View Scope". facesContext.getViewRoot().getViewMap()

flash -- scope map for the new "Flash Scope".
getExternalContext.getFlash()
Comment 2 Cameron Bateman CLA 2010-02-05 20:47:40 EST
> component -- the last component pushed on the component stack using
> UIComponent.pushComponentToEL()
> 
> cc -- the component returned from
> UIComponent.getCurrentCompositeComponent()

Does anyone know if component and cc are exposed to the JSP PDL?  It seems like they exist only for Facelets and the spec is confusing as to which resolver exposes them.  They seem to come back null in my testing.

> flash -- scope map for the new "Flash Scope".

This is actually not a map but a Flash object that has a map and redirect flag.  Does anyone know if there is a way for a JSFDeveloper to put a variable into this scope except programmatically?  Managed beans can't be declared with these scopes either in faces-config or by annotation.  Nor can I find any tags in the basic runtime that allow it.

Does it makes sense to provide design time support for this beyond declaring an IObjectSymbol of type javax.faces.context.Flash?
Comment 3 Yury Kats CLA 2010-02-08 10:30:11 EST
The spirit of JSF2 is that everything new is available in Facelets only. JSP layer is maintained for backwards compatibility w/o any improvements.
Comment 4 Yury Kats CLA 2010-02-08 10:34:29 EST
My understanding is that Flash scope can be accessed programmatically (using ExternalContext.getFlash() API) or via EL expressions (using #{flash} implicit object).
Comment 5 Bob Gallagher CLA 2010-03-02 16:42:52 EST
Sorry, I do not mean to be a pest but where does this stand for making it into 3.2. Could it be targeted to particular milestone?
Comment 6 Cameron Bateman CLA 2010-03-02 16:51:01 EST
(In reply to comment #5)
> Sorry, I do not mean to be a pest but where does this stand for making it into
> 3.2. Could it be targeted to particular milestone?

It will be in 3.2.  It remains to be seen if we can make it for M6.  We are looking to integrate basic Facelet stuff, the 2.0 facet and anything we have existing code (including IBM patches) for M6.
Comment 7 Cameron Bateman CLA 2010-04-28 18:11:30 EDT
We will need to short list for RC1.  I think it's fairly straight-forward, low risk change that is purely additive and won't impact UI or API.
Comment 8 Gerry Kessler CLA 2010-05-10 14:21:25 EDT
Created attachment 167775 [details]
Proposed solution

Adds JSF 2.0 symbols to the default symbol provider, and variable resolver ensuring that they are not present in a JSF1.x context.   JUnits included.
Comment 9 Gerry Kessler CLA 2010-05-12 17:58:57 EDT
Created attachment 168284 [details]
Updated solution
Comment 10 Raghunathan Srinivasan CLA 2010-05-12 19:38:03 EDT
* Explain why you believe this is a stop-ship defect. Or, if it is a "hotbug"
(requested by an adopter) please document it as such. 
Without the fix, the user will see incorrect validation warnings when using the new implicit symbols introduced in JSF 2.0 in an EL. Also, content assist will not list these symbols.
* Is there a work-around? If so, why do you believe the work-around is
insufficient? 
No workaround for Content Assist. Validation markers can be suppressed using preference setting, but this turns off other useful validations too. 
* How has the fix been tested? Is there a test case attached to the bugzilla
record? Has a JUnit Test been added? 
Patch includes JUnit tests
* Give a brief technical overview. Who has reviewed this fix? 
See description and comment 8. Cameron has reviewed the fix.
* What is the risk associated with this fix? 
low.
Comment 11 Raghunathan Srinivasan CLA 2010-05-13 00:01:05 EDT
Patch released to HEAD
Comment 12 Eclipse Genie CLA 2017-12-18 20:15:37 EST
New Gerrit change created: https://git.eclipse.org/r/114217