0

I have the following URL:

/login.xhtml?tipo=ind

I am trying to access the GET request parameter using the following code:

Map<String, String> parameterMap = (Map<String, String>) FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap();
String tipo = parameterMap.get("tipo");

It is displaying null. I am doing all of this on my login bean which is working correctly. Not sure why I can't access the GET request parameter.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
Erick
  • 823
  • 16
  • 37
  • http://www.mkyong.com/jsf2/4-ways-to-pass-parameter-from-jsf-page-to-backing-bean/ – Mahendran Ayyarsamy Kandiar Dec 01 '15 at 23:44
  • @BalusC thank you sir. Sorry for the confusion. It makes a lot of since the changes you made to the question! Now why is the code not able to get the request? – Erick Dec 02 '15 at 15:09
  • 2
    No idea. This is not the default behavior. The cause is not visible in the information provided so far. So we can only make educated guesses. I'd rather not waste time on this. I can at most suggest you to test this on a completely blank scratchpad project with everything set to bare defaults and using most recent versions. – BalusC Dec 02 '15 at 15:10
  • Later today I am going to upload the code for my Login bean which is where I am trying to access the GET parameter. It might be that I am trying to access it at the wrong time – Erick Dec 02 '15 at 15:12
  • 2
    As long as you can make sure that the question is formulated in such way that exactly your problem is reproducible for anyone else in the world when starting off with a completely blank scratchpad project with everything set to bare defaults and using most recent versions, unless explicitly otherwise mentioned in the question. See also a.o. http://stackoverflow.com/tags/jsf/info This way you'll surely get the right answer. – BalusC Dec 02 '15 at 15:17

0 Answers0