B
byoder
I am new to JSF, and custom JSF - is J2EE (Enterprise Edition) a
requirement when creating custom JSF components? When I try to extend
UIComponentTag I get compiler error
"javax.servlet.jsp.tagext.JspIdConsumer cannot be resolved. It is
indirectly referenced from required .class files". I found this in
the J2EE API, so I know that it exists there - but I would like to use
J2SE; I will be running on Tomcat.
Here is an example of the class I am stuck on:
package jsftest;
import javax.faces.application.Application;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.el.ValueBinding;
import javax.faces.webapp.UIComponentTag;
public class FacesTextBoxTag extends UIComponentTag
{
// Declare a bean property for the hellomsg attribute.
public String hellomsg = null;
// Associate the renderer and component type.
public String getComponentType() { return
"com.sscims.jsfkit.TextBox"; }
public String getRendererType() { return null; }
protected void setProperties(UIComponent component)
{
super.setProperties(component);
// set hellomsg
if (hellomsg != null)
{
if (isValueReference(hellomsg))
{
FacesContext context = FacesContext.getCurrentInstance();
Application app = context.getApplication();
ValueBinding vb = app.createValueBinding(hellomsg);
component.setValueBinding("hellomsg", vb);
}
else
component.getAttributes().put("hellomsg", hellomsg);
}
}
public void release()
{
super.release();
hellomsg = null;
}
public void setHellomsg(String hellomsg)
{
this.hellomsg = hellomsg;
}
}
requirement when creating custom JSF components? When I try to extend
UIComponentTag I get compiler error
"javax.servlet.jsp.tagext.JspIdConsumer cannot be resolved. It is
indirectly referenced from required .class files". I found this in
the J2EE API, so I know that it exists there - but I would like to use
J2SE; I will be running on Tomcat.
Here is an example of the class I am stuck on:
package jsftest;
import javax.faces.application.Application;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.el.ValueBinding;
import javax.faces.webapp.UIComponentTag;
public class FacesTextBoxTag extends UIComponentTag
{
// Declare a bean property for the hellomsg attribute.
public String hellomsg = null;
// Associate the renderer and component type.
public String getComponentType() { return
"com.sscims.jsfkit.TextBox"; }
public String getRendererType() { return null; }
protected void setProperties(UIComponent component)
{
super.setProperties(component);
// set hellomsg
if (hellomsg != null)
{
if (isValueReference(hellomsg))
{
FacesContext context = FacesContext.getCurrentInstance();
Application app = context.getApplication();
ValueBinding vb = app.createValueBinding(hellomsg);
component.setValueBinding("hellomsg", vb);
}
else
component.getAttributes().put("hellomsg", hellomsg);
}
}
public void release()
{
super.release();
hellomsg = null;
}
public void setHellomsg(String hellomsg)
{
this.hellomsg = hellomsg;
}
}