標籤: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”就好了)
希望有解決不了問題的人可以看到 呵呵