re: parameters in java

2001-04-17 Thread Azhar Khan

I am trying to pass parameters to an applet via a .html file
So here's my html code

APPLET
  CODE = "orgchart2.labels"
  CODEBASE = "javaclasses"
  WIDTH = "600"
  HEIGHT = "600"
  
  PARAM NAME = "top_panel_size" VALUE = "3" 
  PARAM NAME = "top_panel_elements_0" VALUE = "one" 
  PARAM NAME = "top_panel_elements_1" VALUE = "two" 
  PARAM NAME = "top_panel_elements_2" VALUE = "three" 
/APPLET

And in my .java file for applet i'm trying to retrieve these parameters.  I
can however, retrieve all the values but when i try to retrieve the value
for "top_panel_size" i am getting this error

java.lang.NumberFormatException: null
at java.lang.Integer.parseInt(Integer.java:373)
at java.lang.Integer.parseInt(Integer.java:454)
at orgchart2.labels.init(labels.java:28)
at sun.applet.AppletPanel.run(AppletPanel.java:344)
at java.lang.Thread.run(Thread.java:484)
***MY .JAVA FILE
CODE

int size = Integer.parseInt(getParameter("top_panel_size"));


Thanks.

-- Azhar Khan


Software Development Engineer
Intranet Technologies, Amazon.com
206-266-1188
http://www.amazon.com




RE: ResultSet not found

2001-04-17 Thread Azhar Khan

You should use the statement object instead of connection object to call the
method executeQuery

Statement stmt = connection.createStatement();
stmt.executeQuery(sql);

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of
Shun-Luoi Daniel Fong
Sent: Tuesday, April 17, 2001 2:49 PM
To: [EMAIL PROTECTED]
Subject: ResultSet not found


I'm using a JavaBean to communicate with a mysql database.
Here's what I do:

1. login.jsp -- user enters ID and password; also when this page is
loaded the ConnectionBean is declared with scope="session"

2. when the user hits "submit", the form sends the data to checklogin.jsp
where the submitted data is checked against the database.

I'm getting an error though at checklogin.jsp

***

Error: 500

Location: /gamezone/checklogin.jsp

Internal Servlet Error:

org.apache.jasper.JasperException: Unable to compile class for
JSP/usr/java/jakarta-tomcat-3.2.1/work/localhost_8080%2Fgamezone/_0002fcheck
login_0002ejspchecklogin_jsp_0.java:91: Class
ResultSet not found.
ResultSet results = connection.executeQuery(sql);
^
1 error

at org.apache.jasper.compiler.Compiler.compile(Compiler.java:254)
at
org.apache.jasper.servlet.JspServlet.doLoadJSP(JspServlet.java:462)
at
org.apache.jasper.servlet.JasperLoader12.loadJSP(JasperLoader12.java:146)
at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:433)
at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspSe
rvlet.java:152)
at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.ja
va:164)
at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:318)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:391)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
at org.apache.tomcat.core.Handler.service(Handler.java:286)
at
org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
at
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:79
7)
at
org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
at
org.apache.tomcat.service.connector.Ajp13ConnectionHandler.processConnection
(Ajp13ConnectionHandler.java:160)
at
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
at java.lang.Thread.run(Thread.java:484)



Here is the code I have in checklogin.jsp

*

jsp:directive.page import="java.sql.*,java.sql.ResultSet"
errorPage="error.jsp" /
jsp:useBean id="connection" class="ConnectionBean" scope="session" /

%
String p_ID = request.getParameter("player_id");
String p_passwd = request.getParameter("player_passwd");
connection.setAutoCommit(false);
String sql;
sql = "SELECT player_id, player_passwd FROM player WHERE player_id=" + p_ID
+ " AND player_passwd=" + p_passwd;
ResultSet results = connection.executeQuery(sql);

if( results.next() ) { %
   % /* ID and password correct, forward to main page */ %
   jsp:forward page="index.jsp" /
% } else { %
   % /* ID and password incorrect, forward to login.jsp to reenter login
info */ %
   jsp:forward page="login.jsp" /
% } %

**
Is there an obvious(or not so obvious) reason why the jsp can't find the
ResultSet class?

Thanks,
Luoi

btw. I'm using Tomcat 3.2.1/linux/apache
 my jsp's are located in /home/httpd/html/gamezone rather than
 $TOMCAT_HOME/webapps/


--
D. Shun-Luoi Fong
821 Melrose Avenue
Iowa City, IA 52246
email: [EMAIL PROTECTED]

---
Colossions 2:8 See to it that no one takes you captive through philosophy
or empty deception, according to the traditions of men, according to the
elementary principles of the world, rather than according to Christ.
---




RE: Configuration Problems

2001-03-30 Thread Azhar Khan

you should first set your class path variables. Follow the guidelines on the
link.

http://jakarta.apache.org/tomcat/jakarta-tomcat/src/doc/uguide/tomcat_ug.htm
l

-Original Message-
From: seshadri ramaswamy [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 30, 2001 9:55 PM
To: [EMAIL PROTECTED]
Subject: Configuration Problems


dear friends,

I am working in windows 98 Platform. I have downloaded
the jakarta-tomcat-3.2.1.zip file from the below link:
http://jakarta.apache.org/builds/jakarta-tomcat/release/v3.2.1/bin/

after unzipping to a directory named TOMCAT i am not
able to run the startup.bat.  It is giving a the
following error.

"Out of environment space".
"Unable to locate servlet.jar. Check your TOMCAT_HOME
variable.

We are not able to set the TOMCAT_HOME path.

Please do help me.

Waiting for the reply.

Seshadri

__
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail.
http://personal.mail.yahoo.com/?.refer=text




re: first day with tomcat

2001-03-15 Thread Azhar Khan

I have installed tomcat on my machine.  And i run the startup.bat file when
I wan't to run Tomcat.  But, I was wondering if i can go ahead and write jsp
/ servlets. Also, if i do how do i check them on my computer.  And what will
be the address C:\...\HelloWorld.java or http://localhost...



Thanks.

-- Azhar Khan


Software Development Engineer
Intranet Technologies, Amazon.com
206-266-1188
http://www.amazon.com