セッションBeanからフィールドにデータを入力したい。
私はこれを試みました:
`<html:text
property="docId"
value="<bean:write name="queryResponseBean" property="queryResults" />" />`
しかし、役に立たない。
ありがとう。
セッションBeanからフィールドにデータを入力したい。
私はこれを試みました:
`<html:text
property="docId"
value="<bean:write name="queryResponseBean" property="queryResults" />" />`
しかし、役に立たない。
ありがとう。
struts html:textタグの "value"属性は、文字列またはRT Expr(スクリプトレット)を除くため、上記で使用されているようなネストされた式は機能しません。代わりに、「queryResults」プロパティの値をBeanに設定してから、スクリプト言語を使用して「value」属性に挿入する必要があります。
こんな感じになります
<bean:define id="textVal" name="queryResponseBean" property="queryResults"/>
<html:text property="docId" value="<%=textVal%>"/>
value=''
値を直接割り当てることができます。属性は使用しないでください。
html:text property="docId" property="queryResults" />
ここでdocId
、はBeanClassである必要があり、プロパティ(queryResults
)はBeanClass内のフィールドである必要があります。
RT Exprは、struts html:textタグのvalue属性でのみ許可されるため、ネストされた式やJSP式言語の使用は避けてください。
使ってみてください
<html:text
property="docId"
value="<bean:write name='${queryResponseBean}' property='queryResults' />" />