jWebApp是一个基于Servlet的MVC框架,目的是为了简化小型web项目的开发复杂度。
示例:
jWebApp is literally this simple:
public class HelloWorld extends RequestHandler {
public String processHello(ServerInterface serverInterface) {
serverInterface.setAttribute(“helloWorld”, “Hello World”);
return “/WEB-INF/helloWorld.jsp”;
}
public String processHelloAgain(ServerInterface serverInterface) {
serverInterface.setAttribute(“helloWorld”, “Hello World Again”);
Just plain HTML and your favorite template markup
Hello World
Hello Again
The following servlet configuration is all that is needed (outside our control, it’s a servlet thing).
jwaRequestServlet
jwebapp.RequestServlet
/helloWorld/hello
/helloWorld/helloAgain
index.jsp
And, calling the above is simple!
http://host/context/helloWorld/hello
http://host/context/helloWorld/helloAgain