2011-04-20 107 views
0

類「Beans.Sid​​ePanelBean」沒有財產「的getLocation」是確切的錯誤。 我按照命名約定相應(我認爲),我仍然得到這個錯誤。 我的JSP我的JSP使用EL它沒有得到的getLocation財產

<li>Pick Up Location</li> 
<ul>${spb.getLocation}</ul> 

我的servlet:

String strlocation = request.getParameter("location"); 
spb.setLocation(strlocation); 
    request.getSession().setAttribute("spb", spb); 

我的豆:

public SidePanelBean(){} 
    String location; 
public String getLocation() { 
     return location; 
    } 

    public void setLocation(String location) { 
     this.location = location; 
    } 

感謝您的時間!

回答

1

如果獲取方爲getLocation(),則屬性名稱爲location,而不是getLocation。使用

<ul>${spb.location}</ul> 
+0

Bah我剛剛看到我的錯誤,你回答。今天是漫長的一天 – Ravana 2011-04-20 20:06:05