f you care to see the HTML source from your browser, you will find out that the id
of your input
field is <form-id>+":"+<input-field-id>
, in your case, j_idt7:UserId:
. Try to give your<h:form>
some meaningful id
in order to make some sense out of it. You can read about JSF IDs here. In case you don't like it, you can turn it off by modifying your form
tag to something like this,
<h:form prependId = false> // its true by default.
But that might turn out to be problematic, as pointed out by BalusC here.
Furthermore, it seems like you have never configured any validation messages yourself. Which in turn ends up with this message. Hence, a message.properties
file is needed to have a control over message and show something more appropriate. Even then the field name should not be the part of the message, to make those validation message generic to avoid repetition. See BalusC's answer regarding the use of label
attribute inside the <h:inputText>
.
http://stackoverflow.com/questions/4385118/jsf-2-why-the-form-id-prefix-in-the-hmessage-output/4390231
分享到:
相关推荐
object Form1: TForm1 Left = 465 Top = 119 Width = 402 Height = 248 Caption = 'Form1' Color = clBtnFace Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText Font.Height = -11 Font.Name = ...
如下代码:<s:form action="login2"> <s:textfield label="用户名" name="username"/> <s:password label="密码" name="password"/> <s:submit label="提交"/></s:form>我们看着以上的代码跟HTML的差不了多少,但是...
<h:form enctype="multipart/form-data"> <p:fileUpload fileUploadListener="#{fileUploadController.handleFileUpload}" mode="advanced" dragDropSupport="false" multiple="true" update="messages" ...
<form id="form1" runat="server"> <asp:TextBox ID="txtName" runat="server"></asp:TextBox> <asp:Button ID="btn_add" runat="server" OnClick="btn_add_Click" Text="确定" /> <asp:TextBox ID=...
charset=GBK"%> <%@ taglib prefix="s" uri="/struts-tags"%>... <s:form action="h2"> <s:textfield name="username" label="输入你的名字"/> <s:submit value="确认"/> </s:form> </body> </html>
<form id="form1" runat="server"> <asp:TextBox ID="txttmp" runat="server" Visible="False" Width="59px">0</asp:TextBox> <asp:TextBox ID="txtrus" runat="server" Visible="False" Width="56px">0</asp:...
在C#编程中,我们经常需要对应用程序的窗体(Form)进行自定义管理,比如控制窗体在任务栏中的显示方式。标题所提到的"禁止和允许在任务栏显示程序窗体标题程序",主要涉及到Windows窗体应用中窗体的可见性和任务栏...
在Struts中,Form Bean是用于处理用户输入的重要组件,它充当了模型层与视图层之间的桥梁。本篇文章将深入探讨Struts中的常见Form类型及其应用。 首先,我们要理解Form Bean的作用。Form Bean是用来存储用户从页面...
<mx:Panel width="262" height="291" layout="absolute" title="ʹԃMXML¶¨ӥة¼�<mx:FormItem label="ѕ Ļ" x="17.5" y="70" width="206"> <mx:TextInput id="sName" width="127"/> </mx:FormItem> <mx:...
form id="form1" runat="server"> <asp:Label ID="Label1" runat="server" Text="用户"></asp:Label> <asp:TextBox ID="labuser" runat="server"></asp:TextBox> <asp:Label ID="Label2" runat=...
Begin VB.Form Form1 BorderStyle = 0 'None Caption = "Form1" ClientHeight = 360 ClientLeft = 11715 ClientTop = 3825 ClientWidth = 3375 BeginProperty Font Name = "宋体" Size = 10.5 Charset =...
<asp:Button ID="btnChange" runat="server" Font-Bold="True" Font-Italic="False" ForeColor="Blue" Height="29px" Text="把小写金额转换为大写" Width="154px" onclick="btnChange_Click" /> <asp:Button ...
DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head> <title>登录页面</title></head><body> <form name="loginForm" method="post" action="judgeUser.jsp"> <table> <tr> 用户名:...
本文将深入探讨`form:select`的使用方法,以及其背后的原理和相关知识点。 首先,`form:select`是Spring Web MVC提供的JSP标签库`spring-form.tld`的一部分,这个库是用来帮助开发者构建基于模型绑定的Web表单的。...
<form:button>Save Changes</form:button> </form:form> ``` 这将在页面中生成一个表单,其中firstName和lastName的值从PageContext中的命令对象获取。 **input标签**则用于生成`type="text"`的HTML`input`标签,...
标题"禁止窗体标题栏的最大化按钮,C#源代码this.MaximizeBox = false;"所描述的就是一个这样的功能实现。在这个功能中,我们将通过设置窗体的属性来达到目的,主要涉及的知识点有: 1. **窗体类(Form)**:C#中的...
这些标签包括<form:form>、<form:input>、<form:errors>等,它们与Spring的BindingResult和ModelAttribute机制相结合,实现了模型数据与表单元素的自动绑定和错误处理。 **4. Form Tag常用标签** - `<form:form>`: ...
<html:form action="submitForm"> <html:text property="id" /> <html:text property="userName" /> <html:password property="password" /> <html:radio property="sex" value="1">Male</html:radio> <html:...
<jsp:param name="formName" value="form1"/> <jsp:param name="editorId" value="content" /> <jsp:param name="eWidth" value="800" /> <jsp:param name="eHeight" value="400" /> </jsp:include> 3 其他 ...
"禁止窗体标题栏的最小化按钮,C#源代码this.MinimizeBox = false;" 这个主题涉及到了Windows Forms应用中的窗体控件操作,特别是如何通过代码控制窗体的外观和功能。在Visual Studio 2008这样的开发环境中,可以轻松...