Spring for Java ssh

Source: Internet
Author: User

Spring for Java ssh

Although I used the C #. NET Language for my internship before graduation, I decided to apply for Java after graduation. Although I do not have a deep understanding of Java as C #, I am only familiar with the basic knowledge, but I still have no worries ···

Although the application experience is relatively rough, it is still successful.

I have just started my job, and I am not experienced enough. So I have a relatively small number of tasks recently, so I have a lot of time to learn by myself. I have to hurry up and accumulate knowledge. I will talk less about it and step into the topic.

 

For java, I only have the basic knowledge, and I have never used any frameworks. I only know that ssh is a common development framework for enterprises, struts + hibernate + spring is a set of very good frameworks that almost everyone is using. Today I will start with spring and start learning.

I will not talk about spring too much. I will paste a piece of Baidu below. I believe everyone has a background.

Spring is an open-source framework. Spring was a lightweight Java development framework that emerged in 2003, it is derived from part of the concepts and prototype stated by Rod Johnson in his book "Expert One-On-One J2EE Development and Design. It is created to solve the complexity of enterprise application development. Spring uses the basic JavaBean to complete the previous tasks that may only be completed by EJB. However, Spring is not only used for server-side development. From the perspective of simplicity, testability, and loose coupling, any Java application can benefit from Spring. In short, Spring is a lightweight container framework for IoC and AOP.

To successfully use the spring framework in the project, you must first download the latest stable version of Spring. You can download it from the spring official website. Download the compressed package named spring-framework-3.2.4.release.zip (I use version 3.2.4, of course, other versions). decompress the package and you will see several subfolders:

The docs folder stores spring-related documents, including the Development Guide and api reference documents.

The libs folder mainly stores jar packages required by spring.

For the time being.

 

Now, create a new web project in eclipes or myeclipes. The development software I use here is myeclipes10.

In mydomaines, click File/New/Java Project to create a New Project.

Enter the project name and click finishi.

  

After successfully creating a project, you need to import all the jar packages in the extracted libs folder to the project. If you are familiar with it, we recommend that you only import the required jar package. It is recommended that, if you need to release the project at that time, you need to manually copy the jar package, paste it to the lib directory under the WebRoot/WEB-INF directory, because if the jar package is not placed in the project at the time of release, the jar package is added locally using the buid path. After the project is released, the jar package will not be released together.

Here, we can use any method. The same method, but also need to import a package, the common-logging.jar is used to record the activities of the program running the log, the specific role of this package I have not done too understand, just know the need to import, pilot import again. If a great God sees it, ask the great god to answer it.

This package can be downloaded from Baidu or from the official website at http://commons.apache.org/proper/commons-logging/download_logging.cgi.

Now that the jar package has been imported, you need to create a file named applicationContext. xml in the src directory of the project. The Code is as follows:

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

Now the basic environment has been set up, and the next article will continue to learn.

  


To learn a little about JAVA basics and JSP, we need to learn about the SSH architecture in a short time, starting from the one in Spring, Struts, and Hibernate?

Learn Struts2 first. Struts has expired
Struts2 is mainly an mvc framework, that is, the "Model-View-control" framework.

Then I learned Hibernate. Hibernate is data persistence, that is, it replaces jdbc in Java to deal with databases, and it is an object-level operation, to put it bluntly, you can operate relational databases according to the object database.

The last step is to learn Spring. Spring integrates the two of them.
In addition, you can find a video on the Internet, such as shangxuexiang or Longxi.

Java ssh framework, how to learn more efficiently

The most important thing is the java foundation. It is difficult to configure something in the framework. Therefore, it is best to understand the xml file when learning it.

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.