Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support @Inject for FacesContext #527

Closed
eclipse-faces-bot opened this issue Feb 23, 2009 · 18 comments
Closed

Support @Inject for FacesContext #527

eclipse-faces-bot opened this issue Feb 23, 2009 · 18 comments

Comments

@eclipse-faces-bot
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]

@eclipse-faces-bot
Copy link
Author

@glassfishrobot Commented
Reported by agoncal@java.net

@eclipse-faces-bot
Copy link
Author

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

@eclipse-faces-bot
Copy link
Author

@glassfishrobot Commented
@edburns said:
Move to unscheduled target milestone

@eclipse-faces-bot
Copy link
Author

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

@eclipse-faces-bot
Copy link
Author

@glassfishrobot Commented
lincolnbaxter said:
Categorized as part of Rev 2.0 A prep

@eclipse-faces-bot
Copy link
Author

@glassfishrobot Commented
@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.

@eclipse-faces-bot
Copy link
Author

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

@eclipse-faces-bot
Copy link
Author

@glassfishrobot Commented
@edburns said:
from

@eclipse-faces-bot
Copy link
Author

@glassfishrobot Commented
@edburns said:
These are targeted at 2.1.

@eclipse-faces-bot
Copy link
Author

@glassfishrobot Commented
@edburns said:
triage

@eclipse-faces-bot
Copy link
Author

@glassfishrobot Commented
@edburns said:
edburns

@eclipse-faces-bot
Copy link
Author

@glassfishrobot Commented
@edburns said:
GlassFish 3.1 M6 at the latest.

@eclipse-faces-bot
Copy link
Author

@glassfishrobot Commented
@edburns said:
Move these to 2.2

@eclipse-faces-bot
Copy link
Author

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

@eclipse-faces-bot
Copy link
Author

@glassfishrobot Commented
@manfredriem said:
Setting priority to Critical

@eclipse-faces-bot
Copy link
Author

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

@eclipse-faces-bot
Copy link
Author

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

@eclipse-faces-bot
Copy link
Author

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

No branches or pull requests

1 participant