File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSF and the fly likes First Cup: Java EE Tutorial Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "First Cup: Java EE Tutorial" Watch "First Cup: Java EE Tutorial" New topic
Author

First Cup: Java EE Tutorial

Mitch Robinson
Ranch Hand

Joined: Oct 29, 2009
Posts: 30
Hi Guys,

I'm just trying to get my head around the whole J2EE platform, so decided to have a go at the FirstCup tutorial Sun provide. I have followed all the steps but when i goto run the app I get a blank page.

My greetings.xhtml looks like this:-



I first thought my link to @bundle were wrong but I have check this and it is linked correctly, the only thing that seems to work is the title in the header.

I have tried using index.xhtml as my opening page which is simply:-



This displays both the title and the body, so it appears it's the hutputText that isn't working. Any ideas on why would be grateful, to give more information I'm using a Mac with Safari but have also tried Firefox which didn't work.

Thanks in advance,
Mitch



Mitch Robinson
Ranch Hand

Joined: Oct 29, 2009
Posts: 30
Further to explain the problem the page shows in my browser but there is nothing on it, bar the correct title. No errors or anything and I'm pretty certain everything has been followed exactly to the guide
Mark E Hansen
Ranch Hand

Joined: Apr 01, 2009
Posts: 650
What browser are you using?

I ask because it looks like you're serving XHTML, not HTML, and IE doesn't do XHTML.
Mitch Robinson
Ranch Hand

Joined: Oct 29, 2009
Posts: 30
I'm using Safari, which seems to accept xhtml as the title bar is displayed correctly. Just seems to be the parts with the form description?
Riaan Nel
Ranch Hand

Joined: Apr 23, 2009
Posts: 160

What happens if you replace one of the EL expressions (i.e. "#{bundle.Welcome}") with static text? I'd also try printing out the bundle, just to check that it isn't null somehow. ("{bundle}")


"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." - George Bernard Shaw
Mitch Robinson
Ranch Hand

Joined: Oct 29, 2009
Posts: 30
Riaan,

If I try with just static text, the text appears to display. I'll try to display just the bundle later, but when I type bundle. it does list the variables and the values which leads me to think the bundle isn't null?

i'm at work at the minute but as soon as I'm home I will check, any others ideas welcome in the meantime though.

Thank you for the help so far
Sara El-Kady
Greenhorn

Joined: Jan 11, 2010
Posts: 14
Hi Mitch,

I am not sure where is the problem but you're missing <f:view> tags
Mitch Robinson
Ranch Hand

Joined: Oct 29, 2009
Posts: 30
Ok, again I'll try that when I'm home but this is practically copied from the "First Cup J2 EE6 Tutorial provided by Sun"

moritz mueller
Greenhorn

Joined: Jan 21, 2010
Posts: 7
hi there,

i have exactly the same problem and google says look here :-). i tired the example firstcup app - delivered with glassfish. this one works fine - without any f:view tags.
i also tried to copy the two xhtml files and the faces-config from example over my files - no succes. so i guess the error isn't in these files?
did you solve the problem mitch?

(one addition: i am using firefox)

is there a way to get compatibility to ie? (probably renaming xhtml->html?)

and another question arose: the tutorial often states "betwwen <body> tag..." i am using netbeans 6.8 and this only generates <h:body> tags and <h:head> tags. does this make any difference? - the delivered example files have <h:head> combined with <body>.

did some more tests, i edited the code of greetings:


the browser shows:

blabla "{bundle}" #{bundle.Welcome} blah

and if i view the source code within firefox - it is exactly the code of greetings.xhtml. nothing is replaced :-(. if i run the example app the hole source code is replace - no h: tags anymore.

For some Reason i can't reply but edit my previous post!: if i click reply i get the login screen, then i typed my login and password and click login -> and i am again on the login screen! (i tested the login by logging out and in again - its wrking)
Mitch Robinson
Ranch Hand

Joined: Oct 29, 2009
Posts: 30
No I still have the same problem, my xhtml files have the <h:head> and <body> but like you I copied these over after losing patience with them not working.

When you say you tried the firstcup app, delivered with glassfish do you mean Sun's actual coded example? If that's the case then the xhtml and faces-config must be correct, but due to my lack of understanding of j2ee I'm not sure which component/technology controls these.

I am trying it with both Firefox and Safari and still no joy, I for some reason don't have the example code in my projects.

Blub, can you take a copy of your firstcup app, then try copying over the other classes from their example to your copied example, one at a time then try to run the app. This will help identify which class contains the problem hopefully. Once we know which class(es) is/are the problem we can work out what is actually wrong with them.

Can you do this? Again I'm now at work and can't attempt this until I'm home later

Thanks,
Mitch
moritz mueller
Greenhorn

Joined: Jan 21, 2010
Posts: 7
ok reply is working wit ie?! so my reply:

in meantime i tried to copy over the dukeBDay.java - no success. before i copy the rest of the files i would wait for some experts to give additional tips - what to copy first. i am the same kind of java ee noob as you :-)

if you don't have the example in glassfishInstallDir/glassfish/docs/firstcup/example, try the update tool. the tutorial say it could be installed with it.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: First Cup: Java EE Tutorial