⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 readme.txt

📁 一个用开源项目做的例子
💻 TXT
字号:
This example application requires several components to be setup and configured before running. It
is assumed that you understand how to setup a Web application and add the components below.

STEP 1:

To run the sample appication you will need to install the following Java components:

1. Jakarta Struts 1.1 - download from http://jakarta.apache.org/struts/
2. Spring 1.0 Release candidate 2 - download from http://www.springframework.org/
3. Hibernate 2.1.2 - download from http://www.hibernate.org/6.html
4. MySQL stable JDBC driver - http://www.mysql.com/downloads/api-jdbc-stable.html
5. Proxool - Java connection pool - http://proxool.sourceforge.net/


STEP 2:
extract the archive files from these downloads into your lib directory.

STEP 3:
Install MySQL - obtain from http://www.mysql.com

STEP 4:
If you are using an IDE like Eclipse then import these files into a project.  If you are 
putting this on a server like Tomcat then extract the files into the approriate Web
application structure in a webapp.

STEP 5:
Here are the files from the order application that will need to be modified from 
the web-inf directory:

1. applicationContext-hibernate.xml - 

   - <prop key="hibernate.proxool.xml">C:/MyWSADProjects/OnJavaCom/WebContent/WEB-INF/proxool.xml</prop>
     
     change the path to your absolute web-inf directory
     
2. proxool.xml

   - change the <driver-url> to your url
   - change the user and password properties as needed
   
3. Open the hibernate.properties file from the web-inf/class directory and modify the following:

   - hibernate.connection.url=<enter the url here>
   - hibernate.connection.username=<enter your username>   
   - hibernate.connection.password=<enter your password>
   
   
STEP 6:
Now that your environment is configured run the ant script (Make sure that you have Ant installed). At
a prompt type:

X:\..\>ant db-schema

This should generate your hibernate mappings from the XDoclet stored in the source files and write 
a DDL file based on the mappings.  If this is successful and you have MySQL running then run:

X:\..\>ant db-schema-drop 

This will do the same thing as db-schema except that it will actually create the drop and create the
databases from the DDL file in the MySQL database.

STEP 7:
After you start your Web container point your browser to http://host/webappuri/Index.do

STEP 8:
This application allows a new order to be created and a way to lookup existing orders.  The interface 
is basic and straight forward to use.  Notice what happens when exceptions arise when you try to access
orders that do not exist.  Watch the console for messages about what transactions are committed and 
rolled back.  You can extend the functionality to allow deletions or updates.  Reverse engineer what the
code is doing across each framework and how they communicate with each other and achieve loose coupling.


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -