hi all i put it in the jsp, and here is the code generate by tomcat i did not see if there is any wrong there.
package org.apache.jsp; import javax.servlet.*; import javax.servlet.http.*; import javax.servlet.jsp.*; import java.util.*; public final class jsp1_jsp extends org.apache.jasper.runtime.HttpJspBase implements org.apache.jasper.runtime.JspSourceDependent { private static java.util.List _jspx_dependants; public Object getDependants() { return _jspx_dependants; } 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=GB2312"); 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("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("\r\n"); out.write("<html>\r\n"); out.write("<head>\r\n"); out.write("<title>\r\n"); out.write("jsp1\r\n"); out.write("</title>\r\n"); out.write("</head>\r\n"); out.write("<body bgcolor=\"#ffffff\">\r\n"); out.write("<h1>\r\n"); out.write("JBuilder Generated JSP\r\n"); List alist =new ArrayList(); alist.add(0); out.print(alist.get(0)); //Gentest gt=new Gentest(); //gt.addalist(); //gt.addlist(); out.write("\r\n"); out.write("</h1>\r\n"); out.write("<form method=\"post\" action=\"jsp1.jsp\">\r\n"); out.write("<br><br>\r\n"); out.write("<input type=\"submit\" name=\"Submit\" value=\"Submit\">\r\n"); out.write("<input type=\"reset\" value=\"Reset\">\r\n"); out.write("</form>\r\n"); out.write("</body>\r\n"); out.write("</html>\r\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); } } } On 5/21/07, Leon Rosenberg <[EMAIL PROTECTED]> wrote:
On 5/21/07, Peter <[EMAIL PROTECTED]> wrote: > hi all, > > I have come into a very wired problem. > > here it is. > my project using JBuilder 2006 and tomcat 5.5.20. > when i put a 0 into a list and get 1 as a result. > simple code for testing! > > List alist =new ArrayList(); > alist.add(0); put 0 into it > alist.get(0); get 1 as result. > > it occurs when i using JBuilder2006 to complie it and run under tomcat > 5.5.20. > i choose Jbuilder 2006 builder property: language features ( java 2 > SDK V5.0generic enable) ; target VM java 2 SDK > V5.0 and later hmm, do you use this code in a jsp? Could you possible check the source code generated by tomcat for this jsp and inspect it / send it to us? Sounds like your jsp compiler is buggy. regards Leon > > but if i choose target VM target VM java 2 SDK V1.4 and later it works > fine, put 0 get 0. > and if i donot run under the tomcat it still fine > > so i create another small project, in a jsp only doing List alist =new > ArrayList(); > alist.add(0); alist.get(0); > and it works fine as well under the same tomcat. > > > i wonder what happens here? > my project using many other jar file , i wonder if there is something > wrong there. > does anyone has a idea? > > thanks in advanced! > --------------------------------------------------------------------- To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]