Sort out a few things learned in the morning, an example of custom tags. I think the biggest reason for sticking to taking notes is that I forget to watch videos, check materials, and Baidu... In addition, if you organize your own data, your memory will last longer.Example: Query Information of all students (student ID, name, gender, date of birth, home address)Create a project XXX. Because it is a custom tag, you do not need to introduce the struts p
Master Verification Method
With validator, we can:
1.Not Write validate () methodSimply by extending a class from validator'sActionformSubclasses;
2.Plug or remove validator'sFramework in our struts application;
3. UseValidator-rules.xmlFile to define client-sideJavaScript code (or the location of client-side JavaScript code) for eachValidation routine;
4. Use
the corresponding domain, the third is not recommended, because the implementation of the interface, easy to lead to injection programming.OGNL and Value stacks:1. Introduction:OGNL is an acronym for Object-graph Navigation language, a powerful expression language and a third-party open source project.Struts2 by using OGNL simple and consistent expression syntax, you can access any property of an object, invoke the object's method, traverse the entir
Required packages:
Struts2-config-browser-plugin-2.3.15.2.jar
Struts2-convention-plugin-2.3.15.2.jar
Note that after adding these two jar packages, you must replace the relevant struts jar packages with the corresponding versions, and use xwork-core as the corresponding versions. Otherwise, errors may occur.
The Struts. xml configuration is as follows:
I learned struts, but for its origins, and why to use action and struts. the XML method does not use the previous servlet method. I have some questions about the disadvantages of the previous method. What convenience does struts bring to us?
The following are my answers!
Struts:
With JSP and Servlet technologies wide
1. Open myeclipse and create a web project named testssh.
2. paste the six jar packages required by struts under the Web Lib. (The jar package is included in the attachment)
3. Configure struts filter in Web. xml.
The Code is as follows:
Xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance"
Xsi: schemalocation = "
application development. At the same time, this structure also makes it difficult to allocate and maintain the development. It is a model1 structure (Note: Source: struts practical development guide for Java Web application development based on MVC + myeclipse 3) Model2 To improve the problem caused by too many complaints on JSP pages in the model, model2 introduces servlet to act as the controller, an
I have just started learning struts recently. I plan to write down the learning process and some of my experiences. On the one hand, I want to encourage myself to gain a little bit every day. On the other hand, I would like to ask you to give me more advice, either technically or technically.
I also started from the simplest and most classic things. I personally think this example is the most representative.
1
real strength of the spring layer is its declarative transactions, the support and persistence layer (e.g. hiberate and Ibatis)
Below is the steps to complete this example:
1. Install Eclipse plug-in
2. Database Build Table
3. Configuring Hibernate and Spring
4. Build the implementation class for the Hibernate DAO interface
5. Run the test class to test the DAO's CRUD operations
6. Create a processi
Compile a function. When n is an even number, call the function to calculate 1/2 + 1/4 +... + 1/n. When n is an odd number, call the function 1/1 + 1/3 +... +
Error solution: Invalid byte 3 of 3-byte UTF-8 sequence., 3-bytesequence
The following error is prompted if the compilation fails during multi-channel packaging with ant recently.
I/O error for/wemicommunity/AndroidManifest. xml: Invalid byte 3 of
Integrate stecks with Struts (1)
1. Put the JAR file of strecks in the/WEB-INF/lib directory.Http://strecks.sourceforge.net//doc-setup.php
2. Configure controller in struts-config.xmlProcessorclass = "org. strecks. Controller. controllerrequestprocessor"Contenttype = "text/html; charset = UTF-
1. Why label?
When a JSP page is embedded with a large number of Java scripts, the readability of the entire page decreases, and the readability also decreases.
Advantages of using custom tags: simple, conducive to team collaboration, high readability.
Import the struts 2 tag Library:
2. Struts 2 defines all labels in the space where URI is "/
1. Explain the main contents of Struts1
2. Why use Struts
3. Further introduction of the framework concept and the struts concept
Framework: Frameworks
Layer: layer, stratum, stratum
Flexible: Living or flexible
Rsourcebundles: Resource pool
Various: all kinds of;
Proven: proof
Design: Designing
P
point is to not rush to read them, first find a booklet to understand the basic knowledge, and then find excellent STRUTS2 Project Code learning, in learning to think, not only to know what, How to ask yourself a few why, imagine if you want to design, what you will do, and then the design of struts and contrast, so as to truly improve.
As for those "authority/encyclopedia/guide", I will be more used to find technical details, as a reference book.
B
using hibernate:1. Create and configure the configuration object. You can configure the congiuration object through hibernate. properties or the hiberate. cfg. xml file. You can also use the following programming method:Configuration = new configuration ()Configuration. addclass (student. Class)//. AddFile ("student. HBM. xml ")//. Addresource ("/student. HBM. xml "). Setproperty ("show_ SQL", "true ");2. The sessionfactory object is created by Confi
Guid
In the next few weeks I will continue to translate the Structs User's Guide on the Apache website, because in the company seems to not open csdn BLOG so as long as the evening or weekend reprint. I hope you can pay attention to my translation, but also to my translation suggestions and suggestions!
0. Foreword
0.1 Basic requirements
0.2 HTTP, HTML, user agent
0.3 HTTP Request/reply
0.4 Java Language and application framework
0.5 JavaBeans
0.6 property files and resource bundl
above ). At the beginning of a request, some operations will be done in form Bean first, and then transferred to the execute method of action class for processing. Struts will do the following in this process:
(1). Struts check whether the formbean instance of the form exists in the scope specified by form bean.
(2) If no, create one.
(
Down-to-earth, 1.1 points of accumulation. Understand the basics and principles. Introduction of three tag libraries:Code:
Several Methods for connecting struts implementation: (Transfer from myjsp1.jsp to myjsp2.jsp)
Code:
This is the first JSP interface!
// 1
Session. setattribute ("MSG", "007"); // use MSG
// Compare the session to be
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.