Topic: 关于javabean的问题? |
Print this page |
1.关于javabean的问题? | Copy to clipboard |
Posted by: asdlcj Posted on: 2003-08-29 10:36 <HTML> <HEAD> <TITLE>用户登陆窗口</TITLE> </HEAD> <BODY> <%@ page errorPage="ErrPage.jsp" contentType="text/html;charset=gb2312" import="java.sql.*;" %> <jsp:useBean id="lionSession" scope="session" class="lion.LionBean"/> <jsp:useBean id="lionApplication" scope="session" class="lion.LionBean"/> <% String rsPassword; String account=request.getParameter("account"); String password=request.getParameter("password"); try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection("jdbc:odbc:jspdb"," "," "); Statement stmt=con.createStatement(); ResultSet rs=stmt.executeQuery( "SELECT * FROM acctTab WHERE account='"+account+"'"); rs.next(); rsPassword=rs.getString("password"); rs.close(); con.close(); if(password.equals(rsPassword)) { lionSession.setLoginFlag(true); lionApplication.intcCount(); response.sendRedirect("/examples/index.jsp"); } else response.sendRedirect("/examples/upload.jsp"); } catch(Exception e) { out.println(e.getMessage()); } %> </BODY> </HTML> 我这个jsp在单独tomcat下运行没错误 但是在jbuilder下编译同不过 提示"LoginIn.jsp": Error #: 202 : 'class' or 'interface' expected 怎么回事啊?谢谢! |
2.Re:关于javabean的问题? [Re: asdlcj] | Copy to clipboard |
Posted by: jsmile Posted on: 2003-08-30 01:29 Did you create a web application and place the jsp file there? Seems JBuilder treats this as a regular java file (interface or class). |
3.Re:关于javabean的问题? [Re: asdlcj] | Copy to clipboard |
Posted by: asdlcj Posted on: 2003-08-30 12:35 是的, 但是同样我建立一个用到javabean的jsp页面 却没有问题! 这又怎么解释啊? |
4.Re:关于javabean的问题? [Re: asdlcj] | Copy to clipboard |
Posted by: jsmile Posted on: 2003-08-30 23:16 I don't know exactly what went wrong. It has something to do with the environment. It took me a while to configure my JBuilder correctly working with external Tomcat and CVS stuff. If I were you, I would create a JSP using JBuilder with the same name (LoginIn.jsp) and copy the entire content and paste there to give it a try. If this works (I am sure it will), you have to fight with your JBuilder settings. I test the same thing as above - create a LoginIn.jsp, copy your content and a dummy lion.LionBean file with only intcCount() method and loginFlag property. JBuilder had no complaint of making it. Good luck. |
5.Re:关于javabean的问题? [Re: asdlcj] | Copy to clipboard |
Posted by: asdlcj Posted on: 2003-08-31 23:06 thank you very much I will to try to do it ! |
Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1 客服电话 18559299278 客服信箱 714923@qq.com 客服QQ 714923 |