2
votes

I am practising JSF. I created a login screen with user Id and password fields. Now both the input fields have required="true". I created message.properties file and added the below validation Id to it,

javax.faces.component.UIInput.REQUIRED= {0} is mandatory field

I added message-bundle to the faces-config.xml.

No when I click the submit without any field value given, the message shown is as below,

j_idt13:userid is mandatory field

I want to remove that j_idt13 which is the component Id from the message. How to do it?

Thanks

1

1 Answers

6
votes

In the input components, use the attribute label to show that instead of the id:

<h:inputText .. label="User Id" />