Thursday, September 25, 2008

JSTL- IF Condition

1- jars :

standard.jar
jstl.jar

2-tag library

you can add the tag libaray file.
e.g. c.tld

3-include the taglib in the jsp

<%@ taglib uri="/WEB-INF/c.tld" prefix="c" %>
if you don`t want to include the taglibrary file you can use (Jars must be included):
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

4- using the if element :

c:if test="${Condition}"
/c:if>

Example:

c:if test="${manger.billType=='1' || manger.billType=='16'}"
!-- ToDo --
/c:if


Wednesday, September 17, 2008

JSF & RichFaces

JSF : java server faces
myfaces : apache component library that is based on jsf
richfaces : jboss component library m which also based on jsf
http://livedemo.exadel.com/richfaces-demo/richfaces/form.jsf?c=form
(very good livedemo for all the richfaces components )

JSF : set up environment

1- you need first to add the jsf libraries (jsf-api.jar, jsf-impl.jar, jsf-facelets.jar),
most of the IDEs support this Jars if u choose faces project

2-if u are going to use richfaces so you need to add the richfaces jars
(richfaces-api-3.1.0.jar,richfaces-impl-3.1.0.jar,richfaces-ui-3.1.0.jar) and use the tag
libarary (<%@taglib uri="http://richfaces.org/rich" prefix="rich"%>).

3-you have to add the jstl.jar and standard.jar and some commons jars

note: if u add richfaces jars, don`t add ajax4jsf because the same classes are in richfaces.

To DownLoad richfaces jars :
http://www.jboss.org/jbossrichfaces/downloads/

getting started with jsf (jboss documentation)
http://www.jboss.org/file-access/default/members/jbossrichfaces/freezone/docs/devguide/en/html/GettingStarted.html