首页 新闻 搜索 专区 学院

SSH配置问题

0
悬赏园豆:5 [已解决问题] 解决于 2013-08-12 15:30
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,怎么解决?

kebin00的主页 kebin00 | 初学一级 | 园豆:196
提问于:2013-08-04 20:11
< >
分享
最佳答案
1

你少包了,楼上正解

收获园豆:5
若雪封尘 | 菜鸟二级 |园豆:463 | 2013-08-12 15:28
其他回答(1)
0

jar包少了servlet这个包

kebin00 | 园豆:196 (初学一级) | 2013-08-07 12:36
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册