In the previous article, we briefly understood the struts principles and learned SSH. The first part is the silly learning method. It's okay if people do what they do. Take logon as an example. The Struts configuration steps are summarized as follows (2.1 ):
Fig 2.2
1. Copy the jar package
The first is to create a java web project, and then open the strtus framework we downloaded,
Create a project strutsdemo1 in eclipse. [For struts configuration, see struts development.
The directory structure is as follows:
Method 1
Create useraction
package fzl.user.struts.demo;import com.opensymphony.xwork2.ActionSupport;public class UserAction extends ActionSupport {public String list(){System.out.println("list");return "success";}public String
From the simple introduction to the Struts Framework (I): A simple MVC pattern code example to the analysis of the relationship between MVC and the three layers, this MVC design pattern instance is introduced, go to deep learning Struts Framework (II): refactoring jump paths and business logic in MVC code abstract encapsulation Service Processing and path jump, and then go to deep learning
In the previous blog, I talked about how actionservlet is initialized and the specific role of Web. xml configuration information. Today we will continue to explain how actionservlet reads/WEB-INF/struts-config.xml information to memory during initialization and how to present the information read from the configuration file in the form of actionmapping in memory.
Because this part of content is cumbersome, I cannot analyze it in detail, but I will e
This article describes the basic principles of the Struts 1.1 framework, as well as the installation of Struts 1.1 and a simple example.
1. Origin of struts
Struts is part of the Apache Jakarta project. The goal of this project is to provide an open-source framework for the establishment of Java Web applications. Curre
Introduction:
In many projects, developers implement their own MVC framework, not because they want to do something fundamentally different from Struts, but because they are not aware of how to expand Struts. Developing Your Own MVC framework can gain full control, but it also requires a lot of resources to implement it (human and material resources). Sometimes this is impossible under a tight schedule.
Source: http://myeclipseide.com/enterpriseworkbench/help/index.jsp? Topic =/com.genuitec.myeclipse.doc/html/quickstarts/struts/index.html
1. Order
This document is applicable to the Environment Sun JDK 1.4.2, eclipse 3.0.1, and myeclipse 3.8.2. All screens are based on the default user interface settings of Eclipse, myeclipse enterprise workbench, and Windows XP.
Java framework --- entry to Struts, java framework --- strutsFirst, understand the relationship between Struts and MVC. In the traditional MVC mode, all requests must be handed over to the Servlet for processing. Then, the Servlet calls the JavaBean and submits the results to the JSP for display. The following figure shows the structure of Struts, which is an Ope
source code for the Menuloader class.
V. Compiling from source file:To compile this project from a source file, perform the following steps:1. Download and install maven (http://maven.apache.org/);2. Create an environment variable maven_home indicate your MAVEN installation directory and add $maven_home/bin to your PATH variable;3, manipulate this directory you can expand the source code, execute "Maven.jar" create Target/struts-menu.jar.
To expand t
I. OverviewThe portal of the Struts framework is a filter (Strutsprepareandexecuterfilter), which is first introduced when learning Jsp/servlet, which consists of three methods and three parameters in a filter interface-- Init and Dofilter, Destory method, Filterconfig (filter configuration parameter in Web. xml) and protocol-independent ServletRequest, Servletresponse. Throughout the past life of Struts2 appeared, in fact, the whole framework consist
In the previous article, we used logon as an example to explain the struts configuration and implement the login example using the struts framework. Some terms have moved into my mind.
ActionServlet: Struts controller, responsible for intercepting URLs or distributing them. Model (Model layer) and View (View layer) are used, so it can be seen as an intermediary b
To upload files, we must set the form method to POST and set entype to multipart/form-data, the browser sends the binary data of the selected file to the server.
Once the enctype is set to multipart/form-data, the browser uses a binary stream to process form data. However, Struts 2 does not provide its own request parser. That is to say, Struts 2 does not process multipart/form-data requests by itself. It n
1. Order
This document is applicable to the Environment Sun JDK 1.4.2, eclipse 3.0.1, and myeclipse 3.8.2. All screens are based on the default user interface settings of Eclipse, myeclipse enterprise workbench, and Windows XP. If you encounter any difficulties when using this document, please refer to the user feedback section to feedback to myeclipse documentation team.
2. Description
In this user guide,
1. Order
This document is applicable to the Environment Sun JDK 1.4.2, eclipse 3.0.1, and myeclipse 3.8.2. All screens are based on the default user interface settings of Eclipse, myeclipse enterprise workbench, and Windows XP. If you encounter any difficulties when using this document, please refer to the user feedback section to feedback to myeclipse documentation team.
2. Description
In this user guid
The first two articles explain the basic implementation of the Struts framework, and I feel a little boring. Today I will use the logon example to implement it.
1. Create a javaweb project and copy the struts jar package to webroot/WEB-INF/lib.
2. The jar package cannot be copied. the user's request must reach the actionservlet before processing the request through str
Understanding the role of each element in the struts-config.xml is of great benefit for us to build Web projects.
(Data-sources ?, Form-beans ?, Global-exceptions ?, Global-Forwards ?, Action-mappings ?, Controller ?, Message-Resources *, plug-in *)>The above eight elements are described one by one below: 1. Date-sources Element The date-sources element is used to configure the application. Program The required data source. Java provides the java
The Struts dispatcher cannot be found. This are usually caused by using Struts tags without the associated filter. Struts tags are only usable when the request has passed through its servlet filter, which initializes the struts Dispatche R needed for this tag. -[Unknown Location]At Org.apache.struts2.views.jsp.TagUtils
static and dynamic Actionform
Actionform is one of the core classes of the struts framework, similar to an entity class, that collects and saves each data on the form. It is struts that resolves the struts-config.xml file to create the Actionmapping class, created from the Name property in the Actionmapping class.
Actionform is generally static, and if it is a st
Struts-config.xml configuration file details, struts-config.xml
(1) recently learning struts, find a struts-config.xml configuration instructions, share with you:
The above eight elements are described one by one below:
1. the date-sources element date-sources is used to configure the data source required by the a
Reproduced from: http://blog.csdn.net/guoquanyou/article/details/6585847
The Struts dispatcher cannot be found. This are usually caused by using Struts tags without the associated filter. Struts tags are only usable when the request has passed through its servlet filter, which initializes the struts Dispatche R needed
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.