Hibernate_ New Customer Practice

Source: Internet
Author: User

About Hibernate configuration Files

(1) Hibernate.cfg.xml

(2) Customer.hbm.xml

The project directory is as follows:

Get ready:

Realize:

1. Modify the href of the new customer in the menu page

2, modify add.jsp, still use servlet

The Name property of each information you add must match the class attribute in the domain file

Form form:

In the Customer class:

3. New Addcustomerservlet

The code is as follows:

As the Listcustomerservlet is not written, the operation will turn 404

4. New service interface and implementation class

(1) CustomerService

(2) Customerserviceimpl

4. New DAO interface and implementation class

(1) Customerdao

(2) Customerdaoimpl

5, handling Chinese garbled

Genericencodingfilter (Universal Coding solution)

and configured in Web. xml

6, the use of the meaning of the interface (optional):

Hibernate_ New Customer Practice

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.