Press release | News release management system + paper + PPT based on JavaWeb

Author Homepage: Programming Compass

About the author: High-quality creator in the Java field, CSDN blog expert, invited author of Nuggets, many years of architect design experience, resident lecturer in Tencent Classroom

Main content: Java project, graduation design, resume template, learning materials, interview question bank, technical mutual assistance

Favorites, likes, don't get lost, it's good to follow the author

Get the source code at the end of the article 

Item number: BS-PT-109

Foreword:

With the householdization and popularization of computers, smart phones and other devices that can be connected to the network, various websites have been designed and developed, with various functions and different fields involved, such as life, business, technology and so on. The release of information is a major feature of the Internet. The main requirement of people surfing the Internet is to obtain the information they want or the information they are interested in, so the news release and management system was born.

From the springing up of WEB websites in recent years, it is not difficult to see that people's understanding of external information largely depends on information publishing websites. Due to the popularity of smart phones, this demand is increasing day by day, and people are beginning to rely on these information publishing websites. Publishing websites, the reading of information is not limited to a few information publishing websites, but the more the better, as long as they can meet their needs for information understanding, the websites can be born. The emergence of these information publishing websites It has affected the living habits and information acquisition methods of our generation, and also added color to people's leisure life before tea and after dinner.

The above is the reason why I choose "News Release and Management System" as the topic of my graduation project.

    The design and development technology of "News Release and Management System" described in this article uses B/S technology in the front-end design, just to give users the most perfect user experience. The background development of this application uses java development technology, and the database uses MySQL database for data storage operations.

1. Environmental introduction

Locale: Java: jdk1.8

Database: Mysql: mysql5.7

Application server: Tomcat: tomcat8.5.31

Development tools: IDEA or eclipse

Development technology: JSP, Servlet, JDBC

2. Project introduction

The news recommendation system, on the basis of fully understanding the news business process, adopts a series of latest information processing technologies to scientifically manage news, realize the most extensive sharing of news information, and enable news to be released through computer networks. And users can browse the website through computers anytime and anywhere.

The news release system is also known as the news management and information editing management system. It can realize the centralized operation of a lot of news on the website, the main knowledge of the news manager, etc., classify the information by the content category, and then integrate, standardize, and standardize the entire online Then put it on the website for people to consult a kind of network information management program. It can use the Internet to develop a component message publishing system. The information in the page is added to the data through this simple insertion item, and finally the designed Examples of web pages are inserted so that they can be posted to the site for viewers to view. Using the Internet database, the management method of the website can be simplified to just inputting text, so that the site can call real-time information more quickly, and the workload of site management and maintenance can be effectively reduced through the news release system, which has a certain impact on the development rate of news. Very impressive improvement.

Today, with the rapid development of science and technology, the people's needs are also increasing due to the accelerated pace of life. People are eager to obtain more timely, simple and clear news. The traditional newspapers, periodicals and magazines can no longer satisfy people's desire to get first-hand information. Therefore, the news release management system with the Internet as the media unit began to gradually replace the original backward news, and became a new contemporary trend. In the fastest and most convenient way, the news collection, editing and publishing system enables people to obtain and share resources from all over the world and communicate without going out. The timeliness of the news website allows all comments and readings to be updated in real time. The news collection, editing and publishing system manages the changing information effectively by managing the news and comments published on the Internet, so that network users can obtain the multimedia display of news. The paper introduces the research background, project significance, and current research and application status of the news release management system, and clarifies the content and main work of the paper research; after the business analysis process, the problems existing in the system, the overall structure, the original business process etc. have done further research, and thus obtained the business process after transformation; module function analysis, use case analysis and use case description, and determined the system function, the system diagram and package diagram and the overall function of sub-functions, including news Publishing and other package diagrams; in the final data analysis link, the data that needs to be processed by each functional module of the entire system is analyzed and discussed. According to the relationship between these data, the entity class relationship diagram and database table structure are established; the article The last part is the summary of the research and analysis of the news release management system, puts forward the problems in the analysis, puts more efforts and careful research into the in-depth work in the future, and makes a new prospect.

The purpose of this system is to realize the basic functions of the news release system. The news release system provides different types of news (such as social news, entertainment news and technological frontier news, etc.) to meet the needs of different users; the system divides users into: ordinary users, system administrators and news administrators. Ordinary users can browse, read and search for news in this system. The title of each news is made into a link, and users can jump to the page for news reading by clicking them; on the news reading page, the detailed information of each news will be taken out, including content, title, etc.; users can search according to their own needs News, such as news can be searched by news title or news content, so that qualified news can be found quickly and search results are output; users can comment on news (allow anonymous comments). The system administrator can manage news categories, add news, modify news, review news and delete news. At the same time, the system administrator can complete user management, including system user management, adding users and changing accounts. News administrators have the authority to add news and change accounts. According to different users, different permissions are given, which strengthens the management of the system and at the same time strengthens the security of the system.

The use case diagram of ordinary users is shown in Figure 3-1. Ordinary users can browse news, user login, and news comment functions;

Figure 3-1 Common user use case diagram

Administrator user use case Figure 3-2 The administrator has the permissions of user login, comment management, news column management, and news management.

Figure 3-2 Administrator user use case diagram

In order to ensure that the correct data is in the system to objectively reflect the world, some of these integrity rules are implemented through some controlled standard operating procedures. The database should have security, which is an important aspect of the database system. It refers to the protection of the database to prevent illegal use, including destruction and unauthorized access.

However, since the data involved in the system designed and developed this time does not have confidential data, there is no need to take particularly complicated security measures, only to prevent the data from being changed arbitrarily. According to the system requirements, the following data items and data structures can be listed, and the entity model is represented by ER diagram 2-4 below

In order to ensure that the correct data is in the system to objectively reflect the world, some of these integrity rules are implemented through some controlled standard operating procedures. The database should have security, which is an important aspect of the database system. It refers to the protection of the database to prevent illegal use, including destruction and unauthorized access.

However, since the data involved in the system designed and developed this time does not have confidential data, there is no need to take particularly complicated security measures, only to prevent the data from being changed arbitrarily. According to the system requirements, the following data items and data structures can be listed, and the entity model is represented by ER diagram 2-4 below

Figure 2-4 Solid Model

Three, system display

front page

user registration

 User login

 news browsing

 Backstage management

 column management

news management

Fourth, the core code display

package com.action;
/**
 * 管理员登陆 增加 修改 删除 删除登陆日志
 */
import java.io.IOException;
import java.util.List;
import java.util.StringTokenizer;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import com.bean.AdminBean;
import com.bean.SystemBean;
import com.util.Constant;
import com.util.MD5;

public class AdminServlet extends HttpServlet {

	/**
	 * Constructor of the object.
	 */
	public AdminServlet() {
		super();
	}

	/**
	 * Destruction of the servlet. <br>
	 */
	public void destroy() {
		super.destroy(); // Just puts "destroy" string in log
		// Put your code here
	}

	/**
	 * The doGet method of the servlet. <br>
	 *
	 * This method is called when a form has its tag value method equals to get.
	 * 
	 * @param request the request send by the client to the server
	 * @param response the response send by the server to the client
	 * @throws ServletException if an error occurred
	 * @throws IOException if an error occurred
	 */
	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {

		doPost(request,response);
	}

	/**
	 * The doPost method of the servlet. <br>
	 *
	 * This method is called when a form has its tag value method equals to post.
	 * 
	 * @param request the request send by the client to the server
	 * @param response the response send by the server to the client
	 * @throws ServletException if an error occurred
	 * @throws IOException if an error occurred
	 */
	public void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {

		response.setContentType(Constant.CONTENTTYPE);
		request.setCharacterEncoding(Constant.CHARACTERENCODING);
		try{
			String method=request.getParameter("method").trim();
			AdminBean loginbean = new AdminBean();
			HttpSession session = request.getSession();
			session.setMaxInactiveInterval(1200);
			SystemBean systembean = new SystemBean();
			String sysdir = systembean.getDir();
			if(method.equals("one")){//管理员登录
				String username = request.getParameter("username");
				String password = request.getParameter("password");
				if(username == null||username.trim().equals("")){
					request.setAttribute("message", "请正确输入用户名!");
					request.getRequestDispatcher(sysdir+"/login.jsp").forward(request, response);
				}
				else if(password == null||password.trim().equals("")){
					request.setAttribute("message", "请输入密码!");
					request.getRequestDispatcher(sysdir+"/login.jsp").forward(request, response);
				}
				else{
					String md5password = MD5.MD5(password);
					String agent = request.getHeader("user-agent"); 
					StringTokenizer st = new StringTokenizer(agent,";"); 
					String useros=st.nextToken();
					String loginip = request.getRemoteAddr();			
					int flag = loginbean.adminLogin(username,md5password, password,useros,loginip);
					switch (flag){
						case Constant.SUCCESS:
							List list = loginbean.getAdminInfo(username);
							session.setAttribute("user", username);
							session.setAttribute("list", list);
							request.getRequestDispatcher(sysdir+"/").forward(request, response);
							break;
						case Constant.NAME_ERROR:
							request.setAttribute("message", "用户名错误!请确认管理权限!");
							request.getRequestDispatcher(sysdir+"/login.jsp").forward(request, response);
							break;
						case Constant.PASSWORD_ERROR:
							request.setAttribute("message", "密码错误,请确认管理权限!");
							request.getRequestDispatcher(sysdir+"/login.jsp").forward(request, response);
							break;
					}
				}
			}
			else if(method.equals("editpwd")){//修改密码
				String username2 = (String)session.getAttribute("user");
				if(username2 == null){
					request.getRequestDispatcher("error.jsp").forward(request, response);
				}
				else{
					String oldpwd = MD5.MD5(request.getParameter("oldpwd").trim());
					String newpwd = MD5.MD5(request.getParameter("newpwd").trim());
					String username = (String)session.getAttribute("user");
					int flag = loginbean.editPassword(username, oldpwd, newpwd);
					switch (flag){
						case Constant.SUCCESS:
							request.setAttribute("message", "密码修改成功!");
							request.getRequestDispatcher(sysdir+"/system/editpwd.jsp").forward(request, response);
							break;
						case Constant.PASSWORD_ERROR:
							request.setAttribute("message", "原始密码错误,请确认权限!");
							request.getRequestDispatcher(sysdir+"/system/editpwd.jsp").forward(request, response);
							break;
						case Constant.SYSTEM_ERROR:
							request.setAttribute("message", "系统维护中,请稍后再试!");
							request.getRequestDispatcher(sysdir+"/system/editpwd.jsp").forward(request, response);
							break;
					}
				}		
			}
			else if(method.equals("exit")){//退出
				String username2 = (String)session.getAttribute("user");
				if(username2 == null){
					request.getRequestDispatcher("error.jsp").forward(request, response);
				}
				else{
					session.removeAttribute("user");
					session.removeAttribute("list");
					System.gc();
					request.getRequestDispatcher("index.jsp").forward(request, response);
				}			
			}
			else if(method.equals("manager")){//增加管理员
				String username2 = (String)session.getAttribute("user");
				if(username2 == null){
					request.getRequestDispatcher("error.jsp").forward(request, response);
				}
				else{
					String ra = request.getParameter("ra").trim();
					if(ra.equals("add")){
						String username = request.getParameter("username").trim();
						String password = MD5.MD5(request.getParameter("password").trim());
						String isuse = request.getParameter("isuse").trim();
						if(isuse.equals("在用"))
							isuse = "1";
						else
							isuse = "2";
						int flag = loginbean.addManager(username, password, "2", isuse);
						if(flag == Constant.SUCCESS){
							request.setAttribute("message", "增加管理员成功!");
							request.getRequestDispatcher(sysdir+"/system/user.jsp").forward(request, response);
						}
						else if(flag == Constant.SAME_NAME){
							request.setAttribute("username", username);
							request.setAttribute("message", "该用户名已经存在!");
							request.getRequestDispatcher(sysdir+"/system/user.jsp").forward(request, response);
						}
						else{
							request.setAttribute("message", "系统维护中,请稍后再试!");
							request.getRequestDispatcher(sysdir+"/system/user.jsp").forward(request, response);
						}		
					}
					else if(ra.equals("update")){
						String username = request.getParameter("username").trim();
						String password = request.getParameter("password").trim();
						String isuse = request.getParameter("isuse").trim();
						if(!password.equals("")){
							password = MD5.MD5(password);
						}
						if(isuse.equals("在用"))
							isuse = "1";
						else
							isuse = "2";
						int flag = loginbean.updateManager(username, password, "2", isuse);
						if(flag == Constant.SUCCESS){
							request.setAttribute("message", "修改管理员信息成功!");
							request.getRequestDispatcher(sysdir+"/system/user.jsp").forward(request, response);
						}	
						else{
							request.setAttribute("message", "系统维护中,请稍后再试!");
							request.getRequestDispatcher(sysdir+"/system/user.jsp").forward(request, response);
						}		
					}
				}
			}
			else if(method.equals("delm")){//删管理员
				String username2 = (String)session.getAttribute("user");
				if(username2 == null){
					request.getRequestDispatcher("error.jsp").forward(request, response);
				}
				else{
					int id = Integer.parseInt(request.getParameter("id").trim());
					if(id == 1){
						request.setAttribute("message", "不能删除原始帐号!");
						request.getRequestDispatcher(sysdir+"/system/user.jsp").forward(request, response);
					}
					else{
						int flag = loginbean.delManager(id);
						if(flag == Constant.SUCCESS){
							request.setAttribute("message", "删除成功!");
							request.getRequestDispatcher(sysdir+"/system/user.jsp").forward(request, response);
						}	
						else{
							request.setAttribute("message", "系统维护中,请稍后再试!");
							request.getRequestDispatcher(sysdir+"/system/user.jsp").forward(request, response);
						}	
					}
				}			
			}
			else if(method.equals("dellog")){//delete login note
				String username2 = (String)session.getAttribute("user");
				if(username2 == null){
					request.getRequestDispatcher("error.jsp").forward(request, response);
				}
				else{
					String check[] = request.getParameterValues("checkit");
					if(check == null){
						request.setAttribute("message", "请选择要删除的记录!");
						request.getRequestDispatcher(sysdir+"/system/log.jsp").forward(request, response);
					}
					else{
						int id[]= new int[check.length];
						for(int i = 0;i<check.length;i++){
							int s = Integer.parseInt(check[i]);				
							id[i] = s;
						}
						int flag = loginbean.delLog(id);
						if(flag == Constant.SUCCESS){
							request.setAttribute("message", "删除记录成功!");
							request.getRequestDispatcher(sysdir+"/system/log.jsp").forward(request, response);
						}
						else{
							request.setAttribute("message", "系统维护中,请稍后再试!");
							request.getRequestDispatcher(sysdir+"/system/log.jsp").forward(request, response);
						}
					}
				}			
			}
			else{//无参数传入转到错误页面
				request.getRequestDispatcher("error.jsp").forward(request, response);
			}
		}catch(Exception e){
			e.printStackTrace();
			request.getRequestDispatcher("error.jsp").forward(request, response);
		}
		
	}

	/**
	 * Initialization of the servlet. <br>
	 *
	 * @throws ServletException if an error occure
	 */
	public void init() throws ServletException {
		// Put your code here
	}

}
package com.action;

/**
 * 会员注册、修改资料等
 * @author Administrator
 *
 */


import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import com.bean.MemberBean;
import com.bean.SystemBean;
import com.util.Constant;
import com.util.Filter;
import com.util.MD5;

public class MemberAction extends HttpServlet {

	/**
	 * Constructor of the object.
	 */
	public MemberAction() {
		super();
	}

	/**
	 * Destruction of the servlet. <br>
	 */
	public void destroy() {
		super.destroy(); // Just puts "destroy" string in log
		// Put your code here
	}

	/**
	 * The doGet method of the servlet. <br>
	 *
	 * This method is called when a form has its tag value method equals to get.
	 * 
	 * @param request the request send by the client to the server
	 * @param response the response send by the server to the client
	 * @throws ServletException if an error occurred
	 * @throws IOException if an error occurred
	 */
	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {

		doPost(request,response);
	}

	/**
	 * The doPost method of the servlet. <br>
	 *
	 * This method is called when a form has its tag value method equals to post.
	 * 
	 * @param request the request send by the client to the server
	 * @param response the response send by the server to the client
	 * @throws ServletException if an error occurred
	 * @throws IOException if an error occurred
	 */
	public void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {

		response.setContentType(Constant.CONTENTTYPE);
		request.setCharacterEncoding(Constant.CHARACTERENCODING);
		HttpSession session = request.getSession();
		MemberBean memberBean = new MemberBean();
		String method = Filter.escapeHTMLTags(request.getParameter("method").trim());
		/*********************************************
		 * 会员注册通用(检查用户名 修改密码 reg2.jsp页面跳转)
		 *********************************************/
		if(method.equals("reg2")){//会员注册 reg2.jsp
			String username = Filter.escapeHTMLTags(request.getParameter("username").trim());
			String password = Filter.escapeHTMLTags(request.getParameter("password").trim());
			String reg_type = Filter.escapeHTMLTags(request.getParameter("reg_type").trim());
			request.setAttribute("username", username);
			request.setAttribute("password", password);
			request.setAttribute("reg_type", reg_type);
			if(username.trim().equals("admin")){
				request.setAttribute("username", username);
				request.setAttribute("message", "非法的用户名,请重新选择!");
				request.getRequestDispatcher("reg2.jsp").forward(request, response);
			}
			else{
				int flag = memberBean.checkRegName(username);
				if(flag == Constant.SUCCESS){
					if(reg_type.equals("person")){//如果是个人会员
						request.getRequestDispatcher("personreg.jsp").forward(request, response);
					}
					else if(reg_type.equals("co")){//如果是企业会员
						request.getRequestDispatcher("coreg.jsp").forward(request, response);
					}
					else{
						request.getRequestDispatcher("index.jsp").forward(request, response);
					}
				}
				else if(flag == Constant.SAME_NAME){
					request.setAttribute("username", username);
					request.setAttribute("message", "对不起,该用户名已存在,请重新选择!");
					request.getRequestDispatcher("reg2.jsp").forward(request, response);
				}
				else{
					request.setAttribute("message", "系统维护中,请稍后再试!");
					request.getRequestDispatcher("reg2.jsp").forward(request, response);
				}
			}
			
			
		}
		else if(method.equals("checksame")){//检查注册名是否可用
			String username = Filter.escapeHTMLTags(request.getParameter("username").trim());
			if(username.trim().equals("admin")){
				request.setAttribute("username", username);
				request.setAttribute("message", "非法的用户名,请重新选择!");
				request.getRequestDispatcher("reg2.jsp").forward(request, response);
			}
			else{
				int flag = memberBean.checkRegName(username);
				if(flag == Constant.SUCCESS){
					request.setAttribute("username", username);
					request.setAttribute("message", "恭喜您,这个名字可以使用!");
					request.getRequestDispatcher("reg2.jsp").forward(request, response);
				}
				else if(flag == Constant.SAME_NAME){
					request.setAttribute("username", username);
					request.setAttribute("message", "对不起,该用户名已存在,请重新选择!");
					request.getRequestDispatcher("reg2.jsp").forward(request, response);
				}
				else{
					request.setAttribute("message", "系统维护中,请稍后再试!");
					request.getRequestDispatcher("reg2.jsp").forward(request, response);
				}
			}
		}
		else if(method.equals("Editpwd")){//会员修改登陆密码
			String member=(String)session.getAttribute("member");
			String type=(String)session.getAttribute("type");
			if(member==null||type==null){
				response.sendRedirect("error.jsp");
			}
			else{
				String oldpwd = MD5.MD5(request.getParameter("oldpwd").trim());
				String newpwd = MD5.MD5(request.getParameter("newpwd").trim());
				int flag = memberBean.editPassword(member, oldpwd, newpwd);
				switch (flag){
					case Constant.SUCCESS:
						request.setAttribute("message", "密码修改成功!");
						request.getRequestDispatcher("member/info/editpwd.jsp").forward(request, response);
						break;
					case Constant.PASSWORD_ERROR:
						request.setAttribute("message", "原始密码错误,请确认权限!");
						request.getRequestDispatcher("member/info/editpwd.jsp").forward(request, response);
						break;
					case Constant.SYSTEM_ERROR:
						request.setAttribute("message", "系统维护中,请稍后再试!");
						request.getRequestDispatcher("member/info/editpwd.jsp").forward(request, response);
						break;
				}
			}
		}
		/*********************************************
		 * 个人会员注册、修改资料 
		 *********************************************/
		else if(method.equals("PREG")){//个人会员详细资料
			String username = Filter.escapeHTMLTags(request.getParameter("username").trim());
			String password = Filter.escapeHTMLTags(request.getParameter("password").trim());
			String type = "person";
			String realname = Filter.escapeHTMLTags(request.getParameter("realname").trim());
			String sex = Filter.escapeHTMLTags(request.getParameter("sex").trim());
			String sheng = Filter.escapeHTMLTags(request.getParameter("sheng").trim());
			String city = Filter.escapeHTMLTags(request.getParameter("city").trim());
			String bir = Filter.escapeHTMLTags(request.getParameter("bir").trim());
			String telphone = Filter.escapeHTMLTags(request.getParameter("telphone").trim());
			String email = Filter.escapeHTMLTags(request.getParameter("email").trim());
			String question = Filter.escapeHTMLTags(request.getParameter("question").trim());
			String answer = Filter.escapeHTMLTags(request.getParameter("answer").trim());
			String address = Filter.escapeHTMLTags(request.getParameter("address").trim());
			String lastip = request.getRemoteAddr();
			int off = 1;
			int flag = memberBean.personReg(username, password, type, realname, sex, bir,sheng,city, telphone, email, question, answer, lastip, off,address);
			if(flag == Constant.SUCCESS){
					List siteList = new SystemBean().getSiteInfo();
					String sitename = siteList.get(0).toString();
					request.setAttribute("message", "注册成功!恭喜您成为"+sitename+"的注册会员!");
					request.getRequestDispatcher("login.jsp").forward(request, response);
				
			}
			else{
				request.setAttribute("message", "系统维护中,请稍后再试!");
				request.getRequestDispatcher("personreg.jsp").forward(request, response);
			}
		}
		else if(method.equals("UPREGINFO")){//个人会员修改资料
			String member=(String)session.getAttribute("member");
			String type=(String)session.getAttribute("type");
			if(member==null||type==null){
				response.sendRedirect("error.jsp");
			}
			else{
				String realname = Filter.escapeHTMLTags(request.getParameter("realname").trim());
				String sex = Filter.escapeHTMLTags(request.getParameter("sex").trim());
				String sheng = Filter.escapeHTMLTags(request.getParameter("sheng").trim());
				String city = Filter.escapeHTMLTags(request.getParameter("city").trim());
				String bir = Filter.escapeHTMLTags(request.getParameter("bir").trim());
				String telphone = Filter.escapeHTMLTags(request.getParameter("telphone").trim());
				String email = Filter.escapeHTMLTags(request.getParameter("email").trim());
				String question = Filter.escapeHTMLTags(request.getParameter("question").trim());
				String answer = Filter.escapeHTMLTags(request.getParameter("answer").trim());
				String address = Filter.escapeHTMLTags(request.getParameter("address").trim());
				int flag = memberBean.uppersonReg(member, realname, sex, bir, sheng, city, telphone, email, question, answer,address);
				if(flag == Constant.SUCCESS){					
					request.setAttribute("message", "操作成功!");
					request.getRequestDispatcher("member/info/info.jsp").forward(request, response);
				}
				else{
					request.setAttribute("message", "系统维护中,请稍后再试!");
					request.getRequestDispatcher("member/info/info.jsp").forward(request, response);
				}
			}
		}
		
		else if(method.equals("lostpwd")){
			String username=request.getParameter("username");
			String question=request.getParameter("question");
			String answer=request.getParameter("answer");
			String reg_type=request.getParameter("reg_type");
			String info=memberBean.returnPwd(username, question, answer, reg_type);
			if(info.trim().equals("error")){
				request.setAttribute("message", "信息错误!");
				request.getRequestDispatcher("login.jsp").forward(request, response);
			}
			else{
				request.setAttribute("message", "您的新密码为"+info+",请登录后修改!");
				request.getRequestDispatcher("login.jsp").forward(request, response);
			}
		}
		else{
			request.getRequestDispatcher("index.jsp").forward(request, response);
		}
	}

	/**
	 * Initialization of the servlet. <br>
	 *
	 * @throws ServletException if an error occure
	 */
	public void init() throws ServletException {
		// Put your code here
	}

}

V. Project Summary

The advantage of this system is that the system is divided into two parts, which are divided into the front and back of the news release system. The division of labor is clear. The front is to provide users with better browsing news. Comments and user information, etc., where ordinary users log in to the front-end news release system to search, browse and leave messages, and administrators log in to the back-end news release system to perform operations such as news release, writing, modification and deletion, and manage users. Being able to see user comments and delete some users who commented excessively can reduce the access pressure on the front desk of the news release system to a certain extent, and the division of labor between the front and back is also clearer, which is more conducive to the use of various users.

The system uses the MVC architecture pattern, which can separate the functions of the system and divide the system into three levels. The Model is the part of the application program used to process the application data logic. It is the model of the system and the core layer. The View application program The part that handles data display is the view layer of the system. Controller is the part that handles user interaction in the application program. After the layer is fed back to the user, the information can be obtained.

    By writing a news release system, I can better understand the power of programming languages. Through some design patterns, the system we write can be more powerful, more compatible, and more scalable. A powerful system should have good scalability. , strong compatibility, when we design the system, we use more popular design patterns to make the system more perfect.

Guess you like

Origin blog.csdn.net/whirlwind526/article/details/131012353