Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Yes, it's possible.</p> <p>To the current message, I can say that it consists out of <code>form id</code>, <code>item id</code> and <code>default message</code>.</p> <pre><code>&lt;form_id&gt;:&lt;item_id&gt;: &lt;default_message:javax.faces.component.UIInput.REQUIRED&gt; </code></pre> <p>If you want to change the default message, you could do this with a message bundle, which you have to define in your <code>faces-config.xml</code>.</p> <pre><code>&lt;application&gt; &lt;locale-config&gt; &lt;default-locale&gt;en&lt;/default-locale&gt; &lt;supported-locale&gt;en&lt;/supported-locale&gt; &lt;/locale-config&gt; &lt;resource-bundle&gt; &lt;base-name&gt;com.stackoverflow.messages.language&lt;/base-name&gt; &lt;/resource-bundle&gt; &lt;/application&gt; </code></pre> <p>And change the value for <code>javax.faces.component.UIInput.REQUIRED</code>.</p> <p>For example your message bundle <code>language.properties</code> could contain:</p> <pre><code>javax.faces.component.UIInput.REQUIRED=Your new required message! </code></pre> <p>Mostly all <code>JSF</code> implementations comes with the following default message, which I've <a href="https://svn.java.net/svn/mojarra~svn/trunk/jsf-api/src/main/java/javax/faces/Messages.properties" rel="nofollow">copied</a> from <code>Mojarra</code>:</p> <pre><code>javax.faces.component.UIInput.REQUIRED={0}: Validation Error: Value is required. </code></pre> <p>It's also possible to define a required message to an single item with the <code>requiredMessage</code> attribute. Then your <code>&lt;h:inputText /&gt;</code> should look like this:</p> <pre><code>&lt;h:inputText id="firstName" value="#{beanManager.currentUser.firstName }" required="true" requiredMessage="Your new required message!" style="font-size: 15px"&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload