天天看點

【Struts2架構】第三節OGNL表達式-OGNL表達式例子2

1.ognl靜态通路例子

struts.xml:

indexaction1.java:

s.java

連結:

結果界面:

結果:

通路值棧中靜态方法:static method

通路值棧中靜态屬性:static string

常用類的靜态方法也可以通路(加兩個@)

結果頁面:

通路math類的靜态方法:5

2.ognl通路普通類的構造方法

ognlaction3.java:

dog.java:

通路普通類的構造方法:dog:tom

轉載請注明出處:http://blog.csdn.net/acmman/article/details/47070019