当前位置:编程学习 > JAVA >>

s2sh中出现的错误

2012-10-18 22:45:00 org.apache.catalina.core.StandardWrapperValve invoke
严重: 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:752)
at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:505)
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:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
at java.lang.Thread.run(Thread.java:662) --------------------编程问答-------------------- 昨天我也出现这个错了,是因为在action中用response输出了。你得把你出错的action代码贴出来。 --------------------编程问答--------------------
引用 1 楼  的回复:
昨天我也出现这个错了,是因为在action中用response输出了。你得把你出错的action代码贴出来。


package com.netBank.action;

import java.util.Map;

import org.apache.struts2.interceptor.SessionAware;

import com.netBank.biz.UserBiz;
import com.netBank.entity.Account;
import com.opensymphony.xwork2.ActionSupport;

public class UserAction extends ActionSupport implements SessionAware {
private Map<String, Object> session;
private Account account;
private UserBiz userBiz;

public void setSession(Map<String, Object> session) {
// TODO Auto-generated method stub
this.session = session;
}
public String login() throws Exception{
Account a = userBiz.getAccount(account.getUsername());
if(a == null)
{
this.addFieldError("user", "用户名不存在");
return "errors";
}
else
{
if(!a.getPassword().equals(account.getPassword())){
this.addFieldError("user", "密码不正确");
return "errors";
}else{
return SUCCESS;
}
}
}
public Account getAccount() {
return account;
}

public void setAccount(Account account) {
this.account = account;
}

public UserBiz getUserBiz() {
return userBiz;
}

public void setUserBiz(UserBiz userBiz) {
this.userBiz = userBiz;
}

}
补充:Java ,  Java EE
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,