用struts框架在action.java中出現(xiàn)錯誤:The type LoginAction must implement the inherited abstract method SessionAware.setSession(Map)和Name clash: The method setSession(Map<String,Object>) of type LoginAction has the same erasure as setSession(Map) of type SessionAware but does not override it
1 回答

蕪湖不蕪
TA貢獻1796條經(jīng)驗 獲得超7個贊
SessionAware這個是在struts2中action需要取Session用到的接口。如果你的LoginAction實現(xiàn)這個接口,就需要重寫這個接口的方法
在LoginAction加入
//請求訪問 session
private Map<String, Object> session;
@Override
public void setSession(Map<String, Object> session) {
this.session = session;
}
添加回答
舉報
0/150
提交
取消