Beginner Java SSH's spring first article

Source: Internet
Author: User

Before graduation, although the internship before the work is used in C #. NET language, however, after graduating from the decisive application of Java. Although their understanding of Java is not as deep as C #, but the basic knowledge is more familiar with, but still righteousness no return to the gu ...

Although the application experience is more bumpy, but eventually succeeded in the job.

Just into the job, coupled with the lack of experience, so the recent task is relatively small, so there is a lot of time to self-study, we have to seize the time to accumulate knowledge ah, less nonsense, into the topic.

For Java, their own mastery is limited to the basic knowledge, for the framework and almost no use, only probably know that SSH is commonly used in enterprise development framework, struts+hibernate+spring is a very good framework, almost everyone is more or less in use, Start with spring and begin learning today.

Spring introduction are not many said Ah, paste a section below Baidu, I believe we all have to understand its background ah.

Spring is an open source framework, and spring is a lightweight Java development framework that emerged in 2003 by Rod Johnson in his book expert one-on-one development and Some of the concepts and prototypes elaborated in design are derived. It is created to address the complexities of enterprise application development. Spring uses basic JavaBean to accomplish things that were previously only possible by EJBS. However, the use of spring is not limited to server-side development. From the standpoint of simplicity, testability, and loose coupling, any Java application can benefit from spring. In short, spring is a lightweight control inversion (IoC) and aspect-oriented (AOP) container framework.

To successfully use the spring framework in your project, you first need to download Spring's latest stable version, which you can download on the spring website. After downloading the compressed package named Spring-framework-3.2.4.release.zip (I am using the 3.2.4 version, of course other versions are also available), unzip you can see several subfolders:

The Docs folder primarily contains spring-related documentation, including development guides, API reference documentation, and more.

The Libs folder primarily stores the jar packages required by spring.

Others do not look.

OK, now start creating a new Web project in Eclipes or Myeclipes, and the development software I'm using here is MYECLIPES10.

In Myeclipes, click File/new/java Project to create a new project.

Then enter the project name and click Finishi to complete the creation.

  

To successfully create a project, you now need to import all the jar packages from the Libs folder you just extracted into the project, and of course, it is recommended that you only import the required jar packages. It is recommended here that if you need to publish the project at that time, you will need to manually copy the jar package into the Webroot/web-inf directory under the Lib directory, because if the jar package is not placed in the project at release, and the jar package is added locally through buid path, The jar package will not be published together with the project after it is published.

  here, we can use either method. The same way, you also need to import a package,Common-logging.jar used to record the activity of the program runtime log records, the package specifically for the role I have not yet understood, only know the need to import, first import and then. If the great God sees, ask the great God to answer.

This package can be Baidu download, you can also go to the official website to download the link address: http://commons.apache.org/proper/commons-logging/download_logging.cgi.

Now that the jar package has been imported, you need to create a new file under the SRC directory in the project, named Applicationcontext.xml, with the following code:

1 <?XML version= "1.0" encoding= "UTF-8"?>2 <Beans3     xmlns= "Http://www.springframework.org/schema/beans"4 Xmlns:xsi= "Http://www.w3.org/2001/XMLSchema-instance"5 xmlns:p= "http://www.springframework.org/schema/p"6 xsi:schemalocation= "Http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">7     8 </Beans>
View Code

At this time the basic environment has been completed, the next chapter continue to learn.

  

Beginner Java SSH's spring first 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.