0

我有一个用于同意内容的条款和条件的复选框,并且用户希望标签中链接的条款。我试图做这样的事情:

<s:checkbox name="iagree" fieldValue="true" label="By entering, I acknowledge that I have read, understand, and agree to the 
<a href='/rules.pdf'>Official Rules</a>, <a href='/about-us/terms-of-use/'>Terms of Use</a>, and <a href='/about-us/privacy-policy/'>Privacy Policy</a>."/>

不幸的是,JSP 正在转义我的标记,因此您实际上会看到括号、标签等。我可以添加一个属性来确保 HTML 实际用作 HTML 吗?

奇怪的是,我有一个 struts 广播组,它允许标记就好了。

4

1 回答 1

1

只需使用 HTML<label>标记并在其中放置复选框以及文本和链接。并使用simple主题作为<s:checkbox>标签。

<label>
  <s:checkbox name="iagree" fieldValue="true" theme="simple"/>
  By entering, I acknowledge that I have read, understand, and agree to the 
  <a href='/rules.pdf'>Official Rules</a>, 
  <a href='/about-us/terms-of-use/'>Terms of Use</a>, 
  and <a href='/about-us/privacy-policy/'>Privacy Policy</a>.
</label>
于 2013-10-11T18:00:29.607 回答