logo

JSF & PrimeFaces & Spring tutorial 11: JSF form tag

Using JSF form tag, saving data to database.

download result: https://app.box.com/s/fu7snxgachr84bd797mt

CheckListController:
private Check check = new Check();

public void save() {
	checkService.save(check);
}
CheckService:
public void save(Check check) {
	checkRepository.save(check);
}
index.xhtml:
<h:form>
	<p:panelGrid columns="2">
		name:
		<p:inputText value="#{checkListController.check.name}" />
		
		url:
		<p:inputText value="#{checkListController.check.url}" />
	</p:panelGrid>
	<p:commandButton value="save" action="#{checkListController.save()}" />
</h:form>

comments powered by Disqus

rss

Free online Java web application examples

Want to develop whole web applications which use database, security and more? See my github account, where are lot's of example projects:
github

Search