I would like to create a custom message renderer to renders h:message as a 'p' html element instead of as a 'span' element. It concerns the following message tag: <h:message id="firstNameErrorMsg" for="firstname" class="error-msg" />. I've written to code underneath, but that's only rendering an empty 'p' element. I suppose I have to copy all attributes and text from the original component and write it to the writer. However, I don't know where to find everything and it seems to be a lot of work for just a replacement of a tag.
Is there a better way to get an h:message tag rendered as a 'p' element?
I don't recommend overriding renderers in JSF for standard tags. If you absolutely must change how a tag renders and you can't do it by less intrusive methods (such as CSS), subclass the tag. That way you A) won't interfere with other uses of the tag and B) won't confuse other developers when the tag doesn't "work right". Because seeing a different tag is a strong cue that it has different behavior.
An IDE is no substitute for an Intelligent Developer.