webwork鏈€鏂扮増鏈?webwork 2.2.6鐜閰嶇疆杩囩▼ 2007骞?2鏈?5鏃?鏄熸湡浜?16:49
绗竴姝ワ細鎶妛ebwork鐨刯ar鍖呭姞鍒皐eb project涓紙涓婄綉涓嬪寘锛? 涓嬭澆鍦闆潃锛歨ttp://www.opensymphony.com/webwork/ webwork-2.2.6\webwork-2.2.6.jar webwork-2.2.6\lib\default\*.jar 灏嗕互涓婂寘鍔犲埌椤圭洰鐨刲ib鏂囦歡澶? 灏唚ebwork-2.2.6\src\java\webwork-default.xml鍔犲埌椤圭洰鐨刲ib鐩綍涓? 灏唚ebwork-2.2.6\src\java\META-INF\taglib.tld鏀瑰悕涓簑ebwork.tld鍔犲埌椤圭洰鐨刉EB-INF鐩綍涓? 绗簩姝ワ細鍦╳eb.xml涓厤缃畐ebwork <? xml version="1.0" encoding="UTF-8" ?> <! DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd" > < web-app > 聽聽聽聽 < display-name > WebWork 2.0 Example App </ display-name > 聽聽聽聽 < servlet > 聽聽聽聽聽聽聽聽 < servlet-name > webwork </ servlet-name > 聽聽聽聽聽聽聽聽 < servlet-class > com.opensymphony.webwork.dispatcher.ServletDispatcher </ servlet-class > 聽聽聽聽 </ servlet > 聽聽聽聽 < servlet-mapping > 聽聽聽聽聽聽聽聽 < servlet-name > webwork </ servlet-name > 聽聽聽聽聽聽聽聽 < url-pattern > *.action </ url-pattern > 聽聽聽聽 </ servlet-mapping >聽聽聽聽 <taglib> 聽聽 <taglib-uri>webwork</taglib-uri> 聽聽 <taglib-location>/WEB-INF/webwork.tld</taglib-location> </taglib> </ web-app > 聽 绗笁姝ワ細鏂闆緩action鏂囦歡 package com.jiangjing.action; import com.opensymphony.xwork.Action; public class hellowordaction implements Action ... { 聽聽聽聽private String name; 聽聽聽聽public String execute() throws Exception...{ 聽聽聽聽聽聽聽聽 name = "杩欐槸姹熼潤鐨勭涓€涓獁ebwork!"; 聽聽聽聽聽聽聽聽 System.out.println("----"); 聽聽聽聽聽聽聽聽 聽聽聽聽聽聽聽聽return SUCCESS; 聽聽聽聽 } 聽聽聽聽 聽聽聽聽public String getName() ...{ 聽聽聽聽聽聽聽聽return name; 聽聽聽聽 } 聽聽聽聽public void setName(String name) ...{ 聽聽聽聽聽聽聽聽this.name = name; 聽聽聽聽 }} 绗洓姝ワ細鏂闆緩jsp <% @ page language = " java " contentType = " text/html; charset=GBK " pageEncoding = " GBK " %> <% @taglib prefix = " ww " uri = " webwork " %> <! DOCTYPE HTML PUBLIC " -//W3C//DTD HTML 4.01 Transitional//EN " > < html > 聽聽聽聽 < head > 聽聽聽聽聽聽聽聽 < meta http - equiv = " Content-Type " content = " text/html; charset=GBK " /> 聽聽聽聽聽聽聽聽 < title > 鎴戠殑绗竴涓獁ebwork </ title > 聽聽聽聽 </ head > 聽聽聽聽 < body > 聽聽聽聽聽聽聽聽 <ww:property value="name"/> 聽聽聽聽 </ body > </ html > </ element > 绗簲姝ワ細娣誨姞webwork.properties鍒伴」鐩殑src鐩綍涓? webwork.i18n.encoding=ISO-8859-1 webwork.locale=de_DE webwork.multipart.saveDir= emp webwork.multipart.maxSize=12345 ### Load custom property files (does not override webwork.properties!) webwork.custom.properties=test,com/opensymphony/webwork/othertest # added the MockTag to the path of Tags that the TagDirective will search through webwork.velocity.tag.path = com.opensymphony.webwork.views.velocity.ui, org.displaytag.tags webwork.ui.templateDir = template ### Load custom default resource bundles webwork.custom.i18n.resources=testmessages,testmessages2 ### XSLT Cache webwork.xslt.nocache = true 绗叚姝ワ細娣誨姞xwork.xml鍒伴」鐩畇rc鐩綍 <! DOCTYPE xwork PUBLIC "-//OpenSymphony Group//XWork 1.0//EN" "http://www.opensymphony.com/xwork/xwork-1.0.dtd" > < xwork > 聽聽聽聽 < include file ="webwork-default.xml" /> 聽聽聽聽 <package name="default" extends ="webwork-default"> 聽聽聽聽 聽聽聽聽聽聽聽聽 <action name ="helloworld" class="com.jiangjing.action.hellowordaction" > 聽聽聽聽聽聽聽聽聽聽聽聽 < result name ="success" type ="dispatcher" > 聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 < param name ="location" > /hello.jsp </ param > 聽聽聽聽聽聽聽聽聽聽聽聽 </ result > 聽聽聽聽聽聽聽聽 </ action >聽聽聽聽 聽聽聽聽聽聽聽聽 聽聽聽聽 </ package > </ xwork > |
聽