<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    posts - 64,  comments - 9,  trackbacks - 0

    1---:java.lang.NoClassDefFoundError: org/apache/struts2/dojo/views/jsp/ui/HeadTag

    解決辦法:原因缺少了dojo的JAR包,引入即可: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 
           解決辦法:缺少JAR包,引入commons-fileupload-1.2.1.jar,commons-io-1.3.2.jar即可

     

    3---:No tag "datetimepicker" defined in tag library imported with prefix "s"

           原因版本問(wèn)題:缺少struts-dojo-plugin JAR包,以及HTML的,<HEAD></HEAD>中沒(méi)有使用<s:head/>標(biāo)簽

             If you're using Struts 2.1.x you're probably missing the> struts-dojo-plugin.  Michaël'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 to include <%@ 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表達(dá)式 Convert EL expressions to OGNL  
        Struts2.1 tags do not allow evaluation of JSP EL within their attributes.
        Instead, Struts2 tags evaluate attribute values as OGNL. Allowing both
        expression languages within the same attribute opens major security
        vulnerabilities. 
    6---文件上傳過(guò)程中取不到文件名和文件類型,即都取到NULL
        原因:如果頁(yè)面中file的name=“a”則我們ACTION中設(shè)置String aContentType,String aFileName;(此兩個(gè)其實(shí)無(wú)所謂,關(guān)鍵是SET方法)
        setA(File file)(){}; setAContentType(String s){};setAFileName(String name){} 即格式如下:setXContentType() setXFileName().X代表你給FILE取的NAME名字
        必須和它相同,固定格式
    7---嚴(yán)重: 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
        嚴(yán)重: 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]
     原因:上傳文件大小超過(guò)預(yù)定大小,可以在struts.properties配置文件中設(shè)置struts.multipart.maxSize=XXX(XXX為文件大?。?/pre>
    
     8---配置了文件類型限制后,當(dāng)傳錯(cuò)誤類型可以攔截不讓用戶上傳該文件,可是跳轉(zhuǎn)的頁(yè)面卻沒(méi)有跳轉(zhuǎn)到input配置的錯(cuò)誤頁(yè)面,而是返回
        到了success正確頁(yè)面。
        嚴(yán)重: Content-Type not allowed: filedata "upload__5b01657_11a329d4dcf__8000_00000000.tmp" text/plain
        《我的打印輸出DEBUG語(yǔ)句內(nèi)容:File:null  FlieName:null      type:null》即攔截類型成功了
        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)。。。
        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
        原因及解決辦法:在該文件上傳Action中只配置了FileUploadInterceptor后缺少配置了defaultStack攔截器.
        在ACTION中配置玩defaultStack攔截器后改錯(cuò)誤消失。
    9---struts.properties中全局配置文件大小,再使用默認(rèn)FileUploadInterceptor攔截器時(shí)候能實(shí)現(xiàn)攔截的功能但是后臺(tái)出現(xiàn)異常。
        嚴(yán)重: 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)
    原因:未知。將全局配置中的限制大小去掉,再重新在ACTION中覆蓋配置FileUploadInterceptor攔截器設(shè)置大小和文件類型限制,可消除異常。
    10---多文件上傳中,其中一個(gè)傳被限制的文件如限制aplication/msword(即.doc)文件,允許傳文本文件。然而當(dāng)夾雜在一起傳的時(shí)候,后臺(tái)能截獲類型錯(cuò)誤不可傳信息,但是
        實(shí)際卻還是上傳成功。
    嚴(yán)重: 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類。繼承后異常消失。
    11--文件上傳異常,不能創(chuàng)建File文件
        Cannot create type class java.io.File from value C:\Documents and Settings\admin\桌面\OrderReporterServiceImp.java - [unknown location]
        原因:忘記了在form表單里將enctype設(shè)置成文件上傳格式:enctype="multipart/form-data"
    12--當(dāng)使用限制文件類型和大小的時(shí)候拋出空指針異常
        java.lang.NullPointerException
    demo.struts2.action.ValidatFileUploadAction.execute(ValidatFileUploadAction.java:71)
    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        原因:在ACTION中配置了fileUpload攔截器后忘記了配置默認(rèn)攔截器:defautlStack。注意當(dāng)ACTION中配置自己的攔截器后需要顯示配置默認(rèn)
            攔截器defaultStack
    13--在國(guó)際化時(shí)候拋空指針異常:
    

         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)

         

         原因:忘記了在struts.xml中配置國(guó)際化常量,或者在struts.properties中配置全局國(guó)際化常量 struts.custom.i18n.resources=globeMessage

     

    14-- struts action的配置文件加載失?。?/span>

        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)

     

         原因:忘記了繼承包struts-default

    15-- struts action 配置文件注意事項(xiàng):

         1. 別忘記了繼承struts-default默認(rèn)配置包

         2.如果配置命名空間,一定要以"/"開(kāi)始,例如:namespace="/test"

         3.每個(gè)模塊struts action配置文件中都可以配置全局result,global-result 經(jīng)測(cè)試不會(huì)沖突,STRTUS會(huì)智能尋找該Action請(qǐng)求的

           模塊STRUTS ACTION配置包

    關(guān)鍵字: 警告: 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.
     

    解決方法:

    經(jīng)過(guò)測(cè)試發(fā)現(xiàn),是沒(méi)有正確使用tag的原因,這種情況下,正確的寫(xiě)法應(yīng)該是,<s:form name="login" method="post" action="login" >
    您是否添加了action這個(gè)呢?

    posted on 2009-10-13 14:57 super_nini 閱讀(5436) 評(píng)論(0)  編輯  收藏

    只有注冊(cè)用戶登錄后才能發(fā)表評(píng)論。


    網(wǎng)站導(dǎo)航:
     
    <2009年10月>
    27282930123
    45678910
    11121314151617
    18192021222324
    25262728293031
    1234567

    常用鏈接

    留言簿

    隨筆檔案

    文章檔案

    相冊(cè)

    搜索

    •  

    最新評(píng)論

    閱讀排行榜

    評(píng)論排行榜

    主站蜘蛛池模板: 不卡一卡二卡三亚洲| 亚洲精品高清一二区久久| 亚洲videos| 国产麻豆免费观看91| 亚洲精品久久无码| 亚洲高清无码专区视频| 久久青青草原国产精品免费| 亚洲AV无码一区二区乱孑伦AS | 亚洲高清国产拍精品26U| 免费女人高潮流视频在线观看| 永久久久免费浮力影院| 亚洲国产精品网站在线播放| 久久亚洲精品国产精品| 国产禁女女网站免费看| 91免费资源网站入口| h片在线播放免费高清| 久久精品亚洲一区二区三区浴池| 91手机看片国产永久免费| 天堂亚洲国产中文在线| 亚洲欧洲精品成人久久奇米网| 免费av一区二区三区| 日韩毛片在线免费观看| 亚洲国产成人综合| 国产亚洲精品国看不卡| 亚洲成a人片在线观看久| 麻豆成人精品国产免费| 7723日本高清完整版免费| 95老司机免费福利| 国产大片免费天天看| 一级视频免费观看| 亚洲人成网站色在线观看| 亚洲综合久久成人69| 国产亚洲欧洲Aⅴ综合一区| 亚洲av高清在线观看一区二区| 四虎永久在线精品免费一区二区| 免费播放特黄特色毛片| 亚洲成人免费电影| 最近更新免费中文字幕大全| 亚洲精品456人成在线| tom影院亚洲国产一区二区| 中文亚洲成a人片在线观看|