ぱっとみSpringMVCかと思った

http://d.hatena.ne.jp/shot6/20080527#1211873858

たとえばSpringMVCで似たようなコードを書くと以下のようになる。

@Controller
@RequestMapping("hello")
public class HelloPage {

	/**
	 * called from http://yourdomain/samples/hello/* or http://yourdomain/samples/hello
	 */
	@RequestMapping
	public String index() {
		return "/jsp/hello.jsp";
	}

	/**
	 * called from http://yourdomain/samples/hello/request
	 */
	@RequestMapping("/*/request")
	public String requestType(HttpServletRequest request) {

		return "/jsp/hello.jsp";
	}

	/**
	 * called from http://yourdomain/samples/hello/struts
	 */
	@RequestMapping("/*/struts")
	public String likeStrutsType(HttpServletRequest request,
			HttpServletResponse response) {

		return "/jsp/hello.jsp";
	}

}

似てるね。もちろん、@RequestMappingのところは無理やり合わせたような感じなので、ちゃんとやるなら一枚かませてラップしたほうがいいんだけど。

SpringMVCはアクションとビュー遷移のメソッドを分けることもできる。感覚的にはJSFのイベントリスナーとアクションイベントとの違いのような感じで。個人的にはあんまりわかりやすいとも思えないけど。