Wednesday, 21 August 2013

why getQueryString() does not work in jsf backing bean with h:commandButton

why getQueryString() does not work in jsf backing bean with h:commandButton

I have build a login snippet of code that is on the top of menu bar. If a
user is in any of the page by navigating and presses all of sudden the
login button, I'll like to see that person authenticated and at the same
time stay on the page where he originally comes from. so I used this on
the backing bean:
HttpServletRequest request = (HttpServletRequest)
FacesContext.getCurrentInstance().getExternalContext().getRequest();
then if there is let say mypage.htm?a=2&b=2 get a=2&b=2 with the
request.getQueryString()
but getQueryString returns null, how can I can have the original URL
entirely from the backing bean?

No comments:

Post a Comment