锘??xml version="1.0" encoding="utf-8" standalone="yes"?>
size鏄痩ist鐨勪釜鏁?img src ="http://www.tkk7.com/peiliangye/aggbug/365370.html" width = "1" height = "1" />
]]>
瑙e喅鍔炴硶錛氬師鍥犵己灝戜簡dojo鐨凧AR鍖咃紝寮曞叆鍗沖彲:struts2-dojo-plugin-2.1.2.jar
The "head" tag renders required JavaScript code to configure Dojo and is required in order to use any of the tags included in the Dojo plugin.
--------------------
If you are planning to nest tags from the Dojo plugin, make sure you set parseContent="false", otherwise each request made by the inner tags will be performed twice.
2---:Unable to load configuration. -bean -jar:file:/F:/Struts2/Struts2/WebRoot/WEB-INF/lib/struts2-core- 2.1.2.jar!/struts-default.xml:46:178
Caused by: Unable to load bean: type:org.apache.struts2.dispatcher.multipart.MultiPartRequest class:org.apache.struts2.dispatcher.multipart.JakartaMultiPartRequest -bean -jar:file:/F:/Struts2/Struts2/WebRoot/WEB-INF/lib/struts2-core-2.1.2.jar!/struts-default.xml:46:178
Caused by: java.lang.NoClassDefFoundError: org/apache/commons/fileupload/RequestContext
瑙e喅鍔炴硶錛氱己灝慗AR鍖咃紝寮曞叆commons-fileupload-1.2.1.jar錛宑ommons-io-1.3.2.jar鍗沖彲
3---:No tag "datetimepicker" defined in tag library imported with prefix "s"
鍘熷洜鐗堟湰闂錛氱己灝憇truts-dojo-plugin JAR鍖咃紝浠ュ強(qiáng)HTML鐨?<HEAD></HEAD>涓病鏈変嬌鐢?lt;s:head/>鏍囩
If you're using Struts 2.1.x you're probablymissing the>struts-dojo-plugin. Michal's reference below applies to Struts 2.1.xonly. In the lasts versions (since 2.0.9 I guess), all AJAX are in dojo> plugin.
> > So you need toinclude <%@ taglib uri="/struts-dojo-tags" prefix="sx"%>
> > and <sx:head/>
> >( Temp1:
<sx:datetimepicker name="picker" />
Temp2:
<sx:datetimepicker type="time" name="picker" /><br/>
Temp3:
<sx:datetimepicker value="%{'2008-06-08'}" name="picker" />
Temp4:
<sx:datetimepicker value="date" name="picker" />)
> > and call :<sx:datetimepicker .../>
4---:浣跨敤TILES妗嗘灦
If you use the Tiles 2 plugin, check your tiles.xml file(s) to ensure they contain a DOCTYPE.
<!DOCTYPE tiles-definitions PUBLIC "-//Apache Software Foundation//DTD Tiles Configuration 2.0//EN" "http://tiles.apache.org/dtds/tiles-config_2_0.dtd"><tiles-definitions>
5---:struts2涓笉鏀寔EL琛ㄨ揪寮?
Struts2.1 tags do not allow evaluation of JSP EL within their attributes.Instead, Struts2 tags evaluate attribute values as OGNL. Allowing bothexpression languages within the same attribute opens major securityvulnerabilities.
6---鏂囦歡涓婁紶榪囩▼涓彇涓嶅埌鏂囦歡鍚嶅拰鏂囦歡綾誨瀷錛屽嵆閮藉彇鍒癗ULL
鍘熷洜錛氬鏋滈〉闈腑file鐨刵ame=“a”鍒欐垜浠珹CTION涓緗甋tring aContentType,String aFileName;(姝や袱涓叾瀹炴棤鎵璋擄紝鍏抽敭鏄疭ET鏂規(guī)硶)
setA(File file)(){}; setAContentType(String s){};setAFileName(String name){} 鍗蟲牸寮忓涓嬶細(xì)setXContentType() setXFileName().X浠h〃浣犵粰FILE鍙栫殑NAME鍚嶅瓧
蹇呴』鍜屽畠鐩稿悓錛屽浐瀹氭牸寮?br />
7---涓ラ噸: Unable to parse request
org.apache.commons.fileupload.FileUploadBase$SizeLimitExceededException: the request was rejected because its size (8523356) exceeds the configured maximum (2097152)
at org.apache.commons.fileupload.FileUploadBase$FileItemIteratorImpl.<init>(FileUploadBase.java:914)2008-5-27 17:46:51 com.opensymphony.xwork2.util.logging.commons.CommonsLogger warn
璀﹀憡: Could not find property [struts.valueStack]
2008-5-27 17:46:51 com.opensymphony.xwork2.util.logging.commons.CommonsLogger error
涓ラ噸: the request was rejected because its size (8523356) exceeds the configured maximum (2097152)
2008-5-27 17:46:51 com.opensymphony.xwork2.util.logging.commons.CommonsLogger warn
璀﹀憡: Could not find property [org.apache.catalina.jsp_file]
鍘熷洜錛氫笂浼犳枃浠跺ぇ灝忚秴榪囬瀹氬ぇ灝忥紝鍙互鍦╯truts.properties閰嶇疆鏂囦歡涓緗畇truts.multipart.maxSize=XXX錛圶XX涓烘枃浠跺ぇ灝忥級
8---閰嶇疆浜嗘枃浠剁被鍨嬮檺鍒跺悗錛屽綋浼犻敊璇被鍨嬪彲浠ユ嫤鎴笉璁╃敤鎴蜂笂浼犺鏂囦歡錛屽彲鏄煩杞殑欏甸潰鍗存病鏈夎煩杞埌input閰嶇疆鐨勯敊璇〉闈紝鑰屾槸榪斿洖
鍒頒簡success姝g‘欏甸潰銆?/p>
涓ラ噸: Content-Type not allowed: filedata "upload__5b01657_11a329d4dcf__8000_00000000.tmp" text/plain
銆婃垜鐨勬墦鍗拌緭鍑篋EBUG璇彞鍐呭:File:null FlieName:null type:null銆嬪嵆鎷︽埅綾誨瀷鎴愬姛浜?br />java.lang.NullPointerException
at java.io.FileInputStream.<init>(FileInputStream.java:103)
at com.study.web.util.FileUploadUtil.uploadFile(FileUploadUtil.java:36)
at com.study.web.action.UploadFileAction.execute(UploadFileAction.java:58)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)銆傘傘?/p>
2008-5-29 10:59:07 com.opensymphony.xwork2.util.logging.commons.CommonsLogger warn
璀﹀憡: Could not find property [org.apache.catalina.jsp_file]
2008-5-29 10:59:07 com.opensymphony.xwork2.util.logging.commons.CommonsLogger warn
璀﹀憡: Could not find property [struts]
2008-5-29 10:59:07 com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
淇℃伅: Removing file filedata \tmp\upload__5b01657_11a329d4dcf__8000_00000000.tmp
鍘熷洜鍙?qiáng)瑙e啗_姙娉曪細(xì)鍦ㄨ鏂囦歡涓婁紶Action涓彧閰嶇疆浜咶ileUploadInterceptor鍚庣己灝戦厤緗簡defaultStack鎷︽埅鍣?
鍦ˋCTION涓厤緗帺defaultStack鎷︽埅鍣ㄥ悗鏀歸敊璇秷澶便?br />
9---struts.properties涓叏灞閰嶇疆鏂囦歡澶у皬錛屽啀浣跨敤榛樿FileUploadInterceptor鎷︽埅鍣ㄦ椂鍊欒兘瀹炵幇鎷︽埅鐨勫姛鑳戒絾鏄悗鍙板嚭鐜板紓甯搞?/p>
涓ラ噸: Unable to parse request
org.apache.commons.fileupload.FileUploadBase$SizeLimitExceededException: the request was rejected because its size (380) exceeds the configured maximum (10)
at org.apache.commons.fileupload.FileUploadBase$FileItemIteratorImpl.<init>(FileUploadBase.java:914)
鍘熷洜錛氭湭鐭ャ傚皢鍏ㄥ眬閰嶇疆涓殑闄愬埗澶у皬鍘繪帀錛屽啀閲嶆柊鍦ˋCTION涓鐩栭厤緗瓼ileUploadInterceptor鎷︽埅鍣ㄨ緗ぇ灝忓拰鏂囦歡綾誨瀷闄愬埗錛屽彲娑堥櫎寮傚父銆?br />
10---澶氭枃浠朵笂浼犱腑錛屽叾涓竴涓紶琚檺鍒剁殑鏂囦歡濡傞檺鍒禷plication/msword(鍗?doc)鏂囦歡錛屽厑璁鎬紶鏂囨湰鏂囦歡銆傜劧鑰屽綋澶規(guī)潅鍦ㄤ竴璧蜂紶鐨勬椂鍊欙紝鍚庡彴鑳芥埅鑾風(fēng)被鍨嬮敊璇笉鍙紶淇℃伅錛屼絾鏄?/p>
瀹為檯鍗磋繕鏄笂浼犳垚鍔熴?/p>
涓ラ噸: Content-Type not allowed: filedata "upload_4d958287_11a33e76ab9__8000_00000007.tmp" application/msword
file is :\tmp\upload_4d958287_11a33e76ab9__8000_00000006.tmp fileName:project.txt fileType:text/plain
file is :\tmp\upload_4d958287_11a33e76ab9__8000_00000007.tmp fileName:application base.doc fileType:application/msword
file is :\tmp\upload_4d958287_11a33e76ab9__8000_00000008.tmp fileName:zhongqi-bug.txt fileType:text/plain
鍘熷洜錛氬繕璁頒簡緇ф壙ActionSupport綾匯傜戶鎵垮悗寮傚父娑堝け銆?br />
11--鏂囦歡涓婁紶寮傚父錛屼笉鑳藉垱寤篎ile鏂囦歡
Cannot create type class java.io.File from value C:\Documents and Settings\admin\妗岄潰\OrderReporterServiceImp.java - [unknown location]
鍘熷洜錛氬繕璁頒簡鍦╢orm琛ㄥ崟閲屽皢enctype璁劇疆鎴愭枃浠朵笂浼犳牸寮忥細(xì)enctype="multipart/form-data"
12--褰撲嬌鐢ㄩ檺鍒舵枃浠剁被鍨嬪拰澶у皬鐨勬椂鍊欐姏鍑虹┖鎸囬拡寮傚父
java.lang.NullPointerExceptiondemo.struts2.action.ValidatFileUploadAction.execute(ValidatFileUploadAction.java:71)sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)鍘熷洜錛氬湪ACTION涓厤緗簡fileUpload鎷︽埅鍣ㄥ悗蹇樿浜嗛厤緗粯璁ゆ嫤鎴櫒錛歞efautlStack銆傛敞鎰忓綋ACTION涓厤緗嚜宸辯殑鎷︽埅鍣ㄥ悗闇瑕佹樉紺洪厤緗粯璁?/p>
鎷︽埅鍣╠efaultStack
13--鍦ㄥ浗闄呭寲鏃跺欐姏絀烘寚閽堝紓甯革細(xì)
16:31:12,812 ERROR [jsp]:253 - Servlet.service() for servlet jsp threw exception
java.lang.NullPointerException at java.text.MessageFormat.applyPattern(MessageFormat.java:414)
at java.text.MessageFormat.<init>(MessageFormat.java:350)
at com.opensymphony.xwork2.DefaultTextProvider.getText(DefaultTextProvider.java:70)
鍘熷洜錛氬繕璁頒簡鍦╯truts.xml涓厤緗浗闄呭寲甯擱噺錛屾垨鑰呭湪struts.properties涓厤緗叏灞鍥介檯鍖栧父閲?struts.custom.i18n.resources=globeMessage
14-- struts action鐨勯厤緗枃浠跺姞杞藉け璐ワ細(xì)
Unable to load configuration. - result - file:/D:/Java/apache-tomcat-5.5.20/webapps/mysts/WEB-INF/classes/test.xml:10:26
Caused by: No result type specified for result named 'error', perhaps the parent package does not specify the result type? - result - file:/D:/Java/apache-tomcat-5.5.20/webapps/mysts/WEB-INF/classes/test.xml:10:26
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.buildResults(XmlConfigurationProvider.java:609)
鍘熷洜錛氬繕璁頒簡緇ф壙鍖卻truts-default
15-- struts action 閰嶇疆鏂囦歡娉ㄦ剰浜嬮」錛?/p>
1. 鍒繕璁頒簡緇ф壙struts-default榛樿閰嶇疆鍖?/p>
2.濡傛灉閰嶇疆鍛藉悕絀洪棿錛屼竴瀹氳浠?/"寮濮嬶紝渚嬪錛歯amespace="/test"
3.姣忎釜妯″潡struts action閰嶇疆鏂囦歡涓兘鍙互閰嶇疆鍏ㄥ眬result錛実lobal-result 緇忔祴璇曚笉浼?xì)鍐步H侊紝STRTUS浼?xì)鏅鸿兘瀵绘壘璇ction璇鋒眰鐨?/p>
妯″潡STRUTS ACTION閰嶇疆鍖?/p>
鍏抽敭瀛? 璀﹀憡: no configuration found for the specified action
璀﹀憡: No configuration found for the specified action: 'ShowMessage' in namespace: ''. Form action defaulting to 'action' attribute's literal value.
瑙e喅鏂規(guī)硶錛?/p>
緇忚繃嫻嬭瘯鍙戠幇錛屾槸娌℃湁姝g‘浣跨敤tag鐨勫師鍥狅紝榪欑鎯呭喌涓嬶紝姝g‘鐨勫啓娉曞簲璇ユ槸錛?lt;s:form name="login" method="post" action="login" >
鎮(zhèn)ㄦ槸鍚︽坊鍔犱簡action榪欎釜鍛紵
鎵撳紑Tomcat涓婚〉http://tomcat.apache.org/錛屼笅杞絋omcat鍏嶅畨瑁呯増錛屾垜榪欓噷涓嬭澆鐨勬槸apache-tomcat-7.0.2.tar.gz銆?/p>
浜屻侀厤緗甁ava鐜鍙橀噺
Java鐨勭幆澧冨彉閲忓凡緇忓湪鍓嶅嚑綃囨枃绔犻噷鏈変簡姒傝堪錛岃緇嗚錛?a >http://www.fengwenxuan.com/index.php/red-hat-enterprise-linux/238.html
涓夈佽В鍘婽omcat
灝員omcat瑙e帇緙╁埌/usr/local鐩綍涓?/p>
# tar zxvf apache-tomcat-7.0.2.tar.gz
鍥涖佸惎鍔═omcat
# cd /usr/local/apache-tomcat-7.0.2/bin
# ./startup.sh
濡傛灉鍚姩鎴愬姛錛宻hell緇堢浼?xì)鍑虹幇濡備笅鎻惤C猴細(xì)
Using CATALINA_BASE: /usr/local/apache-tomcat-7.0.2
Using CATALINA_HOME: /usr/local/apache-tomcat-7.0.2
Using CATALINA_TMPDIR: /usr/local/apache-tomcat-7.0.2/temp
Using JRE_HOME: /usr/local/jdk1.6.0_21
濡傛灉緇堢鎶ラ敊錛屽熀鏈笂鍙互鑲畾鏄疛dk鐜鍙橀噺娌℃湁閰嶇疆濂斤紝浠旂粏鍦ㄦ鏌ヤ竴涓婮dk鐜鍙橀噺鐨勯厤緗?/p>
浜斻佹祴璇昑omcat
鎵撳紑鐏嫄嫻忚鍣紝鍦板潃鏍忚緭鍏ttp://localhost:8080錛屽洖杞﹀悗鐪嬪埌Tomcat鐨凩OGO錛岃〃紺轟竴鍒囨甯搞備篃鍙互鏇存敼Tomcat鐩綍涓嬬殑conf鏂囦歡澶癸紝閲岄潰鏈変竴涓猻erver.xml鏂囦歡錛屼慨鏀規(guī)垚浣跨敤80绔彛錛岃繖鏍鋒祻瑙堝櫒鍙杈撳叆http://localhost/灝卞彲浠ョ洿鎺ヨ繘鍏ヤ綘鐨勪富欏典簡銆?/p>
鍏佸仠姝omcat
# cd /usr/local/apache-tomcat-7.0.2/bin
# ./shutdown.sh
涓冦佽緗紑鏈鴻嚜鍔ㄥ惎鍔═omcat
鏂規(guī)硶涓錛?/p>
鍦?usr/local/apache-tomcat-7.0.2/bin/startup.sh 涓?
JAVA_HOME=/home/fwx/jdk1.6.0_14
CLASSPATH=.:$JAVA_HOME/lib/tools.jar
PATH=$JAVA_HOME/bin:$PATH
export JAVA_HOME CLASSPATH PATH
export CATALINA_HOME=/usr/local/apache-tomcat-7.0.2
/usr/local/tomcat/bin/catalina.sh start
鍦?etc/rc.d/rc.local涓姞鍏?
/usr/local/apache-tomcat-7.0.2/bin/startup.sh
鏂規(guī)硶浜岋細(xì)
1銆佹妸涓嬮潰鐨勪唬鐮佷繚瀛樹負(fù)tomcat鏂囦歡錛屽茍璁╁畠鎴愪負(fù)鍙墽琛屾枃浠?chmod 755 tomcat.
#!/bin/bash
#
# fengwx0413@163.com
# /etc/rc.d/init.d/tomcat
# init script for tomcat precesses
#
# processname: tomcat
# description: tomcat is a j2se server
# chkconfig: 2345 86 16
# description: Start up the Tomcat servlet engine.
if [ -f /etc/init.d/functions ]; then
. /etc/init.d/functions
elif [ -f /etc/rc.d/init.d/functions ]; then
. /etc/rc.d/init.d/functions
else
echo -e "/atomcat: unable to locate functions lib. Cannot continue."
exit -1
fi
RETVAL=$?
CATALINA_HOME="/usr/local/apache-tomcat-7.0.2"
case "$1" in
start)
if [ -f $CATALINA_HOME/bin/startup.sh ];
then
echo $"Starting Tomcat"
$CATALINA_HOME/bin/startup.sh
fi
;;
stop)
if [ -f $CATALINA_HOME/bin/shutdown.sh ];
then
echo $"Stopping Tomcat"
$CATALINA_HOME/bin/shutdown.sh
fi
;;
*)
echo $"Usage: $0 {start|stop}"
exit 1
;;
esac
exit $RETVAL
2銆佸皢tomcat鏂囦歡鎷瘋礉鍒?etc/init.d/涓嬶紝騫惰繍琛岋細(xì)chkconfig --add tomcat
3銆佸湪apache-tomcat-7.0.2/bin/catalina.sh鏂囦歡涓姞鍏ヤ互涓嬭鍙ワ細(xì)
export JAVA_HOME=/home/fwx/jdk1.6.0_14
export CATALINA_HOME=/usr/local/apache-tomcat-7.0.2
export CATALINA_BASE=/usr/local/apache-tomcat-7.0.2
export CATALINA_TMPDIR=/usr/local/apache-tomcat-7.0.2/temp
鍚姩tomcat錛?service tomcat start
鍋滄tomcat: service tomcat stop銆
import java.io.IOException;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
public class CharacterEncodingFilter implements Filter{
private FilterConfig config;
private String encoding;
private boolean enable;
public void destroy() {
}
public void doFilter(ServletRequest request, ServletResponse response,
FilterChain filterChain) throws IOException, ServletException {
if(this.enable){
request.setCharacterEncoding(encoding);
response.setCharacterEncoding(encoding);
}
filterChain.doFilter(request, response);
}
public void init (FilterConfig config ) throws ServletException {
this.config = config;
loadConfigParams();
}
private void loadConfigParams() {
this.encoding= this.config.getInitParameter("enconding");
String flag = this.config.getInitParameter("enable");
if(flag.equalsIgnoreCase("true")){
this.enable = true;
}else{
this.enable = false;
}
}
}
web.xml
<filter>
<filter-name>encondingFilter</filter-name>
<filter-class>com.morning.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>enconding</param-name>
<param-value>utf-8</param-value>
</init-param>
<init-param>
<param-name>enable</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>encondingFilter</filter-name>
<url-pattern>*.do</url-pattern>
</filter-mapping>