I want to learn that if I can define user input parameters at bean class and take these input parameters from a controller function with submit button :
for example input jsp :
<h:inputSecret value="#{control.userObj.pwrd}"></h:inputSecret>
   <开发者_JAVA百科;h:commandButton type="submit" value="Giris" action="#{control.check}">
</h:commandButton>
"User" bean class :
  private String userName;   (with getter and setter)
"Control" controller class :
 private User userObj;
When using nested bean properties, then you need to prepare it yourself so that JSF can call the setters on it. JSF/EL namely won't prepare them for you.
public class Control {
    private User userObj;
    @PostConstruct
    public void init() {
        userObj = new User();
    }
    // ...
}
This way #{control.userObj.userName} will work in input fields.
See also:
- JSF 2.0 Hello World - The Model, Controller and View
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论