struts下session.setAttribute();的問題

Javalga發表於2005-05-16
程式碼如下:

try{
LogonForm lf = (LogonForm) form;
username = lf.getUsername();
password = lf.getPassword();
Login lg = new Login();
boolean auth = lg.signin(username,password);
if (auth){
req.setAttribute("user",username);
return mapping.findForward("success");

如果我把req.setAttribute();換為session.setAttribute()程式就會報錯。該怎麼辦啊???我想放進session裡去

相關文章