Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Does writting JSF custom component require J2EE?

Reply
Thread Tools

Does writting JSF custom component require J2EE?

 
 
byoder@hotmail.com
Guest
Posts: n/a
 
      01-06-2007
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;
}
}

 
Reply With Quote
 
 
 
 
=?ISO-8859-1?Q?Arne_Vajh=F8j?=
Guest
Posts: n/a
 
      01-06-2007
http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:
> 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.


JSF is part of J2EE.

You can deploy a JSF implementation on Tomcat without
anything else because Tomcat has the relevant J2EE pieces.

For development you can either find the jars in Tomcat or just
grab the J2EE SDK and use j2ee.jar.

Arne
 
Reply With Quote
 
 
 
 
byoder@hotmail.com
Guest
Posts: n/a
 
      01-10-2007
> JSF is part of J2EE.
>
> You can deploy a JSF implementation on Tomcat without
> anything else because Tomcat has the relevant J2EE pieces.
>
> For development you can either find the jars in Tomcat or just
> grab the J2EE SDK and use j2ee.jar.
>
> Arne


Thanks Arne. I have tried adding all the jar's that come with Tomcat
5x to my classpath, but am still getting the compile error. I can try
to install Sun Java 5 J2EE (which installs sun server, ect.) and then
copy j2ee.jar into Tomcat - but should I have to do that if Tomcat
supports J2EE?

 
Reply With Quote
 
=?ISO-8859-1?Q?Arne_Vajh=F8j?=
Guest
Posts: n/a
 
      01-10-2007
(E-Mail Removed) wrote:
>> JSF is part of J2EE.
>>
>> You can deploy a JSF implementation on Tomcat without
>> anything else because Tomcat has the relevant J2EE pieces.
>>
>> For development you can either find the jars in Tomcat or just
>> grab the J2EE SDK and use j2ee.jar.

>
> Thanks Arne. I have tried adding all the jar's that come with Tomcat
> 5x to my classpath, but am still getting the compile error. I can try
> to install Sun Java 5 J2EE (which installs sun server, ect.) and then
> copy j2ee.jar into Tomcat - but should I have to do that if Tomcat
> supports J2EE?


I quick search in my Tomcat reveals that the missing class
is part of JSF, so it should be in your JSF libs - and you should
add those to your build.

It is widely used to have j2ee.jar in classpath for build, but you
must *NOT* deploy it in Tomcat.

Arne
 
Reply With Quote
 
byoder@hotmail.com
Guest
Posts: n/a
 
      01-10-2007
I am going to respond to my own question...

I have located the following directory on my PC (which contained the
jar files that I needed). In My Eclipse I just added to my classpath a
"library" called "J2EE 1.4 Library Set". Then I could compile my
custom JSF components.

C:\Program Files\MyEclipse
5.0GA\eclipse\plugins\com.genuitec.eclipse.j2eedt. core_5.0.0\data\libraryset\1.4

I assume that I could install J2EE (very hevy footprint) or get these
somewhere else. But basically I find the following jars there...

activation.jar
javax.servlet.jsp.jar
javax.servlet.jar
jboss-jaxrpc.jar
jboss-j2ee.jar
jboss-jsr77.jar
jboss-saaj.jar
mail.jar
namespace.jar
xml-apis.jar

I am not sure if I have to deploy these to Tomcat, but I will let you
know.


Arne Vajh°j wrote:
> (E-Mail Removed) wrote:
> > 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.

>
> JSF is part of J2EE.
>
> You can deploy a JSF implementation on Tomcat without
> anything else because Tomcat has the relevant J2EE pieces.
>
> For development you can either find the jars in Tomcat or just
> grab the J2EE SDK and use j2ee.jar.
>
> Arne


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Include JSF page within another JSF page BlackIce Java 1 07-05-2006 11:24 PM
JSF debugging / JSF newsgroup Sebastian Fey Java 1 04-07-2006 08:52 PM
[JSF]Need to deploy a jsf application on SunApplicationServer. dudu Java 0 03-03-2006 12:09 PM
JSF custom component: NullPointerException galpix@mail.com Java 0 08-08-2005 06:33 PM
Creating a custom JSF component? stefoid Java 1 12-15-2004 09:23 AM



Advertisments