It looks like the span was generated solely for the purpose of providing a place to hang the tag's id value. Which is a problem, since you already generated a tag with the same ID, thus violating the uniqueness requirement. The choice of "span" was undoubtedly because it's probably the only HTML wrapper that wouldn't alter the page layout.
I try to avoid doing custom JSF tags as
Java code at the moment. I don't trust the mechanisms to remain stable. And it's easier to implement custom controls and the like as XML custom tags, instead. I recommend doing some serious manual reading, though. There's probably a way to switch off the automatic wrapper generation. Although the fact that the span
follows your generated code instead of wrapping it probably indicates you haven't followed the protocols properly anyway.
The secret of how to be miserable is to constantly expect things are going to happen the way that they are "supposed" to happen.
You can have faith, which carries the understanding that you may be disappointed. Then there's being a willfully-blind idiot, which virtually guarantees it.