CorDapp JSF Template Eclipse
This is a CorDapp template for eclipse with integrated JSF webserver.
We created this Template, because we wanted to use JSF-Technology together with Corda. This template is free to use for everyone. Feel free to propose improvements, issues or other things.
The resources we used to create this template were:
https://docs.corda.net/tutorial-cordapp.html https://github.com/balajimore/cordapp-template-java-eclipse https://auth0.com/blog/developing-jsf-applications-with-spring-boot/
Special thanks to these authors which provided the knownledge for us to create this template.
You will need the following installed on your machine before you can start:
- JDK 8 installed and available on your path (Minimum version: 1.8_131).
- Eclipse (Minimum version MARS.2)
- Eclipse Buildship: Eclipse Plug-ins for Gradle
- Optional: h2 web console (download the "platform-independent zip")
For more detailed information, see the getting set up page on the Corda docsite.
Getting Set Up
To get started, clone this repository with:
git clone https://github.com/alabusag/cordapp-jsf-template-eclipse
And change directories to the newly cloned repo:
Refer to the corda docs to start the application:
Configure JSF on the CordApp
Switch to the 'Client' Sub-Project.
Set the Context-Root for your Application in file:
Set the faces context in file:
And in SpringBootApplication Java File
Normally you won't need the web.xml file when starting a JSF-Application with Spring Boot. But I have not found a solution yet. It's not working without the web.xml file.
Running the webserver on the nodes
Launch the Gradle Tasks:
runPartyAWebServer runPartyBWebServer runPartyCWebServer
You can now connect to them with:
Party A: http://localhost:10097/<contextRoot>/node/iou-form.xhtml Party B: http://localhost:10098/<contextRoot>/node/iou-form.xhtml Party C: http://localhost:10099/<contextRoot>/node/iou-form.xhtml
Extending the template
You should extend this template as follows:
- Add your own state and contract definitions under
- Add your own flow definitions under
- Extend or replace the client and webserver under
For a guided example of how to extend this template, see the Hello, World! tutorial here.