aspose file tools
The moose likes JSF and the fly likes <h:message />  Error message with JSF Code Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » JSF
Reply Bookmark "<h:message />  Error message with JSF Code" Watch "<h:message />  Error message with JSF Code" New topic
Author

<h:message /> Error message with JSF Code

Anand Gondhiya
Ranch Hand

Joined: Feb 24, 2004
Posts: 155
Hi,
I have following code:

All the examples I see on web or in the books says that when you hit on 'Register' button with no data entered in firstName text field , It would throw error right beside it. The error would read Validation Error: Value is required . But when submit above page, it shows j_id_jsp_172425500_1:fname: Validation Error: Value is required.. i.e it shows the generated code j_id_jsp_172425500_1:fname: as well !!
Has anybody come across such a sceneario. I am using JSF 1.2,JSTL 1.2 , Tomcat 6 , JDK 1.6

Thanks
-Anand
Walter Krawiec
Greenhorn

Joined: Jan 13, 2009
Posts: 20
Anand Gondhiya wrote:Hi,
I have following code:

All the examples I see on web or in the books says that when you hit on 'Register' button with no data entered in firstName text field , It would throw error right beside it. The error would read Validation Error: Value is required . But when submit above page, it shows j_id_jsp_172425500_1:fname: Validation Error: Value is required.. i.e it shows the generated code j_id_jsp_172425500_1:fname: as well !!
Has anybody come across such a sceneario. I am using JSF 1.2,JSTL 1.2 , Tomcat 6 , JDK 1.6

Thanks
-Anand


Maybe assign id for your message? I had problem with dynamic webuijsf:button, but after adding id to button everything works fine.

cheers

Walter
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 14466
    
    7

The stock error message is really yucky. You can override it (it's a resource), but the override is done for all validation messages of that type, which is also yucky.

In newer JSF implementations, you can assign a label to the controls that will be used instead of the control ID when formatting the message.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: <h:message /> Error message with JSF Code
 
Similar Threads
Reloading JSF
Error With Simple Converter
message required
JSF 1.2 doesn't display in IE 8
Can I supply a Bean in selectItem.setValue()?