File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSF and the fly likes JSF Newbie Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "JSF Newbie" Watch "JSF Newbie" New topic

JSF Newbie

Jotnarta Jot

Joined: May 18, 2006
Posts: 24
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??

Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17410

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).

An IDE is no substitute for an Intelligent Developer.
Lars Vogel
Ranch Hand

Joined: Oct 10, 2007
Posts: 55
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

Tutorials about Java, Eclipse and Webprogramming
I agree. Here's the link:
subject: JSF Newbie
jQuery in Action, 3rd edition