I edited my question to be more precise, as I have more time to write it.
I have a JSF form that should change the meaning of various properties of a dog:
<h:form id="submit">
<h:outputLabel value="Dog name:"/>
<h:inputText value="#{User.dog.name}" id="dogName"/>
<h:outputLabel value="Name :"/>
<h:inputSecret value="#{User.name}" id="name" />
<h:commandButton type="submit" value="Submit" />
</h:form>
This is my managed bean User.java: (All getters and setters are good and valid, as this bean constructor is empty). (Initially, the Dog property is initialized in the verification method, so it matters and not null)
public class User {
public User() {}
String name;
Dog dog;
(...get, set, ect...)
This is another bean that I have not installed, since it is used only by the User class
Dog.java:
public class Dog{
public User() {}
String dog_name;
(...)
This means that this is a simple example for understanding things.
When I submit the form, the property User.namewill be updated, but not the property User.dog.name.
How to update both values of Java classes?
, User.name:
System.out.println(User.name);//
System.out.println(User.dog.name);//
, , Dog JSF althouth. Dog bean , User.Dog...
, faces-config :
:
bean. , ...
<managed-property>
<property-name>dog</property-name>
<property-class>package.Dog</property-class>
<value>#{Dog}</value>
</managed-property>