File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSF and the fly likes Customizing >h:message< Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Customizing &gt;h:message&lt;" Watch "Customizing &gt;h:message&lt;" New topic
Author

Customizing &gt;h:message&lt;

Bernhard Slominski
Greenhorn

Joined: Nov 03, 2004
Posts: 10
Hi,

I want to customize the <h:message> tag for displaying form validation error messages:
So e. g.



I want to print the error message "Required field: Firstname"
I can change the message in the resource bundle, but how can I add "Firstname" to the message?

Thanks for your help!

Bernhard
Jeremy Wilson
Ranch Hand

Joined: Feb 18, 2003
Posts: 166
I believe you will need to create your own custimized JSF tag library to do that. You could start with the code from a library like myfaces and modify to your liking.


Jeremy Wilson
Kant P.
Greenhorn

Joined: Apr 12, 2005
Posts: 11
there are 4 things you have to create:
1) create an output text
2) create a request scope of type java.lang.string
3) bind this request scop to output text you just created
3) when a login fails, do this:
getRequestScope().put("name of request scope", "Required field: " + newCustomer.firstName)

Follow those step should do it!!!1 good luck
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Customizing &gt;h:message&lt;
 
Similar Threads
JSF - How can I get hyperlink in error messages?
Customizing validations-h:message
Empty text Field Validation in JSF data Table
message required
display error message