Package cn.org.ape.http

Examples of cn.org.ape.http.HttpRequest


   * 该过滤器主要用于request的转码
   */
  @Override
  public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse,
      FilterChain chain) throws IOException, ServletException {
    HttpRequest request=new RequestContext((HttpServletRequest) servletRequest);
    HttpResponse response = new ResponseContext((HttpServletResponse) servletResponse);
    // 主要是修改post方式提交的数据
    request.setCharacterEncoding(encoding); //设设置编码
    //修改get方式提交的数据
    /**
     * get方式的修改只有将取得的数据强行转码
     * value = new String(value.getBytes("ISO-8859-1"), 
     *          "UTF-8");
View Full Code Here


 
 
  @Override
  protected void service(HttpServletRequest req, HttpServletResponse resp)
    throws ServletException, IOException {
    HttpRequest request=new RequestContext(req);
    HttpResponse response = new ResponseContext(resp);
   String module= request.getModule();//取得调用类
   String action= request.getAction()//取得调方法
   BaseAction baseAction = modules.get(module); //初始调用类
   if (baseAction==null)
   {
     //没有找到Module 返回404
    response.sendError(HttpResponse.SC_NOT_FOUND);//返回404
View Full Code Here

TOP

Related Classes of cn.org.ape.http.HttpRequest

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.