首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java相关 >

SSH配置过程出点小疑点

2013-10-16 
SSH配置过程出点小问题import org.apache.struts2.ServletActionContextimport com.opensymphony.xwork2.

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
试试这个,,可以的

热点排行