Examples of ResponseContext


Examples of cn.org.ape.http.ResponseContext

   */
  @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方式的修改只有将取得的数据强行转码
 
View Full Code Here

Examples of cn.org.ape.http.ResponseContext

 
  @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
    return ;
   }
    
   //通过asm 把request的属性赋值到调用类中属性中
    ClassParsing cp = new ClassParsing();
View Full Code Here

Examples of com.cuubez.core.context.ResponseContext

        log.trace("service processing started");

        RequestConfigurationContext requestConfigurationContext = new RequestConfigurationContext(httpMethod, request);
        MessageContext messageContext = new MessageContext();
        messageContext.setRequestContext(new RequestContext());
        messageContext.setResponseContext(new ResponseContext());
        messageContext.setRequestConfigurationContext(requestConfigurationContext);

        RequestHandlerChain requestHandlerChain = new RequestHandlerChain();
        ResponseHandlerChain responseHandlerChain = new ResponseHandlerChain();
View Full Code Here

Examples of com.sun.xml.internal.ws.client.ResponseContext

                            SOAPFaultBuilder faultBuilder = SOAPFaultBuilder.create(msg);
                            // passing null means there is no checked excpetion we're looking for all
                            // it will get back to us is a protocol exception
                            throw (SOAPFaultException)faultBuilder.createException(null);
                        }
                        responseImpl.setResponseContext(new ResponseContext(response));
                        responseImpl.set(toReturnValue(response), null);
                    } catch (JAXBException e) {
                        //TODO: i18nify
                        responseImpl.set(null, new DeserializationException(DispatchMessages.INVALID_RESPONSE_DESERIALIZATION(),e));
                    } catch(WebServiceException e){
View Full Code Here

Examples of com.sun.xml.internal.ws.client.ResponseContext

            req.getMessage().assertOneWay(isOneWay);

            Fiber.CompletionCallback callback = new Fiber.CompletionCallback() {

                public void onCompletion(@NotNull Packet response) {
                    responseImpl.setResponseContext(new ResponseContext(response));
                    Message msg = response.getMessage();
                    if (msg == null) {
                        return;
                    }
                    try {
View Full Code Here

Examples of com.sun.xml.ws.client.ResponseContext

            req.getMessage().assertOneWay(isOneWay);

            Fiber.CompletionCallback callback = new Fiber.CompletionCallback() {

                public void onCompletion(@NotNull Packet response) {
                    responseImpl.setResponseContext(new ResponseContext(response));
                    Message msg = response.getMessage();
                    if (msg == null) {
                        return;
                    }
                    try {
View Full Code Here

Examples of org.apache.abdera.protocol.server.ResponseContext

        }

        WorkspaceManager wm = getWorkspaceManager(request);
        CollectionAdapter adapter = wm.getCollectionAdapter(request);
        Transactional transaction = adapter instanceof Transactional ? (Transactional) adapter : null;
        ResponseContext response = null;
        try {
            transactionStart(transaction, request);
            response = processor.process(request, wm, adapter);
            response = response != null ? response : processExtensionRequest(request, adapter);           
        } catch (Throwable e) {
View Full Code Here

Examples of org.apache.abdera.protocol.server.ResponseContext

                String ifNonMatchValue = context.getHeader("if-none-match");
                if (ifNonMatchValue != null) {
                    String currentETag = Utils.calculateEntityTag(resource);
                    if (ifNonMatchValue.equals(currentETag)) {
                        /* the version is not modified */
                        ResponseContext response = new StringResponseContext("Not Modified", 304);
                        return new ResponseTarget(context, response);
                    }
                }

                // date based conditional get
                long ifModifiedSinceValue = 0;
                Date ifModifiedSince = context.getDateHeader("If-Modified-Since");
                if (ifModifiedSince != null) {
                    ifModifiedSinceValue = ifModifiedSince.getTime();
                }

                if (ifModifiedSinceValue > 0) {
                    long lastModifiedValue = resource.getLastModified().getTime();
                    // convert the time values from milliseconds to seconds
                    ifModifiedSinceValue /= 1000;
                    lastModifiedValue /= 1000;

                    /* condition to check we have latest updates in terms of dates */
                    if (ifModifiedSinceValue >= lastModifiedValue) {
                        /* no need to response with data */
                        ResponseContext response = new StringResponseContext("Not Modified", 304);
                        return new ResponseTarget(context, response);
                    }
                }
            }
        }
View Full Code Here

Examples of org.apache.abdera.protocol.server.ResponseContext

                    importURL,
                    resource);
        } catch (Exception e) {
            return new StringResponseContext(e, 500);
        }
        ResponseContext rc = new EmptyResponseContext(200);
        try {
            rc.setLocation(
                    URLDecoder.decode(getAtomURI(location, request), "UTF-8").replaceAll(" ", "+"));
        } catch (UnsupportedEncodingException e) {
            // no action
        }
View Full Code Here

Examples of org.apache.abdera.protocol.server.ResponseContext

        return rc;
    }

    private ResponseContext processRenameRequest(RequestContext request, String path) {
        if (!request.getMethod().equals("POST")) {
            ResponseContext rc = new EmptyResponseContext(405, "Method not allowed");
            rc.setAllow("POST");
            return rc;
        }

        try {
            InputStream is = request.getInputStream();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.