Analysis on the management of Javaweb Campus Dormitory (i.)

Source: Internet
Author: User

from the Internet to see an open source Web project-campus dormitory management system, roughly looked at the source code, the framework is very simple, with the struts2+jdbc+jsp, although as a very simple project, but for the novice, directly look at a system of source code, will soon lose interest, I come here as a newcomer to understand this feeling, so for this system, I would like to re-write him again, by the way the technical framework modified to improve their own technology, here to share the process of re-building the project.

Main frame does not move, still use struts2, persistence layer aspect I prepare to use MyBatis, database uses oracle11g.

No more nonsense, just open the dry!

First create a dynamic WEB projects project with the project name Studentsdormitorymanager.

<?xml version= "1.0"  encoding= "UTF-8"?><web-app  version= "2.5"  xmlns= "Http://java.sun.com/xml/ns/javaee"  xmlns:xsi= "http://www.w3.org/2001/ Xmlschema-instance " xsi:schemalocation=" http://java.sun.com/xml/ns/javaee   http:// Java.sun.com/xml/ns/javaee/web-app_2_5.xsd "> <filter>  <filter-name>struts2</ Filter-name>  <filter-class> Org.apache.struts2.dispatcher.ng.filter.strutsprepareandexecutefilter</filter-class> </filter > <filter-mapping>  <filter-name>struts2</filter-name>  < Url-pattern>*.action</url-pattern> </filter-mapping> </web-app> 

first of all, think of a system we need to do first, that is, login, for login, the most important is permission control, only we will login process to design the other functions, all just by module to join the system.

This set of open-source dormitory management system is relatively simple, is the login page settings dropdown box, the user to choose their own role, background based on the role to the different role account table to find users, based on the results of the search to return the success of the login.

First we want to set the project launch into the homepage login.jsp, add in Web. XML, create login.jsp page under WebContent

<welcome-file-list> <welcome-file>/Login.jsp</welcome-file> </welcome-file-list>
<%@ page language= "java"  import= "java.util.*"  pageencoding= "UTF-8"%><%string  path = request.getcontextpath (); String basepath = request.getscheme () + "://" +request.getservername () + ":" +request.getserverport () +path+ "/";%><%@ taglib prefix= "S"  uri= "/struts-tags"%><! doctype html public  "-//w3c//dtd html 4.01 transitional//en" >

I am not the front desk, so about the source code of the picture and CSS, JSP I basically use (see annex), now this project can be run with Tomcat, we can go to the homepage to see, browser input: http://localhost: Port/Project Name:

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M02/89/00/wKioL1gErx_yLoZsAABX85OExxk703.png "title=" Qq20161017184321.png "alt=" Wkiol1gerx_ylozsaabx85oexxk703.png "/>


This article is from the "attack on the Program Ape" blog, please be sure to keep this source http://zangyanan.blog.51cto.com/11610700/1862762

Analysis on the management of Javaweb Campus Dormitory (i.)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.