JSF修剪空白 [英] JSF trimming white spaces

查看:150
本文介绍了JSF修剪空白的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

HI

我有一个输入字段,我想在其中修剪所有前导/后缀空格.我们正在使用JSF,并使用以下命令将输入​​字段绑定到jsp中的后备bean:

I have an input field in which I want to trim any leading/trailing whitespaces. We are using JSF and binding the input field to a backing bean in the jsp using:

<h:inputText id="inputSN" value="#{regBean.inputSN}" maxlength="10"/>

我的问题是,除了验证之外,还可以在jsp中完成吗?我知道我们也可以使用Handler中的trim()Java函数来做到这一点,但是只是想知道是否有更优雅的方法可以在JSF中实现.

My question is that besides validation can this be done in the jsp? I know we can also do this using the trim() java function in the Handler, but just wondering if there is a more elegant way to achieve this in JSF.

谢谢.

推荐答案

您可以使用教程).

这篇关于JSF修剪空白的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆