Getting started with a new client application
The easiest way to get started with DomUI is by using Apache Maven to create an example DomUI project, as follows:
Maven will ask you for a groupid and an artefactId for your new project to use in the poms the thing generates, plus the Java package name to use as the root for the structure:
This will generate the directory "example" (same name as the artefact ID you provided) with all demo code present.
Now cd to that directory, then use the usual maven commands to build the code:
which should end with "Build Success".
To run the example application use mvn jetty:run, then point your browser at http://localhost:8080/ui
This should give you:
which is not much, I agree
Running in IntelliJ
With the above setup it is trivial to get the code running in IntelliJ Idea. Just take the following steps:
- Start IntelliJ
- In the welcome screen click "Open..."
- Navigate to the "example" directory created above, and open the directory.
IntelliJ should automatically recognize that the project is a Maven project and import the POM's. If not click on the "Event Log" in the status bar (bottom right) and check if there are questions there to import the pom.
After import you can run the example from IntelliJ by adding a web runtime, as follows:
- In the menu select Run → Edit configurations
- Press the green "+" on the dialog that follows, and select "Tomcat Server" → "Local"
- Name the project, then click the Deployment tab
- In the deployment tab click the green "+" on the right of the dialog, then select Artifact.
- In the dialog that follows select example:war exploded
- Now back in the dialog, fill in "/ui" at "Application Context
Press OK on the dialog.
You can now run the application from IntelliJ using the buttons on the top right of the screen: