第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

ssm框架做登錄測(cè)試時(shí),如何把url欄中的.action偽裝變成.html?用urlrewrite這個(gè)東東。

ssm框架做登錄測(cè)試時(shí),如何把url欄中的.action偽裝變成.html?用urlrewrite這個(gè)東東。

--urlrewrite.xml <?xml?version="1.0"?encoding="utf-8"?>???? <!DOCTYPE?urlrewrite?PUBLIC?"-//tuckey.org//DTD?UrlRewrite?2.6//EN"????"http://tuckey.org/res/dtds/urlrewrite2.6.dtd"?> <urlrewrite> <rule> <from>/index.html</from> <to?type="forward">/index.jsp</to> </rule> <rule> <from>/([a-zA-Z0-9_\u4e00-\u9fa5]+).html</from> <to?type="forward">/ssmTest/$1.action</to> </rule> </urlrewrite> --web.xml <?xml?version="1.0"?encoding="UTF-8"?> <web-app?xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"?xmlns="http://java.sun.com/xml/ns/javaee"?xsi:schemaLocation="http://java.sun.com/xml/ns/javaee?http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"?id="WebApp_ID"?version="3.0"> ??<context-param> ????<param-name>contextConfigLocation</param-name> ????<param-value>classpath:spring*.xml</param-value> ??</context-param> ??<listener> ????<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> ??</listener> ??<filter> ????<filter-name>struts2</filter-name> ????<filter-class>org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter</filter-class> ??</filter> ??<filter-mapping> ????<filter-name>struts2</filter-name> ????<url-pattern>/*</url-pattern> ????<dispatcher>REQUEST</dispatcher> ????<dispatcher>FORWARD</dispatcher> ??</filter-mapping> ?? ??<filter>?? ????<filter-name>UrlRewriteFilter</filter-name>?? ????<filter-class>org.tuckey.web.filters.urlrewrite.UrlRewriteFilter</filter-class>?? </filter>?? <filter-mapping>?? ????<filter-name>UrlRewriteFilter</filter-name>?? ????<url-pattern>/*</url-pattern>?? </filter-mapping>? <welcome-file-list> <welcome-file>index.jsp</welcome-file> <welcome-file>*.html</welcome-file> </welcome-file-list> </web-app> --struts.xml <?xml?version="1.0"?encoding="UTF-8"??> <!DOCTYPE?struts?PUBLIC "-//Apache?Software?Foundation//DTD?Struts?Configuration?2.3//EN" "http://struts.apache.org/dtds/struts-2.3.dtd"> <struts> <constant?name="struts.enable.DynamicMethodInvocation"?value="false"?/> <constant?name="struts.devMode"?value="true"?/> <!--?把struts的action對(duì)象交給spring容器管理?--> <constant?name="struts.objectFactory?"?value="spring"?/> <package?name="default"?namespace="/"?extends="struts-default"> <action?name="*_*"?class="{1}Action"?method="{2}"> <result?name="loginsuccess">page/success.jsp</result> <result?name="loginfail"?type="redirect">index.jsp</result> </action> </package> </struts>問題來了:::把localhost:8080/ssmTest/user_login.action登錄跳轉(zhuǎn)時(shí)變成localhost:8080/ssmTest/user_login.html
查看完整描述

1 回答

?
yemaa

TA貢獻(xiàn)77條經(jīng)驗(yàn) 獲得超14個(gè)贊


在web.xml配置

<filter-mapping>
??<filter-name>struts2</filter-name>
??<url-pattern>*.html</url-pattern>
?</filter-mapping>

查看完整回答
反對(duì) 回復(fù) 2016-08-12
  • 1 回答
  • 1 關(guān)注
  • 5902 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)