Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSF Newbie

 
Jotnarta Jot
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All
I am new on JSF and I am trying to develope a small page that displays a texbox from JSF library. I defined the ServletFaces class in the web.xml file as following:

I've created a jsp page called contribute.jsp that contains the following:


The last page is a HTML file that calls the above faces page like following:


But, when I run the application a download dialog appears that ask me to save the contribute.jsp page to disk. I am using Eclipse IDE and JBoss 5 AS, any help please??

jotnarta
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18167
53
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You'll get that message when your browser doesn't know what to do with the data that is being returned to it. Try contentType="text/html".

Also, lose the <META> tag. It's not only redundant (since you indicated contentType on the <%@ page directive), it's positively dangerous. I just spent 3 weeks going stark raving mad because forms being submitted weren't providing the control values. Some clown had coded a META tag that redefined the content type.

Plus, I don't even guarantee that META content type will work properly on all browsers or all versions of IE or even individual versions of IE with different DOCTYPES (which I like to call their "select-a-bug" feature).
 
Lars Vogel
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A detailed step-by-step description of creating a simple JSF application (including a textbox) can be found here: JavaServer Faces with Eclipse - Tutorial

Best regards, Lars
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic