...
Code Block |
---|
public class CizelgemApplication extends AuthDataApplication { @Override protected void init() { super.init(); IResourceSettings resourceSettings = getResourceSettings(); resourceSettings.addResourceFolder("src/main/webapp"); //this path should be changed resourceSettings.setResourceStreamLocator(new PathStripperLocator()); } |
David Rosenstrauch
In Wicket 1.4
Two lines in your Wicket init are enough so you can put the HTML in your Maven webapp
directory:
Code Block |
---|
IResourceSettings resourceSettings = getResourceSettings();
resourceSettings.addResourceFolder("");
|
This works because the default IResourceSettings looks on the servlet context root if the path does not start with a "/". This resource resolution happens in addition to the classpath resolution, so you don't lose any functionality this way.
Brian Topping
Simple Partitioning in Maven Projects
With a simple change in your Maven pom.xml file, you can get clean separation of the Java and HTML source directories. (The Java class and HTML markup are still in the same package, though, unless you also use one of the strategies mentioned above.
Code Blocknoformat |
---|
<project> \[...\] <build> <resources> <resource> <resource> <directory>src/main/resources</directory> </resource> <resource> <resource> <directory>src/main/html</directory> </resource> </resources> \[...\] </build> \[...\] </project> |
Then, put all the HTML template files in:
No Format |
---|
<your-project> |
...
/src |
...
/main/html
|
Sualeh Fatehi