CSS文本转换未将大写字母发送到业务层


问题内容

我创建了一个像这样的简单标记。

<html>
    <head>
    <head>
    <body>
        <input type="text" style="text-transform:uppercase" />
    </body>
</html>

我以为浏览器会将所有输入大写,并且实际上它已经转换了

在我的业务层中,我假设浏览器在执行Post Method时也将以大写格式发送表单数据。

我的问题是,当我在Spring Controller上接收数据时,数据没有大写,因此我需要自己执行大写。

任何的想法?


问题答案:

text-
transform:uppercase不会将字符串转换为大写,您需要在服务器端执行此操作。您可以看到,如果您通过cmd-c(strg-c)复制转换后的文本并将其粘贴到文本文档中。文本将为小写。

看一下:http
:
//static.springsource.org/spring/docs/1.1.5/api/org/springframework/util/StringUtils.html#capitalize%28java.lang.String%29

希望您正在使用Spring-Framework。