在Action定義一個(gè)私有屬性并設(shè)置set get方法: private String hello="hello silenceper!"; public void setHello(String hello){ this.hello=hello; } public String getHello(){ return hello; }可以在jsp頁面中通過EL表達(dá)式和struts2標(biāo)簽來獲取屬性的值: <s:property value="hello"/> 或者 ${requestScope.hello}但是如果設(shè)置屬性為public 并且 不設(shè)置set get方法的話,還是可以通過上面兩中方法來獲取。這是為什么?還有就是屬性怎么到requestScope中去了?
struts2中的一個(gè)疑惑?
達(dá)令說
2019-03-12 13:14:35