久久精品国产秦先生,久久久久中文字幕2018,亚洲国产精品久久久久久 http://www.aygfsteel.com/xiaohu/category/20428.html為你而瘋狂zh-cnWed, 18 Apr 2007 16:46:44 GMTWed, 18 Apr 2007 16:46:44 GMT60Struts 2.0的Actionhttp://www.aygfsteel.com/xiaohu/archive/2007/04/17/111140.html小虎(年輕)小虎(年輕)Tue, 17 Apr 2007 01:02:00 GMThttp://www.aygfsteel.com/xiaohu/archive/2007/04/17/111140.htmlhttp://www.aygfsteel.com/xiaohu/comments/111140.htmlhttp://www.aygfsteel.com/xiaohu/archive/2007/04/17/111140.html#Feedback0http://www.aygfsteel.com/xiaohu/comments/commentRss/111140.htmlhttp://www.aygfsteel.com/xiaohu/services/trackbacks/111140.html閱讀全文

小虎(年輕) 2007-04-17 09:02 發(fā)表評論
]]>
Entity 轉(zhuǎn)換成 ActionForm用http://www.aygfsteel.com/xiaohu/archive/2007/03/26/106350.html小虎(年輕)小虎(年輕)Mon, 26 Mar 2007 03:20:00 GMThttp://www.aygfsteel.com/xiaohu/archive/2007/03/26/106350.htmlhttp://www.aygfsteel.com/xiaohu/comments/106350.htmlhttp://www.aygfsteel.com/xiaohu/archive/2007/03/26/106350.html#Feedback0http://www.aygfsteel.com/xiaohu/comments/commentRss/106350.htmlhttp://www.aygfsteel.com/xiaohu/services/trackbacks/106350.html <form-beans>
??? <form-bean name="loginForm" type="org.apache.struts.validator.LazyValidatorForm">
??? ?<form-property name="login" type="com.xiaohu.domain.User_Info"/>
??? </form-bean>
</form-beans>



<action-mappings >
??? <action
????? attribute="loginForm"
????? input="/view/index.jsp"
????? name="loginForm"
????? path="/login"
????? scope="request"
????? parameter="method"
????? validate="false"(此參數(shù)不可缺)
????? type="org.springframework.web.struts.DelegatingActionProxy">
????? <forward name="success" path="/message/success.jsp" />
????? <forward name="failure" path="/message/failure.jsp" />
??? </action>

</action-mappings>



小虎(年輕) 2007-03-26 11:20 發(fā)表評論
]]>
配置文件的讀取http://www.aygfsteel.com/xiaohu/archive/2007/03/13/103504.html小虎(年輕)小虎(年輕)Tue, 13 Mar 2007 04:58:00 GMThttp://www.aygfsteel.com/xiaohu/archive/2007/03/13/103504.htmlhttp://www.aygfsteel.com/xiaohu/comments/103504.htmlhttp://www.aygfsteel.com/xiaohu/archive/2007/03/13/103504.html#Feedback0http://www.aygfsteel.com/xiaohu/comments/commentRss/103504.htmlhttp://www.aygfsteel.com/xiaohu/services/trackbacks/103504.html .ini或者.proerties文件, 只要內(nèi)容是 ds=dfjh 或者 kd: ksadkf 這種,就可以用如下方法讀取:
???Proerties pro = new Properties();
???InputStream ins = getClass().getClassLoad().getResourceAsStream("/test.properties");
??????????????????或者
???FileInputStream fins= new FileInputStream("test.properties");?
???pro.load(ins);
???ins.close();
???String value = pro.getProperty("parameter");



小虎(年輕) 2007-03-13 12:58 發(fā)表評論
]]>
ActionErrors和ActionError的用法http://www.aygfsteel.com/xiaohu/archive/2007/03/12/103212.html小虎(年輕)小虎(年輕)Mon, 12 Mar 2007 01:16:00 GMThttp://www.aygfsteel.com/xiaohu/archive/2007/03/12/103212.htmlhttp://www.aygfsteel.com/xiaohu/comments/103212.htmlhttp://www.aygfsteel.com/xiaohu/archive/2007/03/12/103212.html#Feedback0http://www.aygfsteel.com/xiaohu/comments/commentRss/103212.htmlhttp://www.aygfsteel.com/xiaohu/services/trackbacks/103212.html/**ActionErrors和ActionError都是ActionMessage的子類,ActionError存放在
??? ActionErrors中,ActionError對象中的參數(shù)為配置文件中配置的相應(yīng)的值,若配置文件
??? 中沒有配置或配置文件不合適都不能用<html:errors property=""/>輸出
?*/
1.建立配置文件MyResource.property,例如放在com.gsww.property下.在此配置文件中設(shè)定所需要的對應(yīng)值,如:
???# Resources for parameter 'com.yourcompany.struts.ApplicationResources'
???# Project P/xioahu
???user.name=<b>userName {0} {1} is not valid user,please input again.</b>
???login.false=<b>userName or password is not right</b>???
2.在struts-config.xml中配置如下:
???<message-resources parameter="com.gsww.property.MyResource" />
3.應(yīng)用如下:
???ActionErrors errors = new ActionErrors();
???ActionError error = new ActionError("login.false");
???errors.add("loginFalse",error);
???saveErrors(request,errors):
4.JSP頁面中輸出錯誤信息
???<html:errors property="loginFalse"/>











小虎(年輕) 2007-03-12 09:16 發(fā)表評論
]]>
動態(tài)ActionForm的配置http://www.aygfsteel.com/xiaohu/archive/2007/03/12/103207.html小虎(年輕)小虎(年輕)Mon, 12 Mar 2007 00:59:00 GMThttp://www.aygfsteel.com/xiaohu/archive/2007/03/12/103207.htmlhttp://www.aygfsteel.com/xiaohu/comments/103207.htmlhttp://www.aygfsteel.com/xiaohu/archive/2007/03/12/103207.html#Feedback0http://www.aygfsteel.com/xiaohu/comments/commentRss/103207.htmlhttp://www.aygfsteel.com/xiaohu/services/trackbacks/103207.html1.在struts-config.xml中的配置如下:
???<form-beans >
??? <!-- <form-bean name="loginForm" type="com.gsww.web.actionForm.LoginForm" /> -->
????<form-bean name="loginForm" type="org.apache.struts.action.DynaActionForm">
?????<form-property name="userName" type="java.lang.String"/>
?????<form-property name="password" type="java.lang.String"/>
????</form-bean>
???</form-beans>
2.Action中的應(yīng)用如下:
/**建立動態(tài)表單對象,用于獲取表單數(shù)據(jù)*/
??DynaActionForm dynaform = (DynaActionForm)form;
??
/**用DynaActionForm.get("字段名")來獲取字段值*/
??System.out.print("userName="+dynaform.get("userName"));



小虎(年輕) 2007-03-12 08:59 發(fā)表評論
]]>
log4j使用問題http://www.aygfsteel.com/xiaohu/archive/2007/03/08/102538.html小虎(年輕)小虎(年輕)Thu, 08 Mar 2007 01:44:00 GMThttp://www.aygfsteel.com/xiaohu/archive/2007/03/08/102538.htmlhttp://www.aygfsteel.com/xiaohu/comments/102538.htmlhttp://www.aygfsteel.com/xiaohu/archive/2007/03/08/102538.html#Feedback0http://www.aygfsteel.com/xiaohu/comments/commentRss/102538.htmlhttp://www.aygfsteel.com/xiaohu/services/trackbacks/102538.html 我在MyEclipse+JBoss4下使用log4j,已經(jīng)修改了 jboss-service.xml中的
<attribute name="Java2ClassLoadingCompliance">true</attribute>
<attribute name="UseJBossWebLoader">true</attribute>

但為什么配置文件好像還是不起作用?(配置文件無誤,已使用指定路徑的辦法測試過,log4j.property默認(rèn)放在了SRC目錄下).



小虎(年輕) 2007-03-08 09:44 發(fā)表評論
]]>
JBOSS與LOG4Jhttp://www.aygfsteel.com/xiaohu/archive/2007/03/07/102474.html小虎(年輕)小虎(年輕)Wed, 07 Mar 2007 13:35:00 GMThttp://www.aygfsteel.com/xiaohu/archive/2007/03/07/102474.htmlhttp://www.aygfsteel.com/xiaohu/comments/102474.htmlhttp://www.aygfsteel.com/xiaohu/archive/2007/03/07/102474.html#Feedback0http://www.aygfsteel.com/xiaohu/comments/commentRss/102474.htmlhttp://www.aygfsteel.com/xiaohu/services/trackbacks/102474.html ??? 不同的服務(wù)器對于使用 log4j 是有些不同的,實(shí)際使用中主要是用 tomcat jboss 兩類,對于 tomcat, 它本身是沒有配置 log4j 的,所以使用起來和常規(guī)的一樣;而在 jboss 中它是本身配置了 log4j 的,所以有時候在看項(xiàng)目代碼時,其整個項(xiàng)目并沒有 log4j 的配置文件,而在一些類中仍然定義了 Logger, 例如 static Logger log = org.apache.log4j.Logger.getLogger(UserDaoImple.class); ,這就表明開發(fā)者打算使用 jboss 默認(rèn)的 log4j 的配置,我們可以在 jboss 下的對應(yīng)的 log 目錄下的 server.log 中看到日志, jboss 本身的 log4j 的配置是將 debug,info 級的日志寫在 server.log 中,而像 error 等級別比較高的日志打印到控制臺上,而寫到 server.log 中的日志比較多,并不方便查看。于是我們想到使用自己的 log4j 配置寫到某個具體的文件中(注意文件要先建立,才能忘里面寫東西, log4j 自己不能建立文件),但這里因?yàn)?/font> jboss 有它自己的 log4j 配置,所以如果我們配置的 log4j 包含 Console Appender 時,就會出錯,錯誤類似于 ERROR: invalid console appender config detected, console stream is looping.
解決方法一是不用 Console Appender, 或者改 jboss 的配置文件,在 jboss-service.xml 文件里 ,
<mbean code="org.jboss.logging.Log4jService" name="jboss.system:type=Log4jService,service=Logging">
????????<attribute name="ConfigurationURL">resource:log4j.xml</attribute>
????????<attribute name="CatchSystemOut">false</attribute>
????????<attribute name="Log4jQuietMode">true</attribute>
</mbean>
。

我建議不用 Console Appender ,當(dāng)然這是對 jboss3.2.x 是這樣,對于 jboss4.0.x 如果我們要用自己的 log4j 配置照上述改還是會有問題,會有類似于 log4j:ERROR A "org.jboss.logging.util.OnlyOnceErrorHandler" object is not assignable to a "org.apache.log4j.spi.ErrorHandler" variable 的異常,解決方法是把 /server/default/jbossweb-tomcat55.sar/META-INF/jboss-service.xml 中的以下兩個熟悉改成 true
<attribute name="Java2ClassLoadingCompliance">true</attribute>
<attribute name="UseJBossWebLoader">true</attribute>

以上就是使用 jboss 服務(wù)器可能出現(xiàn)的問題,解決了這些再來使用 log4j 就比較簡單了。

]]>
不走jsp,直接輸出字符串http://www.aygfsteel.com/xiaohu/archive/2007/03/07/102473.html小虎(年輕)小虎(年輕)Wed, 07 Mar 2007 13:34:00 GMThttp://www.aygfsteel.com/xiaohu/archive/2007/03/07/102473.htmlhttp://www.aygfsteel.com/xiaohu/comments/102473.htmlhttp://www.aygfsteel.com/xiaohu/archive/2007/03/07/102473.html#Feedback0http://www.aygfsteel.com/xiaohu/comments/commentRss/102473.htmlhttp://www.aygfsteel.com/xiaohu/services/trackbacks/102473.html ActionForward?execute(....){
????try?{
????????????response.setContentType("text/html;charset=UTF-8");
????????????response.getWriter().write(text);
????}?catch?(IOException?e)?{
????????????log.error(e);
????}
????return?null;
}



]]>
不在struts-config.xml配置jsp路徑,直接在代碼里跳轉(zhuǎn)http://www.aygfsteel.com/xiaohu/archive/2007/03/07/102472.html小虎(年輕)小虎(年輕)Wed, 07 Mar 2007 13:33:00 GMThttp://www.aygfsteel.com/xiaohu/archive/2007/03/07/102472.htmlhttp://www.aygfsteel.com/xiaohu/comments/102472.htmlhttp://www.aygfsteel.com/xiaohu/archive/2007/03/07/102472.html#Feedback0http://www.aygfsteel.com/xiaohu/comments/commentRss/102472.htmlhttp://www.aygfsteel.com/xiaohu/services/trackbacks/102472.html ?return?new?ActionForward("/foo/bar.jsp");
?????????????????? or
?return?new?ActionForward("/foo/bar.jsp",true);



]]>
No FormBeanhttp://www.aygfsteel.com/xiaohu/archive/2007/03/07/102471.html小虎(年輕)小虎(年輕)Wed, 07 Mar 2007 13:32:00 GMThttp://www.aygfsteel.com/xiaohu/archive/2007/03/07/102471.htmlhttp://www.aygfsteel.com/xiaohu/comments/102471.htmlhttp://www.aygfsteel.com/xiaohu/archive/2007/03/07/102471.html#Feedback0http://www.aygfsteel.com/xiaohu/comments/commentRss/102471.htmlhttp://www.aygfsteel.com/xiaohu/services/trackbacks/102471.html ??? Struts 1.2.7 之后一共有三種方法,不需要定義FormBean Java類也不需要在struts-config.xml里詳細(xì)定義formBean的每個屬性。


???
第一種 appfuse里使用的,定義DynaValidatorForm里,內(nèi)嵌一個pojo屬性.

<form-bean?name="userForm"?type="org.apache.struts.validator.DynaValidatorForm">
????????????<form-property?name="user"?type="org.appfuse.model.User"/>
form-bean>

?


//
取得 form?DynaActionForm?userForm?=?(DynaActionForm)?form;
User?user?=?(User)?userForm.get("user");
//
設(shè)置
form
userForm.set("user",user);

???
??? 第二種是用BeanValidatorForm,直接把PojoFormBean,無需繼承于FormBean接口。

?<form-bean?name="userForm"?type="org.springside.helloworld.domain.User"/>

?

// 取得 form?Bean
ValidatorForm?userForm?=?(BeanValidatorForm)?form;User?user?=?(User)?userForm.getInstance();
//
設(shè)置
form
BeanUtils.copyProperties(userForm,?user);



]]>
struts-config.xml使用通配符http://www.aygfsteel.com/xiaohu/archive/2007/03/07/102470.html小虎(年輕)小虎(年輕)Wed, 07 Mar 2007 13:29:00 GMThttp://www.aygfsteel.com/xiaohu/archive/2007/03/07/102470.htmlhttp://www.aygfsteel.com/xiaohu/comments/102470.htmlhttp://www.aygfsteel.com/xiaohu/archive/2007/03/07/102470.html#Feedback1http://www.aygfsteel.com/xiaohu/comments/commentRss/102470.htmlhttp://www.aygfsteel.com/xiaohu/services/trackbacks/102470.html ??? 對一些CRUDAction,可以使用通配符,如果這批action里某個action某個方法還存在特殊路徑,可以在代碼里直接new ActionForward("/foo.jsp");

<action?path="/admin/*"?name="{1}Form"?parameter="method"?scope="request"?validate="false">
????????????<forward?name="list"?path="/WEB-INF/pages/admin/{1}List.jsp"/>
????????????<forward?name="edit"?path="/WEB-INF/pages/admin/{1}Form.jsp"/>
????????????<forward?name="success"?path="/admin/{1}.do?method=list"?redirect="true"/>
action>



]]>
DispatchAction用法http://www.aygfsteel.com/xiaohu/archive/2007/03/07/102371.html小虎(年輕)小虎(年輕)Wed, 07 Mar 2007 05:07:00 GMThttp://www.aygfsteel.com/xiaohu/archive/2007/03/07/102371.htmlhttp://www.aygfsteel.com/xiaohu/comments/102371.htmlhttp://www.aygfsteel.com/xiaohu/archive/2007/03/07/102371.html#Feedback0http://www.aygfsteel.com/xiaohu/comments/commentRss/102371.htmlhttp://www.aygfsteel.com/xiaohu/services/trackbacks/102371.html ?? 以一個Controller響應(yīng)一組動作絕對是Controller界的真理,StrutsDispatchAction同樣可以做到這點(diǎn)。

<action?path="/admin/user"?name="userForm"?scope="request"?parameter="method"?validate="false">
????<forward?name="list"?path="/admin/userList.jsp"/>
action>

??? 其中parameter="method" 設(shè)置了用來指定響應(yīng)方法名的url參數(shù)名為method,即/admin/user.do?method=list 將調(diào)用UserActionpublic ActionForward list(....)?函數(shù)。???

?? ?public ActionForward unspecified(....) 函數(shù)可以指定不帶method方法時的默認(rèn)方法。

]]>
主站蜘蛛池模板: 拜城县| 西乡县| 威远县| 合作市| 木兰县| 仁布县| 怀化市| 扎囊县| 南乐县| 英德市| 曲靖市| 墨竹工卡县| 普兰店市| 凤阳县| 唐河县| 资中县| 林甸县| 乃东县| 嵩明县| 策勒县| 南川市| 泾源县| 措美县| 孟州市| 无极县| 清新县| 广灵县| 翼城县| 城口县| 鄂托克旗| 印江| 富民县| 石柱| 鹤山市| 临泽县| 鄢陵县| 江北区| 定边县| 罗平县| 滦平县| 鄂尔多斯市|