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个回答

问题解决了,是一个智障型的问题,附上解决之后的代码:
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);

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐