Custom JSF Tag won't display the attributes
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Cori_Eckel
Posted On:   Friday, August 18, 2006 01:29 PM

Quick summary: I can't refer to the attributes passed in to by custom tag. I have a .jsf page that is passing two strings. One is from the backingBean and the other is hardcoded. <%@page contentType="text/html"%> <%@page pageEncoding="UTF-8"%> <%@taglib prefix="c" uri="http://java.sun.com/jsf/core"%> <%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%> <%@taglib prefix="p" tagdir="/WEB-INF/tags"%> -- -- The -- -- shows that I do have a value when call this custom tag with it   More>>

Quick summary: I can't refer to the attributes passed in to by custom tag.



I have a .jsf page that is passing two strings. One is from the backingBean and the other is hardcoded.



			
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>

<%@taglib prefix="c" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<%@taglib prefix="p" tagdir="/WEB-INF/tags"%>





-- --








The -- -- shows that I do have a value when call this custom tag with item.title passed as varid.



Now the tag looks like this: custom.tag located in /WEB-INF/tags/



			
<%@tag description="put the tag description here" pageEncoding="UTF-8"%>
<%@attribute name="varid" required="true" %>
<%@attribute name="hardid" required="true" %>
<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>

Test1: var *

Test2: hard *

Test3: noOutputText-Var= ${varid}*

Test4: noOutputText-Hard= ${hardid}*





I was told I needed to have an implicit.tld file and I read it also here (http://blogs.sun.com/roller/page/jluehe?entry=implicit_tag_libraries_require_and)



So here's my implicit.tld (also located under /WEB-INF/tags/



			
<?xml version="1.0" encoding="UTF-8"?>

2.1
2.1
Custom Tags





So the problem is when I refer varid - I get nothing (nothing writes out in either case using outputText or just ${varid}).



And when I refer to hardid, I get nothing for the outputText test but I do get something for the ${hardid} test.



I don't see this a reference to this problem alot on the web so I figure I must be missing something obvious but I just don't know what.



Does anyone have any ideas?



Thanks.



C    <<Less
About | Sitemap | Contact