- - PR -
助けてください。JSTL タグの choose だけがうまくいきません
| 投稿者 | 投稿内容 | ||||
|---|---|---|---|---|---|
|
投稿日時: 2004-09-15 22:10
Apache: 2.0.49
Tomcat: 5.0.27 j2sdk: 1.4.2_05 jakarta-taglibs-string-1.1.0 jakarta-taglibs/commons-lang-2.0 =============================================================================== <c:catch>...</c:catch>を付加した場合のソースはこちら(http://www.atmarkit.co.jp/bbs/phpBB/viewtopic.php?topic=14789&forum=12&11)にあります。 よろしくお願いします。 * usrSubmit_jsp.java * ============================================================================================ package org.apache.jsp.jsp; import javax.servlet.*; import javax.servlet.http.*; import javax.servlet.jsp.*; public final class usrSubmit_jsp extends org.apache.jasper.runtime.HttpJspBase implements org.apache.jasper.runtime.JspSourceDependent { private static java.util.Vector _jspx_dependants; private org.apache.jasper.runtime.TagHandlerPool _jspx_tagPool_c_set_var_value_nobody; private org.apache.jasper.runtime.TagHandlerPool _jspx_tagPool_c_out_value_nobody; private org.apache.jasper.runtime.TagHandlerPool _jspx_tagPool_c_choose; private org.apache.jasper.runtime.TagHandlerPool _jspx_tagPool_c_when_test; private org.apache.jasper.runtime.TagHandlerPool _jspx_tagPool_c_otherwise; public java.util.List getDependants() { return _jspx_dependants; } public void _jspInit() { _jspx_tagPool_c_set_var_value_nobody = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig()); _jspx_tagPool_c_out_value_nobody = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig()); _jspx_tagPool_c_choose = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig()); _jspx_tagPool_c_when_test = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig()); _jspx_tagPool_c_otherwise = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig()); } public void _jspDestroy() { _jspx_tagPool_c_set_var_value_nobody.release(); _jspx_tagPool_c_out_value_nobody.release(); _jspx_tagPool_c_choose.release(); _jspx_tagPool_c_when_test.release(); _jspx_tagPool_c_otherwise.release(); } public void _jspService(HttpServletRequest request, HttpServletResponse response) throws java.io.IOException, ServletException { JspFactory _jspxFactory = null; PageContext pageContext = null; HttpSession session = null; ServletContext application = null; ServletConfig config = null; JspWriter out = null; Object page = this; JspWriter _jspx_out = null; PageContext _jspx_page_context = null; try { _jspxFactory = JspFactory.getDefaultFactory(); response.setContentType("text/html; charset=EUC_JP"); pageContext = _jspxFactory.getPageContext(this, request, response, null, true, 8192, true); _jspx_page_context = pageContext; application = pageContext.getServletContext(); config = pageContext.getServletConfig(); session = pageContext.getSession(); out = pageContext.getOut(); _jspx_out = out; out.write("\n"); out.write("\n"); out.write("<html>\n"); out.write("<body>\n"); if (_jspx_meth_c_set_0(_jspx_page_context)) return; out.write('\n'); if (_jspx_meth_c_out_0(_jspx_page_context)) return; out.write('\n'); out.write("\n"); out.write(" "); if (_jspx_meth_c_when_0(_jspx_page_context)) return; out.write("\n"); out.write(" "); if (_jspx_meth_c_when_1(_jspx_page_context)) return; out.write("\n"); out.write(" "); } else { out.write("\n"); out.write(" test3\n"); out.write(" "); out.write('\n'); } out.write("\n"); out.write("</body>\n"); out.write("</html>\n"); } catch (Throwable t) { if (!(t instanceof SkipPageException)){ out = _jspx_out; if (out != null && out.getBufferSize() != 0) out.clearBuffer(); if (_jspx_page_context != null) _jspx_page_context.handlePageException(t); } } finally { if (_jspxFactory != null) _jspxFactory.releasePageContext(_jspx_page_context); } } private boolean _jspx_meth_c_set_0(PageContext _jspx_page_context) throws Throwable { PageContext pageContext = _jspx_page_context; JspWriter out = _jspx_page_context.getOut(); // c:set org.apache.taglibs.standard.tag.el.core.SetTag _jspx_th_c_set_0 = (org.apache.taglibs.standard.tag.el.core.SetTag) _jspx_tagPool_c_set_var_value_nobody.get(org.apache.taglibs.standard.tag.el.core.SetTag.class); _jspx_th_c_set_0.setPageContext(_jspx_page_context); _jspx_th_c_set_0.setParent(null); _jspx_th_c_set_0.setVar("val"); _jspx_th_c_set_0.setValue("90"); int _jspx_eval_c_set_0 = _jspx_th_c_set_0.doStartTag(); if (_jspx_th_c_set_0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) return true; _jspx_tagPool_c_set_var_value_nobody.reuse(_jspx_th_c_set_0); return false; } private boolean _jspx_meth_c_out_0(PageContext _jspx_page_context) throws Throwable { PageContext pageContext = _jspx_page_context; JspWriter out = _jspx_page_context.getOut(); // c:out org.apache.taglibs.standard.tag.el.core.OutTag _jspx_th_c_out_0 = (org.apache.taglibs.standard.tag.el.core.OutTag) _jspx_tagPool_c_out_value_nobody.get(org.apache.taglibs.standard.tag.el.core.OutTag.class); _jspx_th_c_out_0.setPageContext(_jspx_page_context); _jspx_th_c_out_0.setParent(null); _jspx_th_c_out_0.setValue("${val}"); int _jspx_eval_c_out_0 = _jspx_th_c_out_0.doStartTag(); if (_jspx_th_c_out_0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) return true; _jspx_tagPool_c_out_value_nobody.reuse(_jspx_th_c_out_0); return false; } private boolean _jspx_meth_c_when_0(PageContext _jspx_page_context) throws Throwable { PageContext pageContext = _jspx_page_context; JspWriter out = _jspx_page_context.getOut(); // c:when org.apache.taglibs.standard.tag.el.core.WhenTag _jspx_th_c_when_0 = (org.apache.taglibs.standard.tag.el.core.WhenTag) _jspx_tagPool_c_when_test.get(org.apache.taglibs.standard.tag.el.core.WhenTag.class); _jspx_th_c_when_0.setPageContext(_jspx_page_context); _jspx_th_c_when_0.setParent(null); _jspx_th_c_when_0.setTest("${val >= 80}"); int _jspx_eval_c_when_0 = _jspx_th_c_when_0.doStartTag(); if (_jspx_eval_c_when_0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) { do { out.write("\n"); out.write(" test1\n"); out.write(" "); int evalDoAfterBody = _jspx_th_c_when_0.doAfterBody(); if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN) break; } while (true); } if (_jspx_th_c_when_0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) return true; _jspx_tagPool_c_when_test.reuse(_jspx_th_c_when_0); return false; } private boolean _jspx_meth_c_when_1(PageContext _jspx_page_context) throws Throwable { PageContext pageContext = _jspx_page_context; JspWriter out = _jspx_page_context.getOut(); // c:when org.apache.taglibs.standard.tag.el.core.WhenTag _jspx_th_c_when_1 = (org.apache.taglibs.standard.tag.el.core.WhenTag) _jspx_tagPool_c_when_test.get(org.apache.taglibs.standard.tag.el.core.WhenTag.class); _jspx_th_c_when_1.setPageContext(_jspx_page_context); _jspx_th_c_when_1.setParent(null); _jspx_th_c_when_1.setTest("${val >= 50 and val < 80}"); int _jspx_eval_c_when_1 = _jspx_th_c_when_1.doStartTag(); if (_jspx_eval_c_when_1 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) { do { out.write("\n"); out.write(" test2\n"); out.write(" "); int evalDoAfterBody = _jspx_th_c_when_1.doAfterBody(); if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN) break; } while (true); } if (_jspx_th_c_when_1.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) return true; _jspx_tagPool_c_when_test.reuse(_jspx_th_c_when_1); return false; } } | ||||
|
投稿日時: 2004-09-16 14:02
要するに、この部分がおかしいようですね。else文に対応するif文がないので、コンパイル エラーになっています。こちらの環境で出力したソースにはelse文がありません。 #Linux環境ではないのですが、OSに依存する部分ではないと思います そうするとやはりタグライブラリが怪しいのですが、書かれている環境にはJSTLのライブラリ が何かが書いてないので、最新のライブラリを持ってきて再インストールしてみてはどうで しょうか。 | ||||
|
投稿日時: 2004-09-17 05:01
そうですか。こちら(http://www.atmarkit.co.jp/bbs/phpBB/viewtopic.php?topic=14789&forum=12&11)と同じ現象なのですね。
よし、スッパリと最新のライブラリをインストールします。 御迷惑をお掛けして申し訳ございませんでした。本当に有難うございます。 | ||||
|
投稿日時: 2004-09-20 18:55
今日、改めて最新のライブラリを再インストールしました。でも、以前と同じ結果になりってしまいました。 済みません、OS:Fedora2 で、<c:choose>を使用されている方はいらっしゃいませんか? よろしくお願いします。 | ||||
