Solve struts errors Unable to load configuration struts2-core-2.3.16.3.jar! /Struts-default.xml: 40: 72, unabletoload
Unable to load configurations struts2-core-2.3.16.3.jar! /Struts-default.xml: 40: 72
Tomcat lib directory has a struts2-core-2.3.16.3.jar
An error is returned when struts2 is loaded. Exception starting filter struts2 Unable to load configuratio
provided.
Public class HelloWorldAction {
Private String savePath;
Public String getSavePath (){
Return savePath;
}
Public void setSavePath (String savePath ){
This. savePath = savePath;
}
......
}
The preceding statement uses the
As you may say, I have encountered difficulties in learning the struts23 annotation.
Then your problem is .....Which jar packages need to be configured in struts 2312?
Recently I just told students about struts2.3.1.2,
the original "package name + class name" in the Struts configuration file. For example, this can be:And the original is this:In addition, you can use the Spring Framework's @autowired annotation to inject a spring field into a dependency class.Here we begin the actual combat.The following tools are used in this article:
Eclipse mars.1 Release (4.5.1): http://www.eclipse.org/downloads
Maven 3.3
been written using the Eclipse IDE. So I suggest installing the latest version of Eclipse on the machine.
Install eclipse download Http://www.eclipse.org/downloads the latest eclipse binaries. Once the download is installed, unzip the binary distribution to a convenient location. For example, in Windows for C:eclipse
Servletap parsing: API (Application Programming Interface) application programming interface.Servletapi is a set of interfaces and classes related to Servlets.To enable access to Servletapi objects, Struts 2 offers a number of ways, but it comes down to two broad categories:1. How to access the SERVLETAPI decoupling2. Access mode coupled to the SERVLETAPIThe decoupling method is described below:1. Use the Actioncontex class to get the map object that
The basic brief flow is as follows:1. The client browser makes an HTTP request.2, according to the Web. XML configuration, the request is filterdispatcher filtered.3. According to the Struts.xml configuration, find the action class and method that need to be called.4. Action invokes the business logic component to process the business logic.5, the action is completed, according to the configuration in the Struts.xml to find the corresponding result of the return, and jump to the corresponding pa
Most of the time, we use struts 2The built-in type converter can meet most of the type conversion requirements. However, in some special cases, if you want to convert a string into a composite object, you need to use a custom type converter.
To implement a custom type converter, you must follow these two steps:
1, Write your own type converter
2, Registered type converter
1. Custom type converter
Generally, a class is required for writing
Struts is an open-source framework that uses JavaServlet/JavaServer Pages technology to develop Web applications. Struts can be used to develop an application architecture based on the Model-View-controller design pattern. Struts has the following main functions: 1. It includes a controllerservlet that can send user requests to corresponding action objects. Ii. j
Configure the Web. xml file:
1. No matter how many sub-applications are included in the application, you only need to configure an actionservlet. Configuring multiple actionservlet classes to process different functions in an application is not necessary because the servlet itself supports multithreading. In addition, the current Struts framework allows only one actionservlet to be configured in the application.
2. Configure the welcome file list.
The struts tag cannot be displayed in the design view of Dreamweaver (DW ).Code. I have been searching for this for a long time and finally found it on the DW website. It is only 8 kb in size. Although there are no beautiful icons, the information displayed is enough. Now we can use DW to edit the JSP file containing the struts tag!
Figure 1 display the struts
The following error occurred with respect to struct internationalization: 1.The Struts dispatcher cannot be found. This are usually caused by using Struts tags without the associated filter. Strut2.S tags are only usable when the request has passed through its servlet filter, which initializes the Struts dispatcher n3.eeded for this tag. -[Unknown Location]Solve:
. The Struts dispatcher cannot be found. This are usually caused by using Struts tags without the associated filter. Strut2.S tags are only usable when the request has passed through its servlet filter, which initializes the Struts dispatcher n3.eeded for this tag. -[Unknown Location]
Solve:Add a filter to the Web.xml
This document records the main configuration files, storage locations, and notes of struts2.
(In fact, these configuration files work under the class folder, but all files placed in the SRC folder will be copied to the corresponding class folder during eclipse compilation .)
Configuration File Name Storage location Remarks
Struts. xmlStruts2 default configuration file in the SRC folder
L you can use
L inh
. Declarative Exception Handling1. Perform exception ing in action2. perform global exception ing in the package3. Use the inherited public exception ing4. Exception Handling in struts2 is implemented by the Interceptor (observe the struts-default.xml, in fact most of struts2's functions are implemented by the interceptor)I18n (International website)1. Principle:A. Concepts of resourcebundle And LocaleB. Resource fileC. native2ascii2.
Struts (4) of SSH framework -- simple use of Struts to check for missing BeanUtils1) Background
In the previous blog, we mentioned an important javaBean tool-BeanUtils. This blog briefly introduces BeanUtils. As a third-party service, BeanUtils provides various operations for javaBean.
Its main functions are summarized as follows:1. Use BeanUtils. cloneBean () to clone a JavaBean instance
2. Using BeanUtils
Do not talk nonsense, just pick up the goods
1. Pass parameters through set and get
Add the username and password attributes and add the set and get methods.
Use El expressions and Struts labels to call the list
Enter http: // localhost: 9000/strustdemo1/user_list in the browser? Username = fzl Password = 123 input parameters
The second method is completed through actioncontext.
List files do not need to be modified
Method 3: Pass
Struts 2 file upload, struts File Upload
To obtain the original name of the uploaded File, you need to define a String type attribute. The attribute name must be *** FileName, and *** is the name of the File attribute. Similarly, to obtain the MIME type of the file, you must define a *** ContentType String attribute.Upload a single file
Public class UploadAction extends ActionSupport {private File im
Javaben is a Java class that meets the design pattern requirements. Define two methods to access bean data, accessors (getter) read and mutator (setter) Write. Actionserverlet automatically calls the setter method. JSP is used to display pages, JSP tag is used to format data, and action is used to collect and forward data. Development framework: a reusable and roughly completed application Program . You can customize it to generate a real application that the customer needs. It is provided to th
A label file is one of the JSP custom tags that is implemented by creating a. tag file, such as Table.tag, in the Web-inf\tags directory or subdirectory, and using the Taglib directive to refer to the directory in which the. tag file resides, as follows:
If you use the Struts 2 tag in a tag file, you can create a problem. Let's look at an example.
Create a Table.tag file in the Web-inf\tags directory with the following code:
Put the hibernate of the package into the Web application lib, and then define the Hibernate.cfg.xml, which is the configuration information of the plug-in, as follows
Import Org.apache.struts.action.plugin;import Org.apache.struts.action.actionservlet;import Org.apache.struts.config.moduleconfig;import Javax.servlet.servletexception;import Javax.servlet.ServletContext; Import Net.sf.hibernate.sessionfactory;import Net.sf.hibernate.cfg.configuration;public class HibernatePlugIn implements Pl
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.