Kumar Mettu

Greenhorn
+ Follow
since Mar 01, 2008
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Kumar Mettu

Bauke,

Please see last line of my message about PhaseListner and Servlet Filter.
Also I am not trying to spam. I am returning to JavaRanch after 1999-2000 again and still haven't gotten used to JavaRanch.
Thanks for the Tip.

Kumar.

Bauke Scholtz wrote:I don't recommend this approach.

If he is indeed trying to get the FacesContext inside a Filter, then there's a flaw in his design and he need to elaborate why he needs the FacesContext. If it is just for accessing managed beans or some other scoped attributes or some other stuff made available by request, session and application, he could perfectly use the (Http)ServletRequest for this which is already available inside a Filter.

By the way, why are you spamming an irrelevant link to your blog in every post? If you like to share it with others and want to increase your traffic, just place it in your signature.

13 years ago
JSF
Remko,

I am assuming you are trying to access FacesContext in ServletFilter. This is where you would FacesContext as null since CurrentFacesContext is set in FacesServlet and Pre Filters are invoked before FacesServlet.
There are known ways of solving this. Best way is discussed here:
http://www.thoughtsabout.net/blog/archives/000033.html

Also you might want to check if you want to use ServletFilter or PhaseListener for your problem.

Kumar.
javaswany.blogspot.com


Remko Strating wrote:I had a problem where sometimes the FacesContext.getCurrentInstance() returns null.

In a thread I've read that adding the listener com.sun.faces.config.configureListener could solve this issue.

I tried to found the exact function of this listener but could not find a good answer.

Maybe someone could give me some information or a hint where to find.

Thanks in advance.

13 years ago
JSF
Rajendra,

403 error code indicates that your request has reached server but server won't let you access this service. Why server would not let you access service can be due to many reason depending on the server you are trying to access. Best Advise I can give you without knowing your server is to check the URL and make sure you are using the right URL to post your request to.

Kumar.

rajendhar gangoni wrote:hi,

while iam calling the webservice method from a standalone java application. i am getting error on the console saying

any help can be appreciated

Thanks & Regards,
RAjendra

13 years ago
Abiodun,

With the information you provided, it appears to be a Filter's Job. Reason being you are intercepting requests before servlet processing them to validate user is authenticated. Ajax call might happen after session expired (because user is idle on the page for an hour and an action triggered Ajax call) and this would need proper session expiry notification to frontend.

Hope this helps,

Kumar.
javaswamy.blogspot.com

Abiodun Adisa wrote:Yes its doing an authentication check

13 years ago
ULF,

Depends on what you really want to Schedule. If you are looking at Scheduling a native job, Look for Cron Job. If you need to schedule a piece of java code as part of your application look at java.util.Timer and java.util.TimerTask. IF you need a JEE based scheduler look at Timer Service.

There are several java based products (both open source and commercial) that can help you with scheduling requirements. Couple of there are:
Quartz(Open Source): http://www.opensymphony.com/quartz/
Flux(commercial): http://www.fluxcorp.com/

Hope this helps.
Kumar.

javaswamy.blogspot.com


vinoth thirunavukarasu wrote:Hi,
I want to schedule a program for the specified time only. How can I do that so.

13 years ago
Akash,

Thats not how NDC works. You need to use NDC (Push and POP) per request not for whole session.

Kumar.