Search |
||
Towards Java EE NirvanaPosted by cayhorstmann on February 2, 2009 at 3:27 PM PST
Java EE 6 makes it pretty straightforward to crunch out a basic web + database application. This semester, my software engineering class is building web apps, and I decided it is simpler to have them use JSF + JPA in Glassfish v3 rather than some technology that seems easy at first and then lets them down. Here is a laundry list of recent simplifications.
The WAR file has the structure web pages (.xhtml)
WEB-INF/
web.xml
faces-config.xml
classes/
managed beans
stateless session beans
entity beans
META-INF/
persistence.xml
There are three cookie-cutter XML files that you never need to touch. In
particular, Unfortunately, setting up your tools is a bit of trouble because everything is right now a moving target. Here are the steps.
Have we reached Nirvana? Not quite. Here are some remaining hassles:
»
Related Topics >>
J2EE Comments
Comments are listed in date ascending order (oldest first)
Submitted by alexehaddad on Wed, 2009-08-05 16:52.
Hello,
I've been unsuccessful in getting point 4)"Installing the JSF 2.0 module from the update center".
I deleted the 1.2 version using the updatetool, but I don't see the 2.x version. Can anyone assist? What could I be doing wrong or possibly be missing? I just see Glassfish JSF version 1.2.10-1 from the "Available Add-ons".
Submitted by cayhorstmann on Thu, 2009-08-06 17:06.
Are you still using the prelude version? You should use preview. I don't know if that still has 1.2, but it has 2.0. Currently 2.0.0-14.
Submitted by arinte on Tue, 2009-02-03 09:11.
Sorry Cay,
"but rather than some technology that seems easy at first and then lets them down" == JSF
Submitted by cayhorstmann on Tue, 2009-02-03 21:53.
@arinte: Did JSF 1.x fulfill all the hopes we had for it? Sadly, it didn't. But time moves on, and JSF 2.0 looks a lot better.
JSF has one big idea--let someone else do the heavy lifting of writing powerful components, and little old me drops them onto a page.
The trouble with "big idea" development is that the 1.x version often disappoints. But what's the alternative?
The "little idea" approach ("Oh neat, I get CRUD screens with 3 mouse clicks") doesn't really get you very far either. I admire the JSF and EJB folks for doggedly simplifying and fixing their stuff, without losing sight of the big idea.
Submitted by chesterxgchen123 on Thu, 2009-07-16 14:14.
Hi,
I just downloaded your example and trying to build the project. Before I did, I change the build.properties to point to the glassfish.dir to glassfishv3_prelude/glassfish directory. When I build, I got the following errors.
Buildfile: build.xml
prepare:
[mkdir] Created dir: /home/cchen/project/glassfish/SimpleQuiz/build
[mkdir] Created dir: /home/cchen/project/glassfish/SimpleQuiz/build/WEB-INF/classes
[mkdir] Created dir: /home/cchen/project/glassfish/SimpleQuiz/dist
compile:
[javac] Compiling 4 source files to /home/cchen/project/glassfish/SimpleQuiz/build/WEB-INF/classes
[javac] /home/cchen/project/glassfish/SimpleQuiz/src/java/com/horstmann/simplequiz/managed/QuizMB.java:8: cannot find symbol
[javac] symbol : class ManagedBean
[javac] location: package javax.faces.model
[javac] import javax.faces.model.ManagedBean;
[javac] ^
[javac] /home/cchen/project/glassfish/SimpleQuiz/src/java/com/horstmann/simplequiz/managed/QuizMB.java:9: cannot find symbol
[javac] symbol : class SessionScoped
[javac] location: package javax.faces.model
[javac] import javax.faces.model.SessionScoped;
[javac] ^
[javac] /home/cchen/project/glassfish/SimpleQuiz/src/java/com/horstmann/simplequiz/managed/QuizMB.java:15: cannot find symbol
[javac] symbol: class ManagedBean
[javac] @ManagedBean(name = "quiz")
[javac] ^
[javac] /home/cchen/project/glassfish/SimpleQuiz/src/java/com/horstmann/simplequiz/managed/QuizMB.java:16: cannot find symbol
[javac] symbol: class SessionScoped
[javac] @SessionScoped
[javac] ^
[javac] 4 errors
BUILD FAILED
It looks like the build script expecting a JSF jar file. But I thought it is already included in the glassfish packages. Here is the output from ./pkg list
with
glassfish-jsf 1.2.12-1 installed u---
included.
NAME (AUTHORITY) VERSION STATE UFIX
felix 1.2.2-0 installed ----
glassfish-amx 3.0-28.5 installed ----
glassfish-api 3.0-28.5 installed ----
glassfish-common 3.0-28.5 installed ----
glassfish-ejb 3.0-28.5 installed ----
glassfish-grizzly 1.8.6.2-0 installed ----
glassfish-gui 3.0-28.5 installed ----
glassfish-hk2 3.0-28.5 installed ----
glassfish-jca 3.0-28.5 installed ----
glassfish-jdbc 3.0-28.5 installed ----
glassfish-jdbc-gui 3.0-28.5 installed ----
glassfish-jdbc-management 3.0-28.5 installed ----
glassfish-jpa 3.0-28.5 installed ----
glassfish-jsf 1.2.12-1 installed u---
glassfish-jta 3.0-28.5 installed ----
glassfish-management 3.0-28.5 installed ----
glassfish-nucleus 3.0-28.5 installed ----
glassfish-registration 3.0-28.5 installed ----
glassfish-scripting 3.0-28.5 installed ----
glassfish-web 3.0-28.5 installed ----
glassfish-web-gui 3.0-28.5 installed ----
glassfish-web-management 3.0-28.5 installed ----
javadb 10.2.2.1-0 installed u---
pkg 1.0.7-15.1269 installed ----
pkg-java 1.0.7-15.1269 installed ----
python2.4-minimal 2.4.4.0-15.1269 installed ----
did I missed something ?
|
||
|
|