An example of JSP + JAVABEAN + XML development

Source: Internet
Author: User
Tags tomcat
This example is based on some documents on the website about JSP operations on XML, and some personal experiences. The example involves part of the code on the background management end of an enterprise's internal ordering system, which is mainly used to manage basic restaurant information.
The reason for the development of this example is that I was a joke with my colleagues at the original company. I would like to express my thoughts on those friends who work together.
The example itself is a B/S structure program running on the TOMCAT4.01 platform. The configuration of TOMCAT is not described here. This section only describes the directory structure of related files and folders.
Directory structure description:
/Tomcat/webapps/canyin/----- main directory
/Tomcat/webapps/canyin/jsp/----- JSP file directory
/Tomcat/webapps/canyin/jsp/admin/----- directory for storing JSP files for background management
/Tomcat/webapps/canyin/WEB-INF/classes/canyin/------ storage directory of the javabean file
/Tomcat/webapps/canyin/data/----- directory for storing xml files
/Tomcat/webapps/ROOT/----- the tomcat startup file is saved in the folder, and only the index.html file is saved.
Brief description of the file:
/Tomcat/webapps/canyin/data/users. xml ----- record user information
/Tomcat/webapps/canyin/data/logs ants. xml ----- record basic information about a restaurant
/Tomcat/webapps/ROOT/index.html ----- homepage. The input box is displayed, asking the user to enter the user name and password.
/Tomcat/webapps/canyin/jsp/loginjudge. jsp ----- determine the user identity page, and decide whether the page is transferred to the background management end or the foreground client based on the user name and password. In this example, once the user identity is confirmed to have management permissions, you can go to the background management end and directly jump to the restaurant basic information management page to simplify the description process.
/Tomcat/webapps/canyin/jsp/admin/admin_rest.jsp ----- restaurant basic information management page, manage restaurant name, phone number, address, and other information
/Tomcat/webapps/canyin/WEB-INF/classes/canyin/checkSessionBean. class ----- the background management end checks the value of the session that marks the user's identity. If it is not an administrator, jump back to the login page.
/Tomcat/webapps/canyin/WEB-INF/classes/canyin/connXmlBean. class ----- connect to the xml file
/Tomcat/webapps/canyin/WEB-INF/classes/canyin/writeXmlBean. class ----- write xml file
File details and additional code instructions.
/Tomcat/webapps/canyin/data/users. xml
Code:
<? Xml version = "1.0" encoding = "UTF-8"?>
Related Article

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.