“The code of method _jspService(HttpServletRequest, HttpServletResponse) is exceeding the 65535 bytes limit” 的我之解決辦法

來源:互聯網
上載者:User

標籤:blog   http   java   檔案   for   art   ar   問題   

“The code of method _jspService(HttpServletRequest, HttpServletResponse) is exceeding the 65535 bytes limit” 的我之解決辦法 - 兔子吃南瓜 - 部落格頻道 - CSDN.NET http://blog.csdn.net/rabbiteatpumpkin/article/details/4743104

 

昨天,我遇到了一個讓我很頭疼的問題。 我做了一個共通的jsp,單只測它是ok的,可是,放在別的jsp中include它,就會報錯如標題所示:The code of method _jspService(HttpServletRequest, HttpServletResponse) is exceeding the 65535 bytes limit。調用它的jsp是這樣寫的:< %@include file="/模組名/nani_include.jsp" % > 。於是我將這個include語句換成了<jsp:include flush="true" page="/模組名/nani_include.jsp"/>。不再 報錯了。因為  <%@ include file=" "%>標籤 是在jsp容器裡將jsp檔案翻譯成servlet檔案,並編譯它時,是靜態包含被包含jsp的,也就是編譯出來是一個類檔案,而java類檔案是不允許超過65k這麼大的,所以會報錯如標題所示。而<jsp:include flush="true" page=" "/>在翻譯並編譯後,產生的是兩個類檔案,也就是說 被調用的jsp產生獨立的類檔案,而調用它的jsp產生的類檔案中,只包含一個調用jsp的方法。

可是問題又出現了。參數傳不進去。

解決方案是:調用它的jsp用<jsp:param>傳參。

   <jsp:include flush="true" page="/模組名/nani_include.jsp">
      <jsp:param name="ss"value="_programForm"/>  
   </jsp:include>

被調用的jsp中,用el運算式接這個參數就好了:

${ss}

${param.weight}

(不管裡面用什麼標籤,name設成“ss”就好了)

 

希望有解決不了問題的人可以看到 呵呵

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.