-
1. Re: FacesContext.getCurrentInstance() returns null within a Seam Remote method
ranjithk Jul 15, 2008 6:35 AM (in response to ranjithk)Had anyone faced such an issue?
I tried with LocaleSelector as well and it is the same problem.
-
2. Re: FacesContext.getCurrentInstance() returns null within a Seam Remote method
admin.admin.email.tld Jul 15, 2008 6:55 AM (in response to ranjithk)are you referring to @WebRemote? this exposes a session bean method to a javascript function for Seam remoting.
post your code.
-
3. Re: FacesContext.getCurrentInstance() returns null within a Seam Remote method
ranjithk Jul 15, 2008 7:27 AM (in response to ranjithk)yes, @WebRemote but I use it with a java bean, not a SB
The following is my code :- FacesContext.getCurrentInstance() returns null and localeSelector.select() also fails since it needs the FacesContext to set the language
@Name(
sdmChangeLanguageAction
)
public class ChangeLanguageAction {
@In
private LocaleSelector localeSelector;
@WebRemote
public void changeLanguage(String language){
try {
System.out.println(FacesContext.getCurrentInstance() );
localeSelector.selectLanguage(language);
// localeSelector.select();
} catch (RuntimeException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}}
-
4. Re: FacesContext.getCurrentInstance() returns null within a Seam Remote method
vickyz Sep 26, 2008 8:27 AM (in response to ranjithk)Did you solve the problem? I want to user FacesContext.getCurrentInstance() in @webRemote method too. But it's null alse.
If you have any solution about it, can you share with me?
Thanks
-
5. Re: FacesContext.getCurrentInstance() returns null within a Seam Remote method
kverheire Oct 6, 2008 10:42 AM (in response to ranjithk)I am having the same problem. Although I've been able to get it to work last week it nog longer works today.
Last week I figured that I had to set my Seam Filter mapping to the correct /seam/resource/ url-pattern but since it doesn't work any more I guess this was a fluke.Anyone ?
-
6. Re: FacesContext.getCurrentInstance() returns null within a Seam Remote method
benmoore Dec 18, 2008 5:13 PM (in response to ranjithk)Same problem here using Seam 2.1.0 GA. HELP!
-
7. Re: FacesContext.getCurrentInstance() returns null within a Seam Remote method
benmoore Dec 18, 2008 5:29 PM (in response to ranjithk)I understand WHY it's happening but not how to fix. Here's why:
In web.xml:
javax.faces.webapp.FacesServlet is mapped to *.seam, but Seam remoting calls are POSTed to /seam/resource/remoting/execute. That means a FacesContext is never setup for Seam Remoting HTTP requests.
-
8. Re: FacesContext.getCurrentInstance() returns null within a Seam Remote method
marx3 Dec 30, 2008 11:07 AM (in response to ranjithk)Look through seam documentation for section about servlets. There is information how to give Seam context for servlet.
-
9. Re: FacesContext.getCurrentInstance() returns null within a Seam Remote method
anban Apr 20, 2009 6:12 AM (in response to ranjithk)Did anyone find a solution to this? I am facing the same problem in my app.
Thanks in advance,
Anish -
10. Re: FacesContext.getCurrentInstance() returns null within a Seam Remote method
marx3 Apr 20, 2009 10:32 AM (in response to ranjithk)Have you read 29.1.4.8. Context management for custom servlets ?
-
11. Re: FacesContext.getCurrentInstance() returns null within a Seam Remote method
anban Jul 18, 2009 10:59 AM (in response to ranjithk)Thanks a lot for the pointer Marek.
I didn't get time to look into this for a long time. I tried that recently and it worked great. Your link along with the seamspace example helped me complete the job.
Thanks a lot again.
-
12. Re: FacesContext.getCurrentInstance() returns null within a Seam Remote method
nnkus Sep 13, 2009 7:38 PM (in response to ranjithk)I had that issue a while ago and figured out that it's related to the accessibility of request / session scope in the parent class.
For details read:
http://dcinformatics.com/home/blog.jsp#090911 -
13. Re: FacesContext.getCurrentInstance() returns null within a Seam Remote method
fkj Jun 1, 2011 4:55 PM (in response to ranjithk)In my case I was using FacesContext.getCurrentInstance() to access the application context, so changing to Contexts.getApplicatonContext() solved the problem.