Frameworks| Hibernate| Struts| JSF| JavaFX| Ajax| Spring| DOJO| JDO| iBatis| Questions?

 

 

 

 

 

 

 

 

 

 

 

 

 

Search Tutorials

Latest Questions
Comments
 
JSF Hello World 
 

In this example, we will be developing JSF Hello World example application in NetBeans IDE.

 

JSF Hello World

                          

In this example, we will be developing JSF Hello World example application in NetBeans IDE. This example illustrates how to print hello world in JSF application using NetBeans IDE. NetBeans IDE provides simple way to create and test web applications. Its provides standardized directory structure to create the project artifacts such as jsp pages, xml pages, java classes etc.

Steps to create JSF Hello World Example:

1. Go to your project and right click on "Web Pages" folder.
2. The select "New" option and  and click on "JSP..." as shown below.

Creating new JSP page in NetBeans IDE

Now it will open a jsp page where you can write your code. For this example, we will use code given in HelloWorld.jsp as below.

Source code of HelloWorld.jsp

 

<%-- 
    Document   : HelloWorld
    Created on : Sep 9, 2008, 8:03:01 PM
    Author     : sandeep
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
        <f:view>
            <h1><h:outputText value="Hello World!" /></h1>
        </f:view>
    </body>
</html>


Now you need to run the application to see the output for the code written above. The following steps can be used to run the JSF application in NetBeans IDE.

  • Right click on the HelloWorld.jsp page.
  • Select Run File from the appeared menu.
  • The Run File will start the server deploy the application and display the output on the web browser.

OR, Run the above file by using Shift + f6 keys on keyboard. The output is shown on the browser like below:

Download Source Code

                          

» View all related tutorials
Related Tags: java flex programming ide development netbeans language sed environment vi quality range int id beans gem program lex ram base

Leave your comment:

Name:

Email:

URL:

Title:

Comments:


Enter Code:

Audio Version
Reload Image
 

Note: Emails will not be visible or used in any way, and are not required. Please keep comments relevant. Any content deemed inappropriate or offensive may be edited and/or deleted.

No HTML code is allowed. Line breaks will be converted automatically. URLs will be auto-linked. Please use BBCode to format your text.

Add This Tutorial To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Training Courses
Tell A Friend
Your Friend Name
Software Solutions
Least Viewed
Most Rated
Recently Viewed
Search Tutorials

 

 
 

Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Search Engine | News Archive | Jboss 3.0 tutorial | Free Linux CD's | Forum | Blogs

About Us | Advertising On RoseIndia.net  | Site Map

India News

Indian Software Development Company | iPhone Development Company in India | Flex Development Company in India | Java Training Delhi | Java Training at Noida |

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2008. All rights reserved.