2010-06-17 51 views

回答

3

的「價值」的支柱的HTML屬性:text標籤要麼除了字符串或RT Expr的(scriplet),因此嵌套表達式等上面使用的一個不會工作。相反,「queryResults」屬性的值必須設置爲一個bean,然後使用腳本語言插入到「value」屬性中。

它會是這個樣子

<bean:define id="textVal" name="queryResponseBean" property="queryResults"/> 
<html:text property="docId" value="<%=textVal%>"/> 
+0

以及如何處理列表中的值? 」/>。給我一個錯誤。 – 2017-11-22 12:33:40

0

嘗試使用

<html:text 
    property="docId" 
    value="<bean:write name='${queryResponseBean}' property='queryResults' />" /> 
+0

它也不喜歡這個。 它不會拋出ServletException,而是在文本字段中放置「」。 – komidore64 2010-06-18 18:40:59

1

一個RT expr是隻允許在struts HTML的價值屬性:文本標籤,因此要避免使用嵌套表達式或JSP表達式語言。

1

您可以直接分配一個值,不使用value=''屬性:

html:text property="docId" property="queryResults" /> 

其中docId必須是BeanClass和財產(queryResults)必須BeanClass裏面的字段。