NutzCN Logo
问答 自定义的Processor里打印接收到的post的参数取不到
发布于 899天前 作者 qq_df433f5d 976 次浏览 复制 上一个帖子 下一个帖子
标签:

我按照nutzbook上配置动作链的介绍(http://nutzbook.wendal.net/dev_prepare/action_chain.html)配置了一个LogTimeProcessor,我想把接收到的post的参数也打印出来,但是打印的结果是空的。自定义的Processor放在了MethodInvokeProcessor之前。应该怎么取参数呢?

    public void process(ActionContext ac) throws Throwable {
        Stopwatch sw = Stopwatch.begin();
        try {
            doNext(ac);
        } finally {
            sw.stop();
            if (log.isDebugEnabled()) {
                HttpServletRequest req = ac.getRequest();
                log.debugf("[%-4s]URI=%s %sms", req.getMethod(), req.getRequestURI(), sw.getDuration());
                log.debugf("parms=%s", Json.toJson(req.getParameterMap()));
            }
        }
    }
2 回复

.... servlet的特性

非表单格式的参数, 读不到的, 例如发送的是json

添加回复
请先登陆
回到顶部