我想從會話bean填充字段。從<bean:write>標記填充<html:text>字段
我嘗試這樣的:
`<html:text
property="docId"
value="<bean:write name="queryResponseBean" property="queryResults" />" />`
,但無濟於事。
謝謝。
我想從會話bean填充字段。從<bean:write>標記填充<html:text>字段
我嘗試這樣的:
`<html:text
property="docId"
value="<bean:write name="queryResponseBean" property="queryResults" />" />`
,但無濟於事。
謝謝。
的「價值」的支柱的HTML屬性:text標籤要麼除了字符串或RT Expr的(scriplet),因此嵌套表達式等上面使用的一個不會工作。相反,「queryResults」屬性的值必須設置爲一個bean,然後使用腳本語言插入到「value」屬性中。
它會是這個樣子
<bean:define id="textVal" name="queryResponseBean" property="queryResults"/>
<html:text property="docId" value="<%=textVal%>"/>
嘗試使用
<html:text
property="docId"
value="<bean:write name='${queryResponseBean}' property='queryResults' />" />
它也不喜歡這個。 它不會拋出ServletException,而是在文本字段中放置「
一個RT expr是隻允許在struts HTML的價值屬性:文本標籤,因此要避免使用嵌套表達式或JSP表達式語言。
您可以直接分配一個值,不使用value=''
屬性:
html:text property="docId" property="queryResults" />
其中docId
必須是BeanClass和財產(queryResults
)必須BeanClass裏面的字段。
以及如何處理列表中的值? 」/>。給我一個錯誤。 – 2017-11-22 12:33:40