Skip to content
This repository has been archived by the owner on Sep 5, 2023. It is now read-only.

Support @Inject for FacesContext #527

Closed
glassfishrobot opened this issue Feb 23, 2009 · 17 comments
Closed

Support @Inject for FacesContext #527

glassfishrobot opened this issue Feb 23, 2009 · 17 comments

Comments

@glassfishrobot
Copy link

To get the FacesContext in a managed bean you need to do as follow :

FacesContext ctx = FacesContext.getCurrentInstance();

It would be nice to get this context injected such as :

@resource
private FacesContext ctx;

That's the way EJBs and other components handle their context.

Environment

Operating System: All
Platform: All

Affected Versions

[2.0]

@glassfishrobot
Copy link
Author

Reported by agoncal@java.net

@glassfishrobot
Copy link
Author

Issue-Links:
blocks
JAVASERVERFACES_SPEC_PUBLIC-1316
is blocked by
JAVASERVERFACES-3416
is related to
JAVASERVERFACES_SPEC_PUBLIC-1305

@glassfishrobot
Copy link
Author

@edburns said:
Move to unscheduled target milestone

@glassfishrobot
Copy link
Author

@edburns said:
Prepare to delete "spec" subcomponent.

@glassfishrobot
Copy link
Author

lincolnbaxter said:
Categorized as part of Rev 2.0 A prep

@glassfishrobot
Copy link
Author

@edburns said:
By the way, for managed beans you currently can get this injected. Like this:

@ManagedProperty(value="#

{facesContext}

")
private FacesContext facesContext;

@ManagedProperty(value="#

{requestScope}

")
private Map<String, Object> requestMap;

@ManagedProperty(value="#

{sessionScope}

")
private Map<String, Object> sessionMap;

Granted this is only for Managed Beans. I think the real issue is: How to
leverage injection to minimize the occurrence of painful code such as
FacesContext.getCurrentInstance().getExternalContext().getFlash().get("foo")

I have updated the subject.

@glassfishrobot
Copy link
Author

rogerk said:
cat2 - if we are to incorporate alternate approach as well

@glassfishrobot
Copy link
Author

@edburns said:
from

@glassfishrobot
Copy link
Author

@edburns said:
These are targeted at 2.1.

@glassfishrobot
Copy link
Author

@edburns said:
triage

@glassfishrobot
Copy link
Author

@edburns said:
edburns

@glassfishrobot
Copy link
Author

@edburns said:
GlassFish 3.1 M6 at the latest.

@glassfishrobot
Copy link
Author

@edburns said:
Move these to 2.2

@glassfishrobot
Copy link
Author

@edburns said:
Set priority to baseline ahead of JSF 2.3 triage. Priorities will be assigned accurately after this exercise.

@glassfishrobot
Copy link
Author

@manfredriem said:
Setting priority to Critical

@glassfishrobot
Copy link
Author

Marked as fixed on Thursday, October 9th 2014, 1:11:10 pm

@glassfishrobot
Copy link
Author

This issue was imported from java.net JIRA JAVASERVERFACES_SPEC_PUBLIC-527

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants