【问题标题】:Placeholder tag in stripes framework条纹框架中的占位符标签
【发布时间】:2015-07-27 22:41:03
【问题描述】:

我正在使用条纹框架开发一个 Web 应用程序,我想在这样的文本框中使用“占位符”标签:

<s:form beanclass="myproject.action.ContactFormActionBean">
  <table class="form">
    <tr>
     <td>Email:</td>
     <td><s:text name="contact.email" placeholder="Please enter your email"></td>
    </tr>
  </table>
</s:form>

但是,当我运行该页面时,我收到 500 错误(意外错误)。查看条纹文档,我发现占位符属性无效。

是否有可用的解决方法,或者我是否需要使用另一个标签库才能使占位符工作?

【问题讨论】:

  • 我认为 stripes 标签不支持 HTML 5。你应该去 stripes 邮件列表并提出建议,因为他们正在开发新版本。

标签: jsp web jsp-tags stripes


【解决方案1】:

使用动态属性。

<%@ taglib prefix="sdyn" uri="http://stripes.sourceforge.net/stripes-dynattr.tld" %>

<sdyn:text name="contact.email" placeholder="Please enter your email">

https://stripesframework.atlassian.net/wiki/display/STRIPES/Tag+Library+Doc

【讨论】:

    猜你喜欢
    • 2015-12-03
    • 1970-01-01
    • 2012-01-12
    • 2016-02-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-07-10
    • 2014-12-15
    相关资源
    最近更新 更多