• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to obtain parameters from request  RSS feed

 
Vinicius Carvalho
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello there! How do I obtain parameters from the request and set it on my managed bean properties? for eg.

I have a managed bean:



When the user is editing the page the info comes from the DB, but there's also a situation where it would come from an URL:

host/regiseter.jsf?name=john&age=31

so I'd like to have my user property filled with those values on my managed bean, and the values displayed on my <h:inputText>

how can I do this?

Regards
 
Sergey Smirnov
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
using faces-config.xml is a simplest way. You can also take the parameters from the external context.


take a look at:
http://www.jsffaq.com/Wiki.jsp?page=HowToSetAManagedBeanPropertyFromTheRequestParameter
http://www.jsffaq.com/Wiki.jsp?page=HowToPassAParameterToTheJSFApplicationUsingTheURLString

--
Sergey : http://jsfTutorials.net
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!