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