一定要注意:url中includeParams的屬性的默認值是get,如果沒有在struts.xml指定新的值,那么使用url標簽引用的所有的靜態(tài)文件都會帶上通過get方法傳遞的參數(shù)值。另外:includeParams的屬性值還有none、allall,是把get和post" />

亚洲免费在线-亚洲免费在线播放-亚洲免费在线观看-亚洲免费在线观看视频-亚洲免费在线看-亚洲免费在线视频

struts2標簽之url標簽

系統(tǒng) 1624 0

下面是struts2標簽的常用的用法
<s:url value="/images/copyright.jpg" />
<s:url action="list" namespace="/qxgl" />
一定要注意:url中includeParams的屬性的默認值是get,如果沒有在struts.xml指定新的值,那么使用url標簽引用的所有的靜態(tài)文件都會帶上通過get方法傳遞的參數(shù)值。
另外:includeParams的屬性值還有none、all
all,是把get和post中的參數(shù)加入到 url 參數(shù)中 ;
none是不把參數(shù)加入到url中;

例如:你在detail.jsp中寫入

<link href="<s:url value="/css/styleqxgl.css"/>" rel="stylesheet"
type="text/css">

在瀏覽器中輸入http://localhost/detail.jsp?id=5

<link href="/web應(yīng)用名稱/css/styleqxgl.css?id=5" rel="stylesheet"
type="text/css">
這樣瀏覽器就又下載了一次styleqxgl.css,如果你的系統(tǒng)放在公網(wǎng)上,那么帶寬的費用是很貴的,使用瀏覽器的緩存,可以有效的利用帶寬,節(jié)約成本。

解決這個問題的辦法有兩個,一個是<s:url value="/css/styleqxgl.css" includeParams="none"/>

另外一個就是在struts.xml中配置,參考下文:

Setting a default value for includeParams

The property struts.url.includeParams can be used to set the default value of the includeParams attribute.

Setting the default value of includeParams
        
          <struts>
        
        
...
<constant name= "struts.url.includeParams" value= "none" />
...
</struts>

See Constant Configuration for further information.

Parameters

Name

Required

Default

Evaluated

Type

Description

action false
false String The action to generate the URL for, if not using value
anchor false
false String The anchor for this URL
encode false true false Boolean Whether to encode parameters
escapeAmp false true false Boolean Specifies whether to escape ampersand (&) to (&amp or not
forceAddSchemeHostAndPort false false false Boolean Specifies whether to force the addition of scheme, host and port or not
id false
false String Deprecated. Use 'var' instead
includeContext false true false Boolean Whether actual context should be included in URL
includeParams false get false String The includeParams attribute may have the value 'none', 'get' or 'all'
method false
false String The method of action to use
namespace false
false String The namespace to use
portletMode false
false String The resulting portlet mode
portletUrlType false
false String Specifies if this should be a portlet render or action URL. Default is "render". To create an action URL, use "action".
scheme false
false String Set scheme attribute
value false
false String The target value to use, if not using action
var false
false String Name used to reference the value pushed into the Value Stack
windowState false
false String The resulting portlet window state

struts2標簽之url標簽


更多文章、技術(shù)交流、商務(wù)合作、聯(lián)系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯(lián)系: 360901061

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對您有幫助就好】

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會非常 感謝您的哦?。。?/p>

發(fā)表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 伊人精品视频在线观看 | 老妇激情毛片免费 | 亚洲精品成人7777在线观看 | 国产高清精品自在久久 | 特黄aaaaaaaaa真人毛片 | 欧美夜夜| 在线日本中文字幕 | 久久国产精品自在自线 | 欧美色图一区二区 | 欧美.成人.综合在线 | 久久996国产精品免费 | 特黄特级a级黄毛片免费观看多人 | 热久久久久 | 欧美一区二区三区免费视频 | 91亚洲视频在线观看 | 天天久久 | 麻豆久久婷婷国产综合五月 | 69热在线观看 | 中文字幕日韩高清 | 老年人一级特黄aa大片 | 色网站在线播放 | 香焦视频在线观看黄 | 性欧美极品xxxx欧美一区二区 | 九九毛片 | 久久久久一区二区三区 | 国产日韩一区二区三区 | 欧美一级欧美一级毛片 | 四虎在线影院 | 青青青在线视频人视频在线 | 成人免费aa在线观看 | 性欧美视频在线观看 | 免费国产成人 | 国产在线观看一区二区三区四区 | 日本阿v精品视频在线观看 日本爱爱免费视频 | 久久精品国产亚洲妲己影院 | 日本高清不卡一区久久精品 | 婷婷国产偷v国产偷v亚洲 | 欧美高清国产 | 亚洲精品欧美精品中文字幕 | 国产美女亚洲精品久久久久久 | 国产网红福利视频网站 |