Bitbucket repo
T4Spring is a code generation tool for Spring MVC apps that creates strongly typed views that eliminate the use of literal strings in many places. e.g. instead of:
public String index(ModelMap map)
{
map.addAttribute("msg", "literal strings are no good!!");
return "Home/index";
}
T4Spring lets you write:
public String index(ModelMap map)
{
map.addAttribute("msg", "Hello T4Spring!!");
return Views.Home.index;
}
How to use:
- Get plugin from Maven
- Add this to your pom
- Build your project
<dependency>
<groupId>omargameelsalem</groupId>
<artifactId>T4Spring</artifactId>
<version>1.0</version>
</dependency>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>groovy-maven-plugin</artifactId>
<version>1.3</version>
<executions>
<execution>
<phase>install</phase>
<goals>
<goal>execute</goal>
</goals>
<configuration>
<source>
org.omargameelsalem.t4spring.Main.generate(System.getProperty("user.dir"));
</source>
</configuration>
</execution>
</executions>
</plugin>