I am creating a landing page and I want to pass my retrieved submited data to my service layer.
My Service layer looks like that:
@Component
@Scope("session")
public class LandingPageService implements Serializable{
/**
* landingPageDAO
*/
@Autowired
private LandingPageDAO landingPageDAO;
/**
* LandingPage Instance
*/
private LandingPage instance = null;
public LandingPage getInstance() {
logger.trace("returning instance...");
if(instance == null) {
instance = new LandingPage();
}
return instance;
}
/**
* writes the LandingPage Domain Object into the DB
*/
public void persist() {
logger.trace("persisting...");
landingPageDAO.persist(instance);
instance = null;
}
and my form looks like that:
<h:form class="homepage_invitee_form" action="" method="POST">
<h:inputText required="true" value="#{landingPageService.instance.userEmail}" name="email" placeholder="Email Address"
id="email_address_new" type="text placeholder" />
<p:watermark for="email_address_new" value="Email Address" />
<br />
<h:inputText required="true" value="#{landingPageService.instance.firstName}" name="firstName" placeholder="First Name"
id="firstname_new" type="text placeholder" />
<p:watermark for="firstname_new" value="First Name" />
<h:button value="Request Invitation" type="submit"
styleClass="btn btn-primary opal_btn" id="submit_form_new"
action="#{landingPageService.persist()}"/>
</h:form>
When I press submit my form does not get handeled. I cannot even see my logging messages. Any ideas, what I have to change?