FAQs.Com

This website allows users to share Frequently asked questions (FAQs). Users can post FAQs under different topics.

It allows user to do the following:

Architecture Of the Project

This project uses JSF 2.0 to build the interface. Managed Beans talk to DAO (Data Access Objects), which talk to database using JDBC.

So overall architecture is - JSF Components -> Managed Beans -> DAO -> JDBC -> Oracle Database.

It also uses a filter (Intercepting Filter design pattern) to ensure only authenticated users access secured pages.

It uses built-in AJAX in JSF 2.0 to validate username and email as user registers.

It uses JavaMail to send mail to user with password in forgot password page.

Products and frameworks used in this project

Steps to download and deploy this project

  1. Download faqs.rar. The .rar file contains the entire source code for the project. Unzip the file into c:\ so that c:\faqs folder is created with all the components of the project.
  2. However, in order to keep the download small, the project does not contain .jar files related to JSF, Oracle and Java Mail. So you need to add them by taking the following steps.
  3. Open the project in NetBeans 7.0
  4. Go to properties of the project using popup menu. Select libraries node and delete existing libraries using  Remove button. Then add - Oracle - ojdbc14.jar and mail.jar (assuming you have downloaded JavaMail API) for Java Mail. You have to add these .jar files to the project using Add Jar/Folder button.
  5. Create faqs account with password faqs in Oracle10g Express Edition. This must be done after you log in as SYSTEM user. Then create tables and sequences listed below after connecting to Oracle as faqs
    
    create table users 
    ( userid  number(5)  constraint users_uname_pk primary key,
      username varchar2(10)  unique not null,
      password varchar2(10)  not null,
      email    varchar2(50)  unique,
      joinedon date,
      profile  varchar2(200)
    );
    
    
    create sequence sq_userid nocache;
    
    create table topics
    ( topicid  number(2)  primary key,
      topictitle varchar2(50)  not null,
      addedon date
    );
    
    
    create sequence  sq_topicid nocache;
    
    insert into topics values ( sq_topicid.nextval, 'Java Language', sysdate);
    insert into topics values ( sq_topicid.nextval, 'JDBC', sysdate);
    insert into topics values ( sq_topicid.nextval, 'JSF', sysdate);
    
    
    create table faqs
    ( faqid number(5)  primary key,
      question varchar2(200)  not null,
      answer   varchar2(1000) not null,
      postedby number(5)  references users(userid),
      topicid  number(2)  references topics(topicid),
      postedon date
    );
    
    create sequence sq_faqid nocache;
    
    
  6. Run login.xhtml. Use registration link and register as a new user. Test the rest of the pages in the website.