RedirectWithPost请求类全部代码
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
/**
-
用POST方式 重定向
-
@author royFly
*/
public class RedirectWithPost {
Map<String, String> parameter = new HashMap<String, String>();
HttpServletResponse response;
public RedirectWithPost(HttpServletResponse response) {
this.response = response;
}
public void setParameter(String key, String value) {
this.parameter.put(key, value);
}
public void sendByPost(String url) throws IOException {
this.response.setContentType(“text/html”);
response.setCharacterEncoding(“utf-8”);
response.setContentType(“text/html;charset=u