锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲国产精品久久久久久女王,亚洲自拍偷拍九九九,18国产精品http://www.aygfsteel.com/void241/category/33143.htmlzh-cnSun, 28 Jul 2013 06:44:37 GMTSun, 28 Jul 2013 06:44:37 GMT60- GMT錛欽AVA鏁寸悊http://www.aygfsteel.com/void241/archive/2013/07/23/401854.htmlvoidvoidTue, 23 Jul 2013 02:16:00 GMThttp://www.aygfsteel.com/void241/archive/2013/07/23/401854.htmlhttp://www.aygfsteel.com/void241/comments/401854.htmlhttp://www.aygfsteel.com/void241/archive/2013/07/23/401854.html#Feedback0http://www.aygfsteel.com/void241/comments/commentRss/401854.htmlhttp://www.aygfsteel.com/void241/services/trackbacks/401854.htmlcom.sysdeo.eclipse.tomcat_3.3.0
site-1.6.5
$('#dialog-form').serialize()
Action鍩虹被
public class BaseAction extends ActionSupport implements ServletRequestAware,ServletResponseAware,ServletContextAware
JSON
@ParentPackage("json-default")
@InterceptorRefs( {
@InterceptorRef("MyInterceptor"),
@InterceptorRef("defaultStack")
})
@InterceptorRefs(@InterceptorRef("parmsUrl"))
, interceptorRefs=@InterceptorRef("json-default")
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<constant name="struts.i18n.encoding" value="gbk"></constant>
<constant name="struts.convention.action.packages" value="cn.net.gmt.gitf" />
<constant name="struts.convention.default.parent.package" value="crud-default" />
<constant name="struts.convention.package.locators" value="web" />
<constant name="struts.convention.package.locators.basePackage" value="org.springside.examples.miniweb" />
<package name="crud-default" extends="convention-default,json-default" >
<interceptors>
<interceptor name="urlparm" class="cn.net.gmt.gitf.welcome.LoginInterceptor"></interceptor>
<interceptor-stack name="crudStack">
<interceptor-ref name="store">
<param name="operationMode">AUTOMATIC</param>
</interceptor-ref>
<interceptor-ref name="paramsPrepareParamsStack" />
</interceptor-stack>
<interceptor-stack name="parmsUrl">
<interceptor-ref name="urlparm"/>
<interceptor-ref name="crudStack"/>
</interceptor-stack>
</interceptors>
<default-interceptor-ref name="parmsUrl" />
<global-results>
<result name="login" type="redirect">/login.action</result>
</global-results>
</package>
</struts>

]]> - struts2 娉ㄨВ閰嶇疆http://www.aygfsteel.com/void241/archive/2013/06/22/400848.htmlvoidvoidSat, 22 Jun 2013 02:23:00 GMThttp://www.aygfsteel.com/void241/archive/2013/06/22/400848.htmlhttp://www.aygfsteel.com/void241/comments/400848.htmlhttp://www.aygfsteel.com/void241/archive/2013/06/22/400848.html#Feedback0http://www.aygfsteel.com/void241/comments/commentRss/400848.htmlhttp://www.aygfsteel.com/void241/services/trackbacks/400848.html1銆亀eb.xml
- <!-- struts2 閰嶇疆 -->
- <filter>
- <filter-name>struts2</filter-name>
- <filter-class>
- org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
- </filter-class>
- <init-param>
- <param-name>actionPackages</param-name>
- <param-value>com.yz.webapp.action</param-value>
- </init-param>
- </filter>
- <filter-mapping>
- <filter-name>struts2</filter-name>
- <url-pattern>/*</url-pattern>
- </filter-mapping>
struts.properties
- #淇敼鏃墮噸鏂板姞杞?nbsp;
- struts.configuration.xml.reload = true
- #鎵撳嵃鏇村閿欒淇℃伅
- struts.devMode = true
- #娉ㄨВ鎵弿鐨勫寘緇撳熬鍚?nbsp;
- struts.convention.package.locators = action
- #鏄犲皠鎵╁睍鍚?nbsp;
- struts.action.extension = html
- #緇撴灉璧勬簮鎵鍦ㄨ礬寰?nbsp;
- #struts.convention.result.path = /WEB-INF/pages
2銆乤ction 綾誨悕涓婂姞娉ㄨВ
- @Namespace("/ssi")
- @ParentPackage("json-default")
- @Action(value = "admin", results = {
- @Result(name = "success", location = "/WEB-INF/pages/admin.jsp"),
- @Result(name = "json", type = "json", params = { "excludeProperties","adminMgr" }) })
- public class AdminAction extends BaseAction{}
澶氫釜Action
- @Namespace("/msa")
- @Result(name = "json", type = "json", params = { "excludeProperties",
- ".*Manager,.*\\.authorities,.*\\.roles,.*\\.fileCon" })
- @Actions(value = {
- @Action(value = "foreignship", results = { @Result(name = "success", location = "foreignship/foreignship.jsp") }),
- @Action(value = "foreignshipsee", results = { @Result(name = "success", location = "foreignship/foreignshipsee.jsp") }) })
- public class TMsaForeignShipArchivesAction extends BaseAction{}
鍦ㄧ被鏂規硶涓婂姞娉ㄨВ
- //@Action(value = "add", results = { @Result(name = "success", location = "/index.jsp") })
- @Action(value = "save")
- public String save() {
- try{
- adminMgr.insert("insertYz_admin", admin);
- }catch(Exception e){
- msg = e.toString();
- success = false;
- }
- return this.SUCCESS;
- }

]]> - struts2鍜宖reemarker闆嗘垚瀹炰緥 (娉ㄨВ鏂瑰紡)http://www.aygfsteel.com/void241/archive/2013/06/22/400847.htmlvoidvoidSat, 22 Jun 2013 02:22:00 GMThttp://www.aygfsteel.com/void241/archive/2013/06/22/400847.htmlhttp://www.aygfsteel.com/void241/comments/400847.htmlhttp://www.aygfsteel.com/void241/archive/2013/06/22/400847.html#Feedback0http://www.aygfsteel.com/void241/comments/commentRss/400847.htmlhttp://www.aygfsteel.com/void241/services/trackbacks/400847.html鏈榪戣寮濮嬪仛欏圭洰浜嗭紝欏圭洰涓彲鑳戒細鐢ㄥ埌Struts2鍜孎reemarker闆嗘垚錛屾墍浠ュ仛浜嗕釜瀹炰緥緇欏ぇ瀹跺垎浜竴涓嬨?/p>
鍓嶆湡鐨勯厤緗畐eb.xml錛屽鍏ar鍖呭氨涓嶇粰澶у浠嬬粛浜嗭紝榪欎簺鍐呭鍋氳繃struts2鐨勬湅鍙嬬殑闈炲父鐔熸倝錛屽鏋滄湁涓嶄細鐨勫ぇ瀹跺彲浠ユ壘涓涓嬪府鍔╂枃妗f垨鑰呬笂浜掕仈緗戜笂鎼滅儲涓涓嬭В鍐蟲柟娉曘?/p>
鐪嬭繃struts2緇撴瀯鍥劇殑鏈嬪弸浠兘搴旇鐭ラ亾struts2鐨勫睍鐜板眰涓嶅啀鏄儚struts1閭f牱鍗曠函鐨刯sp浜嗭紝瀹冭兘澶熼泦鎴愬緢澶氬睍鐜板眰鎶鏈紝渚嬪浠婂ぉ璇寸殑freemarker絳夌瓑銆?/p>

鏃㈢劧涓婇潰閮借鍒頒簡freemarker浠呬粎鏄竴涓睍鐜板眰鎶鏈紝閭d箞鎴戜滑鑷劧浼氭兂鍒幫紝freemarker搴旇鍜宻truts2涓厤緗殑action鏍囩涓殑result鏈夊叧緋伙紝鍏跺疄灝辨槸榪欐牱鐨勶紝鎴戜滑鐭ラ亾struts2鐨剅esult鏍囩灝辨槸鍖歸厤璺寵漿璺緞鎺у埗灞曠ず灞傜殑浣滅敤錛屾墍浠ユ垜浠埄鐢╯truts2鍜宖reemarker鐨勬渶榪戞湰鎿嶄綔灝辨槸閰嶇疆result鏍囩錛屾妸鍘熷厛鐨剅esult鏍囩鐨則ype鍙樻垚freemarker錛岃煩杞殑鏂囦歡鍙樻垚freemarker鐨勬ā鏉挎枃浠跺嵆鍙傞厤緗涓嬶細
- <struts>
-
- <package name="struts"extends="struts-default">
-
- <action name="userLogin"class="com.test.action.LoginAction" method="userLogin">
-
- <result name="success" type="freemarker">
-
- /WEB-INF/templates/user.ftl
-
- </result>
-
- </action>
-
- </package>
-
- </struts>
濡傛灉鎴戜滑瑕佹槸鐢╯truts2鐨勬敞瑙f柟寮忔潵閰嶇疆action鐨勮瘽錛岄偅涔堟垜浠氨浼氳繖鏍烽厤緗細
- @Action(value = "showadd", results ={ @Result(name = "success", type = "freemarker", location ="/flt/adduser.ftl") })
鎬諱箣灝辨槸瑕佹敼result鐨勭被鍨嬪拰璺寵漿鏂囦歡綾誨瀷鍗沖彲銆?/p>
鏈鍚庢垜浠涓涓嬫垜浠庝箞灝嗘ā鏉夸腑鐨勫彉閲忓彉鎴愬疄闄呯殑鍊鹼紝榪欎釜涔熸槸姣旇緝綆鍗曠殑錛屾垜浠繖涓伐浣滆鍦╝ction涓疄鐜幫紝鍏蜂綋灝辨槸鎴戜滑瑕佸皢妯℃澘涓殑鍙橀噺瀹氫箟鍒癮ction涓紝騫朵笖鐢熸垚get鍜宻et鏂規硶錛屾渶鍚庡湪鐩稿簲鐨勪笟鍔℃柟娉曚腑灝嗚繖涓彉閲忚祴鍊鹼紝榪欐牱struts2灝變細鑷姩鐨勪負鎴戜滑灝嗗煎~鍐欏埌妯℃澘涓紝褰㈡垚鐪熷疄鐨勫睍鐜伴〉闈紝鏈鍚庤煩杞樉紺虹粰鐢ㄦ埛銆?/p>
Freemarker鐨勬ā鏉垮疄渚嬶細
- <html>
-
- <head>
-
- <meta http-equiv="Content-Type" content="text/html;charset=gb2312">
-
- <title>Insert title here</title>
-
- </head>
-
- <body>
-
- <formmethodformmethod="post" action="${formaction}" name="${formname}">
-
-
-
- <input id="${adduser_username}" name="${adduser_username}" type="${text}" value="" />
-
- <input id="${adduser_password}" name="${adduser_password}" type="${text}" value=""/>
-
- <input id="${adduser_submit}" name="${adduser_submit}" type="${submit}" value="adduser" />
-
- </form>
-
- </body>
-
- </html>
瀵瑰簲鐨刟ction錛?/p>
- private Stringformaction;
-
-
-
- private Stringformname;
-
-
-
- private Stringadduser_username;
-
-
-
- private Stringadduser_password;
-
-
-
- private Stringadduser_submit;
-
-
-
- private Stringtext;
-
-
-
- private Stringsubmit;
-
-
-
- public StringgetAdduser_username() {
-
- returnadduser_username;
-
- }
-
-
-
- publicvoidsetAdduser_username(String adduser_username) {
-
- this.adduser_username = adduser_username;
-
- }
-
-
-
- public StringgetAdduser_password() {
-
- returnadduser_password;
-
- }
-
-
-
- publicvoidsetAdduser_password(String adduser_password) {
-
- this.adduser_password = adduser_password;
-
- }
-
-
-
- public StringgetAdduser_submit() {
-
- returnadduser_submit;
-
- }
-
-
-
- publicvoid setAdduser_submit(Stringadduser_submit) {
-
- this.adduser_submit = adduser_submit;
-
- }
-
-
-
- public StringgetText() {
-
- returntext;
-
- }
-
-
-
- publicvoidsetText(String text) {
-
- this.text =text;
-
- }
-
-
-
- public StringgetSubmit() {
-
- returnsubmit;
-
- }
-
-
-
- publicvoidsetSubmit(String submit) {
-
- this.submit =submit;
-
- }
-
-
-
- public StringgetFormaction() {
-
- returnformaction;
-
- }
-
-
-
- publicvoidsetFormaction(String formaction) {
-
- this.formaction =formaction;
-
- }
-
-
-
- public StringgetFormname() {
-
- returnformname;
-
- }
-
-
-
- publicvoidsetFormname(String formname) {
-
- this.formname =formname;
-
- }
-
-
-
-
-
- @Action(value= "showadd", results = { @Result(name ="success", type = "freemarker", location = "/flt/adduser.ftl") })
-
- public Stringshowadd() throws Exception {
-
- /*
-
- * FreeMarkerUtil freeMarkerUtil=newFreeMarkerUtil();
-
- * Map<String,Object> root=newHashMap<String,Object>(); //涓烘暟鎹ā鍨嬫坊鍔犲?nbsp;
-
- * root.put("formaction","adduser"); root.put("formname", "adduser");
-
- *
-
- * FileWriter out=new FileWriter(newFile("/adduser.ftl"));
-
- * freeMarkerUtil.printFile("/flt","adduser.ftl",root, out);
-
- */
-
- setFormaction("adduser");
-
- setFormname("adduser");
-
- setAdduser_password("password");
-
- setAdduser_submit("adduser_submit");
-
- setAdduser_username("username");
-
- setText("text");
-
- setSubmit("submit");
-
- return"success";
-
- }
榪欐牱鎴戜滑榪愯灝辮兘澶熺湅鍒版垜浠殑涓涓坊鍔犻〉闈紝闇瑕佸~鍏ョ敤鎴峰悕鍜屽瘑鐮併?/p>
]]> - Strus2 + Freemarker + Sitemesh 涔辯爜瑙e喅鏂規http://www.aygfsteel.com/void241/archive/2011/06/07/351846.htmlvoidvoidTue, 07 Jun 2011 04:40:00 GMThttp://www.aygfsteel.com/void241/archive/2011/06/07/351846.htmlhttp://www.aygfsteel.com/void241/comments/351846.htmlhttp://www.aygfsteel.com/void241/archive/2011/06/07/351846.html#Feedback0http://www.aygfsteel.com/void241/comments/commentRss/351846.htmlhttp://www.aygfsteel.com/void241/services/trackbacks/351846.html
Struts2
1.src鐩綍娣誨姞鏂囦歡struts.properties
<!-- 璇ュ睘鎬ц緗甋truts 2鏄惁鏀寔鍔ㄦ佹柟娉曡皟鐢紝璇ュ睘鎬х殑榛樿鍊兼槸true銆傚鏋滈渶瑕佸叧闂姩鎬佹柟娉曡皟鐢紝鍒欏彲璁劇疆璇ュ睘鎬т負false銆?nbsp;-->
struts.enable.DynamicMethodInvocation=true
<!-- 璇ュ睘鎬ф寚瀹氳鍥炬爣絳鵑粯璁ょ殑瑙嗗浘涓婚錛岃灞炴х殑榛樿鍊兼槸xhtml銆?nbsp;-->
struts.ui.theme=simple
<!-- 鏄惁struts榪囨護鍣ㄤ腑鎻愪緵鐨勯潤鎬佸唴瀹瑰簲璇ヨ嫻忚鍣ㄧ紦瀛樺湪澶撮儴灞炴т腑 -->
struts.serve.static.browserCache=false
<!-- 鍦╱rl涓駭鐢?nbsp;榛樿鐨刬ncludeParams -->
struts.url.includeParams=none
<!-- 褰搒truts閰嶇疆鏂囦歡淇敼鍚庯紝緋葷粺鏄惁閲嶆柊鍔犺澆閰嶆枃浠訛紝榛樿鏄痜alse -->
struts.configuration.xml.reload=true
<!-- 寮鍙戞ā寮忎笅浣跨敤錛岃繖鏍峰彲浠ユ墦鍗板嚭鏇磋緇嗙殑閿欒淇℃伅 -->
struts.devMode=true
<!-- 淇敼璧勬簮鏂囦歡鍚庤嚜鍔ㄨ杞?nbsp;-->
struts.i18n.reload=true
<!-- 璇ュ睘鎬ф寚瀹歑SLT Result鏄惁浣跨敤鏍峰紡琛ㄧ紦瀛樸傚綋搴旂敤澶勪簬寮鍙戦樁孌墊椂錛岃灞炴ч氬父琚緗負true錛涘綋搴旂敤澶勪簬浜у搧浣跨敤闃舵鏃訛紝璇ュ睘鎬ч氬父琚緗負false銆?nbsp;-->
struts.xslt.nocache=true
<!-- action鎵╁睍鍚?nbsp;-->
struts.action.extension=jhtml
<!-- 榛樿鐨勫浗闄呭寲鍦板尯淇℃伅 -->
struts.locale=zh_CN
<!-- 鍥介檯鍖栦俊鎭唴鐮?nbsp;-->
struts.i18n.encoding=UTF-8
Freemarker
1.璁劇疆
<result name="error" type="freemarker">
<param name="location">/WEB-INF/pages/console/AccountEdit.ftl</param>
<param name="contentType">text/html;charset=GBK</param>
</result>
2.鎴栬呭湪src鐩綍娣誨姞鏂囦歡freemarker.properties
locale=zh_CN
default_encoding=UTF-8
number_format=#
date_format=yyyy-MM-dd
time_format=HH:mm:Ss
datetime_format=yyyy-MM-dd HH\:mm\:Ss
Sitemesh
sitemesh鍦ㄥ鐞嗙紪鐮佹椂浼氫嬌鐢ㄧ郴緇熺殑緙栫爜錛宑om.opensymphony.module.sitemesh.filter.TextEncoder鏂囦歡
private static final String DEFAULT_ENCODING = System.getProperty("file.encoding");
private static final boolean JDK14 =
System.getProperty("java.version").startsWith("1.4")
|| System.getProperty("java.version").startsWith("1.5");
public char[] encode(byte[] data, String encoding) throws IOException {
if (encoding == null) {
encoding = DEFAULT_ENCODING;
}
//encoding = "UTF-8";
if (JDK14) {
return get14Buffer(data, encoding);
} else {
return get13Buffer(data, encoding);
}
}
鎵浠ラ渶瑕佸湪sitemesh鍚姩鍓嶈緗幆澧?br />
System.setProperty("file.encoding","UTF-8")
Jsp
<head>
<%@ page contentType="text/html; charset=utf-8" language="java"%>
<%@ taglib uri="http://www.opensymphony.com/sitemesh/decorator" prefix="decorator"%>
</head>

]]> - 闃垮瘑鏋滅殑struts2瀛︿範, 2.08瀹炰緥http://www.aygfsteel.com/void241/archive/2008/07/19/216013.htmlvoidvoidSat, 19 Jul 2008 04:26:00 GMThttp://www.aygfsteel.com/void241/archive/2008/07/19/216013.htmlhttp://www.aygfsteel.com/void241/comments/216013.htmlhttp://www.aygfsteel.com/void241/archive/2008/07/19/216013.html#Feedback0http://www.aygfsteel.com/void241/comments/commentRss/216013.htmlhttp://www.aygfsteel.com/void241/services/trackbacks/216013.htmlhttp://www.aygfsteel.com/amigoxie/category/28622.html

]]>- 鑷姩鐧婚檰鍔熻兘http://www.aygfsteel.com/void241/archive/2008/07/19/215997.htmlvoidvoidSat, 19 Jul 2008 04:13:00 GMThttp://www.aygfsteel.com/void241/archive/2008/07/19/215997.htmlhttp://www.aygfsteel.com/void241/comments/215997.htmlhttp://www.aygfsteel.com/void241/archive/2008/07/19/215997.html#Feedback0http://www.aygfsteel.com/void241/comments/commentRss/215997.htmlhttp://www.aygfsteel.com/void241/services/trackbacks/215997.html
http://blog.csdn.net/lyhapple/archive/2007/10/09/1817308.aspx
request.getRequestDispatcher("/Test/test2.jsp").forward(request,response); //絎竴涓姙娉?br />
response.sendRedirect("/Test/test2.jsp"); //絎簩涓姙娉?/p>
<filter-mapping>
<filter-name>SetMenuFilter</filter-name>
<url-pattern>/pages/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>SetMenuFilter</filter-name>
<url-pattern>/pages/*.do</url-pattern>
</filter-mapping>
|

]]>
主站蜘蛛池模板:
佛学|
东乡族自治县|
新丰县|
方正县|
翁牛特旗|
台东市|
常宁市|
邓州市|
临夏县|
秀山|
江西省|
新乡县|
吉林省|
铜陵市|
介休市|
股票|
交城县|
镇康县|
嵊泗县|
东光县|
井研县|
杭锦后旗|
丰都县|
昌江|
惠州市|
南丹县|
呼伦贝尔市|
高尔夫|
额济纳旗|
陕西省|
红原县|
长乐市|
马公市|
江源县|
奉化市|
南平市|
宁武县|
元氏县|
金昌市|
莫力|
台东市|