weixin_44511846
weixin_44511846
采纳率100%
2019-01-13 18:07

SSH框架利用ajax修改密码报出了一下错误,请大神们帮小弟看一下是什么原因?

严重: Servlet.service() for servlet default threw exception
java.lang.IllegalStateException
at org.apache.catalina.connector.ResponseFacade.sendError(ResponseFacade.java:407)
at org.apache.struts2.dispatcher.Dispatcher.sendError(Dispatcher.java:771)
at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:506)
at org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)
at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)

这是修改的方法:
public String update() throws IOException {
    List<Admin> l =service.findun();
    for (int i = 0; i < l.size(); i++) {
        if (l.get(i).getUsername().equals(a.getUsername())) {
            if (!l.get(i).getPassword().equals(a.getPassword())) {
                AjaxSend("1");
                Admin o = new Admin();
                String m = a.getPassword();
                System.out.println(m);
                System.out.println(o);
                o.setPassword(m);
                service.update(o);
                return null;
            }
        }
    }
    AjaxSend("0");
    return null;
}

请大神们帮小弟看一下是否哪里写错了?
  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

1条回答

  • weixin_44511846 weixin_44511846 2年前

    问题解决了,是一个智障型的问题,附上解决之后的代码:
    Admin o = new Admin();
    o.setUsername(l.get(i).getUsername());
    o.setPassword(a.getPassword());
    o.setPhone(l.get(i).getPhone());
    o.setEmail(l.get(i).getEmail());
    o.setWenti(l.get(i).getWenti());
    o.setDaan(l.get(i).getDaan());
    service.update(o);

    点赞 评论 复制链接分享

相关推荐