By Sanjeeb.Sahoo@Sun.COM Custom JSP Tags to use Java Persistence API in a JSP. ----------------------------------------------------- There is a cutsom tag library called jpa-tag-lib and a sample web application that uses this library as well. The tag library can be used in any other application as well. File lay out: ------------- Custom tags are in jpa-tag-lib sub-dir. The entity classes and persistence.xml is in entities sub-dir. JSPs and HTMLs are in web-app6 sub-dir. Classes belong to example package. build artifacts go to build directory by default. Build steps: ------------ change as.home property in build.xml. as.home property points to the root of the application server installation directory. Build processes uses the javaee.jar file from the appserver location. javaee.jar contains all the standard Java EE API classes. ant build-jpa-tag-lib: builds the tag library and produces build/jpa-tag-lib.jar ant build: produces build/web-app6.war ant deploy: deploys the app to app server. ant verify: verifies compliance of the app against Java EE spec. To run the application open http://localhost:8080/web-app6/login.html Before you run the application, just start the database. Database related setup: ---------------------- Start Derby: $GLASSFISH_HOME/bin/asamdin start-database Stop Derby: $GLASSFISH_HOME/bin/asamdin stop-database The sample uses Java2DB feature. So no need to set up tables. See how we use --createtables option in deploy command in build.xml. It creates tables if they are not already present. If tables are aready present, deployment succeeds with a WARNING. Some common Sun Java System Application Server commands: -------------------------------------------------------- To start the appserver: asadmin start-domain To stop the appserver: asadmin stop-domain To deploy an app: asadmin deploy --user admin --password adminadmin change user name and password to whatever you used during installtion. To undeploy an app: asadmin undeploy --user admin --password adminadmin