读书人

SSH配置过程出点小疑点

发布时间: 2013-10-16 11:29:46 作者: rapoo

SSH配置过程出点小问题
import org.apache.struts2.ServletActionContext;

import com.opensymphony.xwork2.ActionSupport;

public class logintest extends ActionSupport {

private String name;
private String password;

public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}

public String getPassword() {
return password;
}

public void setPassword(String password) {
this.password = password;
}

public String execute() throws Exception {

ServletActionContext.getRequest().setAttribute("name", name);
ServletActionContext.getRequest().setAttribute("password", password);

return SUCCESS;
}
红色的地方出错了,老是报:Access restriction: The method setAttribute(String, Object) from the type ServletRequest is not accessible due to restriction on required library D:\应用\eclipse\jre\lib\ext\servlet-api.jar,怎么解决? SSH java
[解决办法]
jar包有问题吧
[解决办法]
http://blog.csdn.net/hexin373/article/details/7175325
试试这个,,可以的

读书人网 >Java相关

热点推荐