Professional Documents
Culture Documents
Report On Online College Magzine
Report On Online College Magzine
Report On Online College Magzine
ON
Bachelors of Technology
In
Certified that Kumar Ankit, student of sem. 8th IT batch(2008-12) KIIT College of
Engineering have undertaken the project work entitled “Online College Magazine”
under the supervision of Mrs. Namita Khurana as per requirement stipulated in the
course curriculum . The performance of the student has been satisfactory.
The project work entitled “Online College Magazine” was carried out at KIIT College
of Engineering, Gurgaon under the guidance of Mrs. Namita khurana. We gratefully
acknowledge the guidance of our project Incharge for the successful completion of the
project. The support of Head of the Department, Director General Principal, faculty and
the laboratory staff in execution of project is gratefully acknowledged.
Kumar Ankit
Palki Asija
Akshay Gupta
Abstract
The project “ONLINE COLLEGE MAGAZINE” assists the students in posting and reading
academic articles , Subjective notes. Using this online system , one can can enhance technicual
as well as subjective knowledge by reading articles . you can manage all your information from a
single database file. Within the file, divide your data into separate storage containers called
tables; view, add, and update table data using online forms; it includes forums, Post and
comments and some FAQs on the related topics, through which we can create networking with
other existing users.
This website includes the whole profile of the KIIT students, it also gives the relevant
information or notices about various events to the students of KIIT. This website uses the .net
platform for the development of the project. It is made very user friendly and easy to use.
Content List
b. Software requirements
Project Scope
The goal of our project is to create a Online Forum that will enable college students and
faculties to post and read various articles, thus promoting literary insight.
Factors behind the motivation of this system are:
1. Not all students make it to the printed magazine.
2. Creativity of students needs to be nurtured.
3. Creating a user-friendly interactive place where students/faculties can share their
ideas.
J2EE is used as the basic programming platform for the software. J2EE provides a vast
Library of tools for developing the required user interface of our software, and also the
various inbuilt security authentications need in project.
.
Objectives :
To explore and implement a online forum where college students and faculties can post
and read various articles
To provide the user with an easy User Interface (GUI) , where user can search article ,
can comment , can Rate article.
To gain experience in the Java programming.
To create the project as an servlet for use on the web, so users can log on to my home
page and use this program.
i. Search Engine for all the articles posted till date. Accessible by anybody.
ii. Essential steps to be taken to prevent authenticity infringement.
iii. Articles to be distributed in categories. Can overlap 2 or more categories. Articles to be
associated with suitable tags by the registered users at the time of posting, so that they are
searchable.
iv. The home page to consist of attractive essential features like: recent post’s, college news,
blogs etc.
v. Interactive feedback to be supported to enhance the user experience.
vi. Guests can read articles, Blogs, College news . They can also access other optional features
(amenities like Word of the day, etc.) but can’t post articles unless they sign in as registered
users.
vii. Prevent standard automated software from filling out a form.
viii. Alumni registration to be supported.
ix. Registered members, Moderators and Administrators are allowed to post articles.
x. Registered users, Moderators, and Admins will have their own profile, where they can edit
info for the world to see. Useful “updated” info related to their activities to be available at their
profiles.
xi. Regex to be extensively used for prohibiting obscene and unacceptable comments.
xii. Moderators will have associated categories, according to which to-be-validated-articles will
be posted to them on their profiles. On rejection, he will have to provide a reason for the same,
which will be forwarded to the concerned user.
xiii. Automated mails to be sent on rejection/acceptance of articles.
Admin can add/delete moderators. Progress report of moderators will be available to her/him.
Admin has all the privileges a moderator has. Can post news which will be visible at the home
page.
Software Requirements
Operating system – Windows XP or Windows 7
Jdk6.0,
jre6.0,
Apache Tomcat Server7.0
IDE : Eclipse 3.0
MySQL
Project Architecture :
For Implementing modules MVC (Model View Controller) architecture is used.
Model View Controller:
Model–View–Controller (MVC) is an architectural pattern that splits interactions
between users and applications into three roles:
the Model (business logic),
the View (user interface), and
the Controller (user input).
This separation of concerns facilitates the independent development, testing, and
maintenance of each role.
Login.jsp
<form action="loginAction"
name="login" method="post">
<center><table>
<tr><td><font face="verdana,arial"
size=-1>Login:</td><td><input
type="text" name="loginId" /></td></tr>
<tr><td><font face="verdana,arial"
size=-1>Password:</td><td><input
type="password" name="password"
/></td></tr>
<tr><td><font face="verdana,arial"
MVC Example :
size=-1> </td><td><font
face="verdana,arial"
View: size=-1><input
type="submit" name="Submit"
value="Submit"/></td></tr>
<tr><td colspan=2><font
face="verdana,arial"
size=-1> </td></tr>
</table></center>
</form>
LoginServlet.java
MVC Example :
Model:
LoginDao.java
package com.ankit.student.servlet;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.ankit.student.action.RegistrationAction;
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
// TODO Auto-generated method stub
super.doGet(req, resp);
}
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws
ServletException, IOException {
String destination = "registration.jsp";
String name = request.getParameter("name");
String age = request.getParameter("age");
String mobile = request.getParameter("mobile");
String email = request.getParameter("email");
String password = request.getParameter("password");
System.out.println(password);
String confirmPassword = request.getParameter("confirmPassword");
RegistrationAction action = new RegistrationAction();
try {
action.performRegistration(name, age, mobile, email, password,
confirmPassword);
destination="welcomeUser.jsp";
response.sendRedirect(destination);
} catch (Exception e) {
e.printStackTrace();
response.sendRedirect(destination);
}
}
}
Coding :
Registrationaction.java
package com.ankit.student.action;
import com.ankit.student.dao.UserDAO;
import com.ankit.student.pojo.User;
public void performRegistration(String name, String age, String mobile, String email, String
password, String confirmPassword) throws Exception {
public void validateRegistrationData(String name, String age, String mobile, String email,
String password, String confirmPassword) throws Exception {
package com.ankit.student.dao;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import com.ankit.student.db.DBConnection;
import com.ankit.student.pojo.User;
/*
* Data Access Object Layer for the USER
*/
public void createUser(User user) throws Exception {
Connection con = null;
PreparedStatement stmt = null;
ResultSet rs = null;
try {
con = DBConnection.getConnection();
if(con != null && !con.isClosed()) {
String query = "insert into user values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
stmt = con.prepareStatement(query);
stmt.setInt(1, 50);
stmt.setString(2, user.getName());
stmt.setString(3, user.getPassword());
stmt.setString(4, "admin");
stmt.setString(5, null);
stmt.setString(6, null);
stmt.setString(7, null);
stmt.setString(8, user.getName());
stmt.setString(9, user.getMobile());
stmt.setInt(10, Integer.parseInt(user.getAge()));
stmt.setString(11, user.getEmail());
stmt.setString(12, user.getUserDescription());
stmt.executeUpdate();
con.commit();
System.out.println("User Created Successfully");
} else {
throw new SQLException("%%%% ERROR IN GETTING CONNECTION WITH
DATABASE %%%%");
}
} catch (Exception e) {
throw e;
} finally {
DBConnection.closeAll(con, stmt, rs);
}
}
}
Coding :
DBConnection.java
package com.ankit.student.db;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
} catch(Exception e) {
throw e;
}
}
public static void closeAll(Connection con, PreparedStatement stmt, ResultSet rs)
{
try {
if(rs != null) {
rs.close();
}
if(stmt != null) {
stmt.close();
}
if(con != null) {
con.close();
}
} catch(Exception e) {
e.printStackTrace();
}
}
/**
* @param con
* @param stmt
*/
public static void closeConnection(Connection con, PreparedStatement stmt) {
try {
if(stmt != null) {
stmt.close();
}
if(con != null) {
con.close();
}
} catch(Exception e) {
e.printStackTrace();
}
}
}
Coding :
CreatelectureServlet.java
package com.ankit.student.servlet;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import com.ankit.student.action.CreateLectureAction;
import com.ankit.student.action.LoginAction;
import com.ankit.student.action.RegistrationAction;
import com.ankit.student.pojo.Lecture;
import com.ankit.student.pojo.User;
@WebServlet("/Create_LectureServlet")
public class CreateLectureServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
public CreateLectureServlet() {
super();
// TODO Auto-generated constructor stub
}
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws
ServletException, IOException {
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws
ServletException, IOException {
String destination = "createLecture.jsp";
String LectureName = request.getParameter("lectureName");
String Category = request.getParameter("category");
String lecture = request.getParameter("lecture");
HttpSession session = request.getSession(false);
CreateLectureAction action = new CreateLectureAction();
try {
action.PerformLecturePost(LectureName,Category,lecture);
response.sendRedirect(destination);
} catch (Exception e) {
e.printStackTrace();
response.sendRedirect(destination);
}
}
}
Coding :
CreateLectureAction.java
package com.ankit.student.action;
import com.ankit.student.dao.LectureDao;
import com.ankit.student.pojo.Lecture;
}
public void validateLecturePost(String LectureName,String Category,String lecture) throws
Exception {
package com.ankit.student.dao;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import com.ankit.student.db.DBConnection;
import com.ankit.student.pojo.Lecture;
import com.ankit.student.pojo.User;
lecture.setLectureDescription(rs.getString("lectureDescription"));
} else {
throw new SQLException("%%%% ERROR IN GETTING
CONNECTION WITH DATABASE %%%%");
}
} catch (Exception e) {
throw e;
} finally {
DBConnection.closeAll(con, stmt, rs);
}
return lecture;
}
}
Coding :
CreateLectureAction.java
package com.ankit.student.servlet;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import com.ankit.student.action.LoginAction;
import com.ankit.student.pojo.User;
@WebServlet("/WelcomeServlet")
public class WelcomeServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
/**
* @see HttpServlet#HttpServlet()
*/
public WelcomeServlet() {
super();
// TODO Auto-generated constructor stub
}
destination = "createLecture.jsp";
response.sendRedirect(destination);
} catch (Exception e) {
e.printStackTrace();
response.sendRedirect(destination);
}
}
}
Coding :
ViewServlet.java
package com.ankit.student.servlet;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import com.ankit.student.action.LoginAction;
import com.ankit.student.action.ViewAction;
import com.ankit.student.pojo.Lecture;
import com.ankit.student.pojo.User;
/**
* Servlet implementation class ViewServlet
*/
@WebServlet("/ViewServlet")
public class ViewServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
/**
* @see HttpServlet#HttpServlet()
*/
public ViewServlet() {
super();
// TODO Auto-generated constructor stub
}
/**
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws
ServletException, IOException {
String destination = "createLecture.jsp";
String lectureName = request.getParameter("lectureName");
String lectureDescription = request.getParameter("lectureDescription");
HttpSession session = request.getSession(false);
ViewAction action = new ViewAction();
try {
Lecture lecture = action.RetrieveLecture(lectureName, lectureDescription);
session.setAttribute("userName", lecture.getName());
session.setAttribute("lastLogin", lecture.getLastLogin());
destination = "welcomeUser.jsp";
response.sendRedirect(destination);
} catch (Exception e) {
e.printStackTrace();
response.sendRedirect(destination);
}
/**
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
*/
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws
ServletException, IOException {
// TODO Auto-generated method stub
}
}
Coding :
ViewAction.java
package com.ankit.student.action;
import com.ankit.student.dao.ViewDao;
import com.ankit.student.pojo.Lecture;
import com.ankit.student.pojo.View;
}
}
Coding :
ViewAction.java
package com.ankit.student.dao;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import com.ankit.student.db.DBConnection;
import com.ankit.student.pojo.Lecture;
import com.ankit.student.pojo.User;
lecture.setLectureDescription(rs.getString("lecture_description"));
lecture.setCategory(rs.getString("category"));
}
} else {
throw new SQLException("%%%% ERROR IN GETTING
}
} catch (Exception e) {
throw e;
} finally {
DBConnection.closeAll(con, stmt, rs);
}
return user;
}
information
St I.D.
Call students OCM – Student
Regist-
ration system Process
Registration
nnnnn
data moves through the system , the process or transformations that the data undergo , and what
the outputs are . Data processes by college could be emphasised graphically through Data Flow
In the Zero level , the whole system is considered as one process that defines the main input and
System Testing
Systems testing is an expensive but critical process that can take as much as 50 percent of the
budget for program development. The common view of testing held by users is that it is
performed to prove that there are no errors in the program.
Testing is the process of executing a program with the explicit intention of finding errors that is,
making the program fail. A successful test, then, is one that finds an error.
Test the modules thoroughly- cover all the access paths. Generate enough data to cover
all the access paths arising from conditions.
Test the modules by passing wrong data.
To test the different access paths, look at the conditional statement. Enter some data in
the test file, which would satisfy the condition and again test the script. Repeat this
process many times.
After each test, analyze the log file to ensure proper, understandable and useful messages
are present in the log file.
Test for locking by invoking multiple concurrent processes.
Future Perspectives :
The home page to consist of attractive essential features like: most read articles, editor’s
pick, recently posted articles, highest rated articles, article of the month, college news,
etc.
Archives to be maintained.
Interactive feedback to be supported to enhance the user experience.
Prevent standard automated software from filling out a form.
Categorizing Posts And Registered members on basis of most read articles and most
Active user respectively
References:
Cornell JAVA SE 6
HeadFirst for Servlets and JSP