Attribute overview in [Html]View plaincopy
Xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance"
Xsi: schemaLocation = "http://www.springframework.org/schema/beans
Http://www.springframework.org/schema/beans/spring-beans.xsd>
Beans -- root node of the xml file.
Xmlns -- the abbreviation of XML NameSpace, because the tag names in the XML file are custom, and the tags you write and the tags defined
If Spring is used, you can replace it with org. springframework. web. filter. CharacterEncodingFilter.[Html]Xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance"Xsi: schemaLocation = "http://java.sun.com/xml/ns/javaeeHttp://java.sun.com/xml/ns/javaee/web-app_2_5.xsd>
The following figure shows the web. xml configuration in the JavaWeb project.[HtmlXmlns = "http://java.sun.com/xml/ns/javaee"Xmlns:
Set applicationContext. xml in the configuration file as follows :? Xmlversion1.0encodingUTF-8? Beansxmlnswww. springframework. orgschemabeansxmlns: xsiwww. w3.org2001XMLSchema-instancexsi: schemaLocationwww. springframework. orgsc
Set applicationContext. xml in the configuration file as follows :? Xml version = 1.0 encoding = UTF-8? Beans xmlns = http://www.springframework.org/schema/beans xmlns: xsi = http://www.w3.org/2001/XMLSchema-instance
structure is: projectname/src, projectname/webroot, it is actually in SRC. java source code is completely irrelevant to Tomcat, and its parsing starts from webroot ,. class is what it knows.
The following is an initial WEB. xml. file, which is equivalent to the project startup guide file. The Web Container first finds this file and then interprets and starts these classes one by one.View plain
Xmlns: xsi = "http://www.w3.org/2001/XMLSchema-inst
1. Create a web project:
Jar package:
Ii. Configure the filter:
3. basic configuration of applicationcontext. xml:
Xmlns: Beans = "http://www.springframework.org/schema/beans"Xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance"Xsi: schemalocation = "http://www.springframework.org/schema/beansHttp://www.springframework.org/schema/beans/spring-beans-2.0.xsdHttp://www.springframework.org/schema/securit
1. Define the data structure (MySQL ):
① Role table:
Create Table 'role '('Id' int (11) not null auto_increment,'Name' varchar (50) not null,Primary Key ('id ')) Engine = InnoDB default charset = utf8;
② User table:
Create Table 'user '('Id' int (11) not null auto_increment,'Username' varchar (50) not null default '','Password' varchar (50) not null,'Status' int (11) not null,Primary Key ('id ')) Engine = InnoDB default charset = utf8;
Note: status is 1.
③ User Role connection table:
Create Tabl
1. Bookstore. py
# Encoding: UTF-8 ''' Based on a given XML schema, an XML is generated from a blank file in the form of a DOM tree. ''' From XML. Dom. minidom Import DocumentDoc = Document () # Create a DOM Document Object Bookstore = Doc. createelement (' Bookstore ' ) # Create root element Bookstore. setattribute ( ' Xmlns: xsi ' , " Http://www.w3.org/2001/XMLSchema-instance " ) # Set namespace Bookstore. setattribute ('
the concurrent access issue.Therefore, you need to reset the call status each time. The best place is in the dostarttag method.
* The tag will never call release () during the call ();
* Do not use the bodycontent object in the setbodycontent method or the doinitbody method. It is only used to obtain the object and prepare the object.
* If you use empty or non-empty tags for custom tags that implement the bodytag interface, an exception is thrown. Because empty labels do not call some methods.
Before writing code, you must import the following necessary libraries to the project:Spring-framework-2.5.6 \ dist \ spring. jarSpring-framework-2.5.6 \ dist \ modules \ spring-webmvc.jarSpring-framework-2.5.6 \ lib \ jakarta-commons \ commons-logging.jarSpring-framework-2.5.6 \ lib \ j2ee \ jstl. jar
Just copy these files to the project's WebContent \ WEB-INF \ lib directory, and then refresh the project in eclipse, You can automatically import the database.
At this point we can start modifyin
= "Description" content = "this is my page">
Rel = "stylesheet" type = "text/CSS"Href = "styles.css">
-->
Value = "items">
Value = "username"/>
Value = "descn"/>
●XMLConfiguration
Struts. xmlThe configuration is as follows:
Version = "1.0" encoding = "UTF-8"?>
Struts public "-// Apache Software Foundation // DTD struts Configuration2.1 // en "" http://struts.apache.org/dtds/struts-2.1.dtd ">
Name = "struts. Enable. d
1. Use the following command to create a web application:
Code
MVN archetype: generate - Dgroupid = Net. Jianxi. tutorials. MAVEN - Dartifactid = Webappdemo - Dpackage = Net. Jianxi. tutorials. MAVEN - Darchetypeartifactid = Maven - Archetype - Webapp - Dversion = 1.0 - Dinteractivemode = No
The created web applicationProgramThe directory structure is as follows:
2. Run the following command to create a web packaging file:
MVN package
You can see th
If the following content exists, it indicates servlet 2.3/jsp 1.2.
"-// Sun Microsystems, Inc. // DTD web application 2.3 // en"
Http://java.sun.com/dtd/web-app_2_3.dtd>
By default, Servlet 2.3/jsp 1.2 does not support El expressions, whereas servlet 2.4/jsp 2.0 does.
If the following settings of Web. xml do not support El expressions:
Xmlns = "http://java.sun.com/xml/ns/javaee"
Xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance"
of the XML document? When creating an xmlstreamwriter object from an xmloutputfactory object, you will do this:
Xmlstreamwriter. writestartdocument ("UTF-8", "1.0 ");
Use the writecomment () method to output a comment:
Xmlstreamwriter. writecomment ("A oreilly Journal Catalog ");
Use the writeprocessinginstruction () method to output a processing command:
Xmlstreamwriter. writeprocessinginstruction ("catalog", "journal = 'oreilly '");
Use the writest
Inject dependency objectsBasic Type object injection:Inject other beans:Method 1:Method 2 (internal bean is used, but this bean cannot be used by other beans)
Xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance"Xsi: schemalocation = "http://www.springframework.org/schema/beansHttp://www.springframework.org/schema/beans/spring-beans-2.5.xsd "default-Lazy-init =" false ">
IOC control InversionPublic cla
Let's take a look at how to use spring. net.
I. Environment download and InstallationDownload the spring.netframework Installation File (spring.net-1.3.0-rc1.exe) to spring's official website ). Currently, the latest spring. Net version is 1.3. Download and unzip the package.
The following files are frequently used in spring. NET Framework:Common. Logging. dll (required)Spring. Core. dll (required)Spring. Data. dllSpring. AOP. dll (optional)Spring. Data. nhibernate21.dllSpring. Web. dllIn future
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.