my dog learned polymorphism
The moose likes JSF and the fly likes Error happen when using <c:if> Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "Error happen when using <c:if>" Watch "Error happen when using <c:if>" New topic

Error happen when using <c:if>

reubin haz
Ranch Hand

Joined: May 12, 2005
Posts: 287
I'm having an error like this:

<h3>Validation error messages from TagLibraryValidator for f in /user/ace/branch/activeComments.jsp</h3>

null: Validation error. The following JSF tags are required to contain IDs:"hutputLink hutputText "

The error happens when I place this code to the page. Please help. Thanks.

Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17410

I don't know why JSF is insisting on putting IDs on those tags. It doesn't normally do that. You should be able to satisfy it by coding 'id="xxxxxx"' attributes on the indicated elements, where "xxxxxx" is a different and unique ID for each element so identified.

But you're not using JSF very gracefully. JSTL should almost never be mixed with JSF. In most cases, JSF has a better-integrated way of doing the same thing. Likewise, you should avoid raw HTML, which, depending on the version of JSF you're using may disappear or get relocated to the wrong part of the display.

An IDE is no substitute for an Intelligent Developer.
Samuel March
Ranch Hand

Joined: Oct 28, 2009
Posts: 39
edited: I'll leave this here though i totally missed the point or was replying to something else with the wrong page open at the time.

<c:if test="${param.something == true}"....

is JSTL Java Standard Tag Library.

you nees this
<%@ taglib uri="" prefix="c" %>
at the top of the page and the JSTL .jar files for the
in your application.
And you can hot fix it too if you want by using e.g. winrar archiver that shows folders not a list
and take all the .tld files out of the .jar files that have any in there META-INF and put them(.tld) in
the /WEB-INF of your app.

...did you have the fish?!............................ No.
reubin haz
Ranch Hand

Joined: May 12, 2005
Posts: 287
Thanks guys. I found it's working after I put id attributes inside those tags
I agree. Here's the link:
subject: Error happen when using <c:if>
It's not a secret anymore!