J2EE Study Notes-deployment and use of Struts2

Source: Internet
Author: User
Tags i18n

First download the Struts2 package URL on the struts2 Official Website: http://struts.apache.org/download.cgi#struts221 with this Full Distribution: struts-2.3.8.-all.zip (76 mb) [PGP] [MD5] After decompression find the jar file in lib: the main use of the following: import these packages into your web site under the WEB-INF \ lib; Struts deployment completed: start to use the new webproject, contains the following items: first, change the web. xml file [java] <? Xml version = "1.0" encoding = "UTF-8"?> <Web-app version = "2.5" xmlns = "http://java.sun.com/xml/ns/javaee" xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" xsi: schemaLocation = "http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"> <welcome-file-list> <welcome-file> index. jsp </welcome-file> </welcome-file-list> <! -- Define the core Filter of struts2 --> <filter-name> struts2 </filter-name> <filter-class> org. apache. struts2.dispatcher. ng. filter. strutsPrepareAndExecuteFilter </filter-class> </filter> <! -- Let the core Filter of Struts2 intercept all requests --> <filter-mapping> <filter-name> struts2 </filter-name> <url-pattern>/* </url-pattern> </filter-mapping> </web-app> export ------------------------------ Login. jsp page: [html] <% @ page language = "java" import = "java. util. * "pageEncoding =" gb2312 "%> <% @ taglib pr Efix = "s" uri = "/struts-tags" %> <% String path = request. getContextPath (); String basePath = request. getScheme () + ": //" + request. getServerName () + ":" + request. getServerPort () + path + "/"; %> <! Doctype html public "-// W3C // dtd html 4.01 Transitional // EN">

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.