struts2整合spring struts.xml中的action的class 总说找不到

struts2版本 2.0.14
spring版本 2.5
tomcat 版本6.0.14
IDE:myeclipse6.0
struts2与spring整合中 出现问题
LoginAction.java
[code="java"]

public class LoginAction extends ActionSupport {
private String username;
private String password;
private LoginService loginService;
public LoginService getLoginService() {
return loginService;
}
public void setLoginService(LoginService loginService) {
this.loginService = loginService;
}

public String execute()throws Exception
{
    if (this.getLoginService().isLogin(username,password)) {
        return "success";
    }
    return "input";
}
public String getUsername() {
    return username;
}
public void setUsername(String username) {
    this.username = username;
}
public String getPassword() {
    return password;
}
public void setPassword(String password) {
    this.password = password;
}

}

[/code]

loginServiceImpl
[code="java"]

public class LoginServiceImpl implements LoginService {

public boolean isLogin(String username,String password) {
    if ("admin".equals(username)&&"123".equals(password)) {
        return true;
    }
    return false;
}

}

[/code]
applicationContext.xml
[code="java"]
<?xml version="1.0" encoding="UTF-8"?>
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">

<bean id="loginService"
    class="com.intelsrc.service.impl.LoginServiceImpl">
</bean>

<bean id="loginAction" class="com.intelsrc.action.LoginAction"
    scope="prototype">
    <property name="loginService">
        <ref bean="loginService" />
    </property>
</bean>

[/code]

struts.xml
[code="java"]


<!-- -->


/error.jsp
/result.jsp
/login.jsp


[/code]

web.xml
[code="java"]

org.springframework.web.context.ContextLoaderListener


contextConfigLocation
/WEB-INF/applicationContext*.xml,classpath*:applicationContext-*.xml


struts2
org.apache.struts2.dispatcher.FilterDispatcher


struts2
/*

[/code]

jar包

[img]http://dl.iteye.com/upload/attachment/316595/963d104e-df0d-32a7-991c-671253f15dc0.jpg[/img]
运行后出现如下错误信息

[img]http://dl.iteye.com/upload/attachment/316608/0f1bea96-6583-3426-a3b2-a05aecad6bf4.jpg[/img]

大家帮忙看看是什么问题?

2个回答

[quote]


contextConfigLocation

/WEB-INF/applicationContext*.xml,classpath*:applicationContext-*.xml


[/quote]

把这个放在
[quote]

org.springframework.web.context.ContextLoaderListener

[/quote]
前面

tomcat装的路径中带有空格符

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