package org.nutz.mvc.view;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.nutz.mvc.View;

public class HttpStatusView implements View {

	private int sc;

	public HttpStatusView(int sc) {
		this.sc = sc;
	}

	public void render(HttpServletRequest req, HttpServletResponse resp, Object obj) {
		resp.setStatus(sc);
	}

}

@@ -19,24 +19,55 @@
 vc.view;%0D%0A%0D%0A
+import java.io.IOException;%0D%0A%0D%0A
 import javax
@@ -101,16 +101,16 @@
 quest;%0D%0A
-
 import j
@@ -147,24 +147,52 @@
 esponse;%0D%0A%0D%0A
+import org.nutz.lang.Lang;%0D%0A
 import org.n
@@ -208,16 +208,185 @@
 iew;%0D%0A%0D%0A
+/**%0D%0A * %E8%BF%94%E5%9B%9E%E7%89%B9%E5%AE%9A%E7%9A%84%E5%93%8D%E5%BA%94%E7%A0%81%3Cp/%3E%0D%0A * %3Cb%3E%E6%B3%A8%E6%84%8F,400%E6%88%96%E4%BB%A5%E4%B8%8A,%E4%BC%9A%E8%B0%83%E7%94%A8resp.sendError,%E8%80%8C%E9%9D%9Eresp.setStatus.%E8%BF%99%E6%A0%B7%E5%81%9A%E7%9A%84%E5%8E%9F%E5%9B%A0%E6%98%AF errorPage%E7%9A%84%E9%85%8D%E7%BD%AE,%E5%8F%AA%E6%9C%89resp.sendError%E4%BC%9A%E8%A7%A6%E5%8F%91,%E4%B8%94%E7%BB%9D%E5%A4%A7%E5%A4%9A%E6%95%B0%E6%83%85%E5%86%B5%E4%B8%8B,%E5%8F%AA%E4%BC%9A%E9%85%8D%E7%BD%AE400%E6%88%96%E4%BB%A5%E4%B8%8A%3C/b%3E%0D%0A * @author MingMing%0D%0A *%0D%0A */%0D%0A
 public c
@@ -588,16 +588,144 @@
 obj) %7B%0D%0A
+%09%09if (sc %3E= 400)%0D%0A%09%09%09try %7B%0D%0A%09%09%09%09resp.sendError(sc);%0D%0A%09%09%09%7D catch (IOException e) %7B%0D%0A%09%09%09%09throw Lang.wrapThrow(e);%0D%0A%09%09%09%7D%0D%0A%09%09else%0D%0A%09
 %09%09resp.s

fix issue #138