- Java 双重比较
- java - 比较器与 Apache BeanComparator
- Objective-C 完成 block 导致额外的方法调用?
- database - RESTful URI 是否应该公开数据库主键?
我正在尝试更改错误消息的颜色。我正在使用 Stripes 验证。如果验证失败,我将发送一条错误消息。我想要它的红色。但它显示为黑色。如何更改 Stripes 框架中错误消息的颜色。
以下是我尝试过的。
<div class="item">
<stripes:errors />
<stripes:form name="home"action="/home.action">
//contents
</stripes:form>
</div>
最佳答案
正如 Vinoth 所说,您可以应用 CSS 类来更改错误消息的外观。除此之外,还可以通过编辑 StripesResources.properties
完全自定义 Stripes 消息。
在这里,您可以使用标记和 CSS 类,甚至是内联样式,准确定义消息的外观。
# Resource strings used by the <stripes:errors> tag when there are no nested tags
stripes.errors.header=<div class="my-error-wrapper"><h4>Ooops... some things went awfully awry:/h4><ol>
stripes.errors.beforeError=<li><i class="fa fa-warning"></i>
stripes.errors.afterError=</li>
stripes.errors.footer=</ol></div>
# Resource strings used by the <stripes:errors> tag when displaying errors for a
# specific field (e.g. <stripes:errors field="password"/>). If not supplied the
# values above will be used instead.
stripes.fieldErrors.header=
stripes.fieldErrors.beforeError=<span class="my-error-inline"><i class="fa fa-warning"></i>
stripes.fieldErrors.afterError=</span>
stripes.fieldErrors.footer=
# Resource strings used by the stripes:messages tag
stripes.messages.header=<div class="my-message-wrapper"><ul>
stripes.messages.beforeMessage=<li>
stripes.messages.afterMessage=</li>
stripes.messages.footer=</ul></div>
如您所见,您可以添加额外的花哨内容,例如 FontAwesome图标(承认,这比 OP 要求的更进一步)。
关于java - 我如何更改条纹框架中错误消息的颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35741406/
我正在尝试重用在 jsp 中设置并在 Stripes 布局渲染中使用的变量。 主页:/index.jsp 布局渲染页面:/jsp/widgets/signin/oAuthUrl.jsp 我的/jsp/
我已经测试了几个小时,但我似乎无法让边框图像做我想做的事。 我正在尝试向带有水平条纹的 div 添加底部边框。即2px灰,2px白,2px灰;即灰色和白色条纹。 像这样: 这是我目前所拥有的: .bo
我正在尝试使用一个不错的响应式网站模板 http://html5up.net/striped并遇到了一些问题。我已经设置了一个非常基本的测试。我 downloaded条纹包,在陨石应用程序中创建了一个
为什么这行不通? (例如,为什么脚本没有实际运行并创建付款按钮,就像它不在指令中那样。) .directive('stripeForm', ['$log', function($log) { re
我有一个表(Maintable),里面有信息。此外,每个 tr 都有一个子表,其中包含可以在需要时折叠的更多信息。现在,我希望对 maintable 中的 tr 进行 strip 化。我尝试使用:
我有一个表,其中包含由类标记的行。这些行应该是斑马条纹。需要注意的是它们并不总是连续的。 我尝试过按表和类名进行匹配,但最终结果总是不正确。发生的情况是, strip 化将应用于表级别,然后仅在具有该
原始表(http://highspeedbroadband.com.my/home-package/comparison-chart-for-home-package/) 我想修改下图中突出显示的原始
我有以下 html 文件: .table-striped { padding: 0; margin: 0;
这个问题在这里已经有了答案: CSS technique for a horizontal line with words in the middle (34 个答案) 关闭 9 年前。
我有一个 bootstrap 条纹表 ( .table-striped > tbody > tr:nth-of-type(odd){background-color: #f9f9f9;} ),我正在使
我对 Spring MVC 很有经验,正在试用 Stripes 以决定是否在新项目中试用它。 在 Spring MVC 中,我将准备模型数据并将其传递给 View ,方法是将其添加到由我的 Contr
我正在尝试使用 Rails 在 Stripe 中创建一次一次性充电。我收到以下错误: Stripe::InvalidRequestError (No such token: tok_18nnwSJ6t
在 Stripes 中,如果存在错误的操作类映射,Stripes 的默认行为是将控件转发到发出请求的同一个 JSP,并给出完整的错误堆栈。 我计划修改此行为,并希望在出现错误时提供更加用户友好的消息。
我的问题分为两部分: 如何使用 spark 设置(微调)高级 ORC 参数? 各种帖子显示可能存在问题Spark Small ORC Stripes , How to set ORC stripe s
我有一个 Stripes 框架问题。 这个重定向页面在注解方法之前? 类似于: @Before public void test() { String login=(String)context.
我想使用 Jest 测试我的 nodejs 代码。在我的代码中,我使用了条纹。 当需要条纹时,你必须使用这一行 const stripe=require('stripe')("apikey"); 为了
在这个例子中: https://jsfiddle.net/ywb77uhv/ 为什么将 strip 路径颜色更改为白色以外的颜色会破坏渲染?如何能够更改路径颜色? #stri
我在获取斜条纹背景以在 Chrome 中很好地显示时遇到了问题。 background-image: repeating-linear-gradient(-45deg, rgba(0,0,0,0.1)
我想在图像上绘制黑白条纹,在图像顶部水平和垂直地每 20 列切换一次,同时保持在图像边界内。到目前为止,我可以获得一个带有 1 像素宽垂直条纹的黑色正方形。我尝试过通过切换东西来至少在水平线上获得细长
所以我最近一直在尝试学习 Stripe API...我进展缓慢,但在处理这些元数据信息时遇到了一些障碍。 我希望实现的是在创建订阅和客户时向订阅添加元数据。 这是创建客户和订阅的原始脚本: $cust
我是一名优秀的程序员,十分优秀!