{"id":900,"date":"2010-10-01T12:32:32","date_gmt":"2010-10-01T12:32:32","guid":{"rendered":"http:\/\/enjoyasp.net\/?p=900"},"modified":"2010-10-01T12:32:32","modified_gmt":"2010-10-01T12:32:32","slug":"struts2-0%e5%8a%9f%e8%83%bd%e7%9a%84%e5%88%9b%e5%bb%ba","status":"publish","type":"post","link":"https:\/\/enjoyasp.net\/index.php\/2010\/10\/01\/struts2-0%e5%8a%9f%e8%83%bd%e7%9a%84%e5%88%9b%e5%bb%ba\/","title":{"rendered":"Struts2.0\u529f\u80fd\u7684\u521b\u5efa"},"content":{"rendered":"<p>\u4e00\u3001Struts2.0\u7684\u521b\u5efa<br \/>\n1\uff09,\u6dfb\u52a0jar\u5305<br \/>\n?? 1, commons-fileupload-1.2.1.jar<br \/>\n?? 2, commons-io-1.3.2.jar<br \/>\n?? 3, commons-logging-1.0.4.jar<br \/>\n?? 4, freemarker-2.3.13.jar<br \/>\n?? 5, ognl-2.6.11.jar<br \/>\n?? 6, struts2-core-2.1.6.jar<br \/>\n?? 7, xwork-2.1.2.jar<br \/>\n\u6ce8\uff1a\u8981\u4e0eSpring\u6574\u5408\uff0c\u8ba9Spring\u6258\u7ba1Struts\u7684Action,\u90a3\u4e48\u9700\u8981\u6dfb\u52a0Struts2.0\u7684<br \/>\n???????? struts2-spring-plugin-2.1.6.jar<br \/>\n2),\u521b\u5efastruts.xml,\u653e\u5728src\u76ee\u5f55\u4e0b\uff0c\u5e76\u6dfb\u52a0\u76f8\u5e94\u7684action<br \/>\n? &lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;UTF-8&#8243;?&gt;<br \/>\n&lt;!DOCTYPE struts PUBLIC<br \/>\n&#8220;-\/\/Apache Software Foundation\/\/DTD Struts Configuration 2.0\/\/EN&#8221;<br \/>\n&#8220;<a href=\"http:\/\/struts.apache.org\/dtds\/struts-2.0.dtd\">http:\/\/struts.apache.org\/dtds\/struts-2.0.dtd<\/a>&#8220;&gt;<br \/>\n&lt;struts&gt;??<\/p>\n<p>&lt;include file=&#8221;struts-default.xml&#8221;\/&gt;<br \/>\n&lt;package name=&#8221;com.login&#8221;? extends=&#8221;struts-default&#8221;&gt;<br \/>\n?&lt;action name=&#8221;login&#8221; method=&#8221;login&#8221;&gt;???<br \/>\n?&lt;result name=&#8221;success&#8221; type=&#8221;redirect&#8221;&gt;success.jsp&lt;\/result&gt;<br \/>\n&lt;\/action&gt;???<br \/>\n&lt;\/package&gt;<br \/>\n??? &lt;\/struts&gt;<br \/>\n3), \u5728web.xml\u52a0\u5165filter,<br \/>\n????????????? \uff08\u6ce8\uff1a\u7528\u8fc7\u6ee4\u5668\u7684\u539f\u56e0\u662f\uff1a\u8981\u5bf9\u4f20\u6765\u7684\u5404\u79cdurl\u8fdb\u884c\u5206\u7c7b\uff0c\u8f6c\u5411\uff0c\u5373\u8fc7\u6ee4\u3002\u76f8\u4f3c\u7684\u8fd8\u6709servlet<br \/>\n?????????????????????? \u800cSpring\u7528\u76d1\u542c\u5668\uff0clisten\uff0c\u5f53\u76d1\u542c\u5230action\u521b\u5efa\u65f6\u5c31\u6ce8\u5165\u5c5e\u6027\uff09<br \/>\n&lt;filter&gt;<br \/>\n&lt;filter-name&gt;struts2&lt;\/filter-name&gt;<br \/>\n&lt;filter-class&gt;<br \/>\n??? org.apache.struts2.dispatcher.FilterDispatcher? \/\/\u9ed8\u8ba4\u5c31\u4f1a\u8bfb\u53d6src\u4e0b\u7684struts.xml<br \/>\n&lt;\/filter-class&gt;<br \/>\n&lt;\/filter&gt;<br \/>\n&lt;filter-mapping&gt;<br \/>\n&lt;filter-name&gt;struts2&lt;\/filter-name&gt;<br \/>\n&lt;url-pattern&gt;*.action&lt;\/url-pattern&gt;<br \/>\n&lt;\/filter-mapping&gt;<br \/>\n4), \u505ajsp\u5373\u53ef<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u3001Struts2.0\u7684\u521b\u5efa 1\uff09,\u6dfb\u52a0jar\u5305 ?? 1, commons-fileupload-1.2.1 [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[25],"tags":[],"class_list":["post-900","post","type-post","status-publish","format-standard","hentry","category-struts2-0"],"blocksy_meta":[],"_links":{"self":[{"href":"https:\/\/enjoyasp.net\/index.php\/wp-json\/wp\/v2\/posts\/900","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/enjoyasp.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/enjoyasp.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/enjoyasp.net\/index.php\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/enjoyasp.net\/index.php\/wp-json\/wp\/v2\/comments?post=900"}],"version-history":[{"count":0,"href":"https:\/\/enjoyasp.net\/index.php\/wp-json\/wp\/v2\/posts\/900\/revisions"}],"wp:attachment":[{"href":"https:\/\/enjoyasp.net\/index.php\/wp-json\/wp\/v2\/media?parent=900"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/enjoyasp.net\/index.php\/wp-json\/wp\/v2\/categories?post=900"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/enjoyasp.net\/index.php\/wp-json\/wp\/v2\/tags?post=900"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}