2012-10-05 42 views
0

Possible Duplicate:
How to assign <s:property value=「a」> value to a jsp variable從JSP屬性值分配給一個Java變量

我嘗試指派從JSP屬性添加到Java變量的值,但它似乎並沒有爲我工作...

這裏是錯誤: An error occurred at line: 14 in the jsp file: /WEB-INF/ fivepluscms/client/CMSGallery.jsp Syntax error on token "=", ; expected.

這裏是代碼:

<s:set var="data"></s:set> 
<% int nume =%><s:property value="#data"/><%;%> 

我提到,我getter和setter在這個變量的action類中。

在此先感謝

+0

這個怎麼樣:''? –

回答

1

<s:set name="nume" value="data" />將調用getData()在動作類和返回值賦給變量nume