This sample application is a complete J2EE Web application that demonstrates the use of JavaServer Faces (JSF) components and Service Data Objects (SDO) components. Within this sample application, JSF pages are used along with cascading style sheets, page templates, and Web Site Designer to create a complete Web site for a classified advertising company. Users can view and post classified advertisements on this Web site. If logged in as a site administrator, the user can take advantage of extra administration functionality.
Overview
Running the sample
About the Classified Ads Web site
The JSF Classified Ads Web site is similar to many Web-based classified advertisement sites. When you first open the site, you are redirected to the home page. A JSF template has been applied to all of the site pages so that the banner and navigation are available on all pages.
All the advertisements, news items, and related data are held in a database. A Derby database containing the sample data is packaged with the sample. Plus, a simple administrator account is provided to demonstrate the functions an administrator performs on such a site. The login functionality is not a proper implementation of login and does not provide correct authentication. Details of the administrator tasks are described in the About the Classified Ads Web site section.
All the setup is done automatically when you import the JSF Classified Ads Web site sample application. When the import is complete, follow these steps to run the sample and test it on a server:
classifieds
and
select Run As > Run on Server. The Server Selection window
opensThe JSF Classified Ads Web site sample is published to the server and starts to run. A Web browser window opens and displays an initial page that redirects to the Web site home page.
The top of the JSF template contains the following navigation links:
admin
using any password. The
Admin page allows the user to manage the ad categories.All the data relating to advertisement and news items are held in a database. A Derby database containing the sample data is packaged with the sample. A simple administrator account is provided to allow for the demonstration of the functions an administrator would perform on such a site. The login functionality is not a practical implementation of login and does not provide authentication. Details of the administrator tasks are described in the Admin section.
Opens the initial home page that displays when you load the sample.
Opens a page that allows the user to browse the advertisements. The page displays all of the categories and subcategories of a given category. The category and subcategories are used to filter the advertisement search. When an ad is selected, the details for that ad are displayed.
Allows the user to create an advertisement and post the advertisement to the Web site. The user specifies the category and subcategory under which the item should be placed. A file upload facility is available for the user to include an image. A rich text editor component is provided to allow the user to create a formatted ad description. Once the ad is completed and submitted the posting is stored in the backend database. A confirmation of the posting detail is displayed.
Provides advanced search capabilities on the advertisements in the site. Searching without specifying search criteria will display all advertisements, displayed in a paged data grid with 5 items per page. Searching on Title and Description are case sensitive. A search on a partial word can be achieved by placing the wild character % before and after the desired phrase. The user can select which categories to search within and also a price range. Selecting an advertisement from the Search Results page will display the advertisement details.
Logs out the current user. Selecting this option logs out the administrator. No administrator actions can be performed unless the user is logged in.
This link is only visible when you are logged in as an
administrator. For this sample, you can log in as admin
by using any
password. The link opens a page which allows the user to manage news
items, available categories, and view the details of the classified ads
in edit mode.
Administrative tasks for this site include the following:
Disclaimer:
The following [enclosed] code is sample code created by IBM Corporation. This sample code is not part of any standard IBM product and is provided to you solely for the purpose of assisting you in the development of your applications. The code is provided 'AS IS', without warranty or condition of any kind. IBM shall not be liable for any damages arising out of your use of the sample code, even if IBM has been advised of the possibility of such damages.