XP JSP TOMCAT HELP!!!

Im having problems getting tomcat to work in IE6 in Windows XP. Following the set of instructions i have, i successfully managed to configure tamcat 3.2.3 in windows 2K and IE5.5, but now i have put XP on, i cant get it to work using the same proceedure. In 2K, when i typed http://localhost i got a tomcat page some up. in XP i just get a blank page saying "Directory Listing for:/ Tomcat Web Server v3.2.3". when ive tried out a few of the examples, i cant get them to work properly either. Is there something i should have done differently for XP/IE6 ??
Any help greatly appreciated. thanks

Type in http://localhost:8080/
Tomcat also caches webpages in the work folder. Delete this folder and restart tomcat.
Also make sure that web.xml points to the right files.
In IE, go to Tools -> Internet Options -> Click Settings and make sure that the 'Every visit to page' radio button is checked.

Similar Messages

  • How to combinate JSP+Tomcat+mysql??

    Hi,guys. My question is as the above subject.
    I have installed JDK, Tomcat, mysql, and my OS is WinXP, I am trying to develop a JSP site in my computer.
    For JDK, the commands javac, java, ...... work OK;
    For Tomcat, http://localhost:8080 works OK, meaning the cat page appears.
    For mysql, I can login, and sql statements work OK;
    And I download mysql-connector-java-3.1.8a.
    What I should do further to combinate JSP+Tomcat+mysql, so my JSP site can work? Any advice?
    I need help.
    Thanks in advance!

    Thanks,duffymo!
    As you said, I am learning more about those things.
    Actually I am trying to open a JSP webpage to show the connection JSP+Tomcat+mysql works OK.
    I copied the mysql-connector-java-3.1.8-bin.jar to ...Tomcat 5.0\common\lib,
    created a datebase, named test in MySQL, and wrote a JSP as the below:
    <%@ page contentType="text/html; charset=gb2312" %>
    <%@ page language="java" %>
    <%@ page import="com.mysql.jdbc.Driver" %>
    <%@ page import="java.sql.*" %>
    <%
    //driver
    String driverName="com.mysql.jdbc.Driver";
    //username
    String userName="test";
    //code
    String userPasswd="123";
    //database
    String dbName="test";
    //table name
    String tableName="mytab";
    //connection string
    String url="jdbc:mysql://localhost/"+dbName+"?user="+userName+"&password="+userPasswd;
    Class.forName("com.mysql.jdbc.Driver").newInstance();
    Connection connection=DriverManager.getConnection(url);
    Statement statement = connection.createStatement();
    String sql="SELECT * FROM "+tableName;
    ResultSet rs = statement.executeQuery(sql);
    ResultSetMetaData rmeta = rs.getMetaData();
    int numColumns=rmeta.getColumnCount();
    // output
    out.print("id");
    out.print("|");
    out.print("num");
    out.print("<br>");
    while(rs.next()) {
    out.print(rs.getString(1)+" ");
    out.print("|");
    out.print(rs.getString(2));
    out.print("<br>");
    out.print("<br>");
    out.print("successful!");
    rs.close();
    statement.close();
    connection.close();
    %>
    How can I test the connection JSP+Tomcat+mysql works OK?
    Thanks again!

  • Catching jsp/tomcat/java SQL error

    I have been trying to get the sample code to work from an old book. I was finally able to get it to run under tomcat 4.1.31 but there is one bug I just cannot figure out how to handle. I am a beginner to Java/JSP/Tomcat and have about 16+ hours invested in this problem so far.
    The delFruit.jsp calls methods from FruitConnect.java.
    I found that if the fruit chosen for deletion was not involved in a referential integrity link to a FruitMonth file the code works fine. But if it is linked the delFruit.jsp just displays a blank screen and nothing is deleted. It is fine for it not to be deleted but I cannot find anyway to handle it. I tried to add the checkFruitForSale bandaid below but it causes me a blank screen as well.
    Any help would be appreciated.
    It would be great if I could just see what is happening when FruitConnect is processing code. I get no errors, just a blank screen. I'm going to try using NetBeans and their debugger next.
    Here is delFruit:
    <%@ page import="java.sql.*" %>
    <jsp:include page="adminHeader.html" flush="true" />
    <jsp:useBean id="fruitConnect" class="fruit1.FruitConnect" />
    <%
    String msg = "The following fruits have been deleted:<br> ";
    //Build the list of fruits to delete
    String delFruit[] = request.getParameterValues("delFruit");
    //WE WILL ONLY GET CHECKBOXES THAT WERE CHECKED
       String fruitList = "";
       if (delFruit != null){
         int len = delFruit.length;
         fruitConnect.dbConnect();
         for (int i = 0; i < len; i++) {
              String passfruit = delFruit;
              if (fruitConnect.checkFruitForSale(passfruit)) {}
              else{
              fruitList = fruitList + "'" + delFruit[i] + "',";
              msg = msg + delFruit[i] + "<br>";
              out.print(msg);
              out.print(msg);
         fruitList = fruitList + "'nonsense'";
         if (fruitConnect.deleteFruit(fruitList) < 1) {
              msg = "There was an error deleting the fruits from the database.";
         else{
         msg = "Deletion was successful";
         fruitConnect.dbDisconnect();
    else {
         msg = "You must select some fruit to delete.";
    %>
    HERE IS FruitConnect.java
    package fruit1;
    import java.sql.*;
    public class FruitConnect {
       private Driver drv = null;
       private Connection conn = null;
       private ResultSet rs = null;
       private Statement stmt = null;
       public FruitConnect(){}
       public void dbConnect() throws Exception{
    //      drv = (Driver) Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newInstance();
    //      conn = DriverManager.getConnection("jdbc:odbc:Fruit");
    try{
          drv = (Driver) Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newInstance();
          conn = DriverManager.getConnection("jdbc:odbc:Fruit");
    catch ( SQLException sqlException)
    sqlException.printStackTrace();
    finally
    try{
    catch (Exception exception)
       public boolean getNextItem() throws Exception{
          boolean ret = rs.next();
          return(ret);
       public String getItemNameString(String columnName) throws Exception{
          String name = rs.getString(columnName);
          return(name);
       public float getItemNameFloat(String columnName) throws Exception{
          float name = rs.getFloat(columnName);
          return(name);
       public boolean selectFruits() throws Exception{
          String query = "SELECT Id, Name FROM Fruit";
          stmt = conn.createStatement();
          rs = stmt.executeQuery(query);
          boolean ret = false;
          if (rs != null)
             ret = true;
          return(ret);
       public boolean selectMonths() throws Exception{
          String query = "SELECT Id, Name FROM Month";
          stmt = conn.createStatement();
          rs = stmt.executeQuery(query);
          boolean ret = false;
          if (rs != null)
             ret = true;
          return(ret);
       public boolean selectFruitForSale() throws Exception{
          String query = "SELECT F.Name AS Fruit, M.Name AS Month, Price, Weight, (Price * Weight) AS TotalPrice FROM FruitMonth AS FM, Fruit AS F, Month AS M WHERE FM.FruitId = F.Id AND FM.MonthId = M.Id ORDER BY M.Id";
          stmt = conn.createStatement();
          rs = stmt.executeQuery(query);
          boolean ret = false;
          if (rs != null)
             ret = true;
          return(ret);
       public int insertFruit(String name) throws Exception{
          String query = "INSERT INTO Fruit (Name) VALUES ('" + name + "')";
          stmt = conn.createStatement();
          int ret = stmt.executeUpdate(query);
          return(ret);
       public int insertFruitForSale(String insertValues) throws Exception{
          String query = "INSERT INTO FruitMonth (FruitId, MonthId, Price, Weight) VALUES (" + insertValues + ")";
          stmt = conn.createStatement();
          int ret = stmt.executeUpdate(query);
          return(ret);     
       public int deleteFruit(String fruitList) throws Exception{
          String query = "DELETE FROM Fruit WHERE Name IN (" + fruitList + ")";
          stmt = conn.createStatement();
          int ret = stmt.executeUpdate(query);
          return(ret);
       public void dbDisconnect() throws Exception{
          stmt.close();
          conn.close();
       public boolean checkFruitForSale(String thisfruit) throws Exception{
          String query = "SELECT F.Name AS Fruit, M.Name AS Month, Price, Weight, (Price * Weight) AS TotalPrice FROM FruitMonth AS FM, Fruit AS F, Month AS M WHERE FM.FruitId = F.Id AND FM.MonthId = M.Id AND F.Name IN (" + thisfruit + ") ORDER BY M.Id";
    try{
          stmt = conn.createStatement();
          rs = stmt.executeQuery(query);
    catch ( SQLException sqlException)
    sqlException.printStackTrace();
          boolean ret = false;
          if (rs != null)
             ret = true;
          return(ret);
    finally
    try{
    catch (Exception exception)
          boolean ret = false;
          if (rs != null)
             ret = true;
          return(ret);
       public String Check1(String columnName) throws Exception{
          String name = rs.getString(columnName);
          return(name);

    First thing to check would be the Tomcat log file. Most likely there is an error message printed there:
    Look in [TOMCAT]/logs for any files modified recently. Open it, and you should find some hints as to your error.
    It would be great if I could just see what is happening when
    FruitConnect is processing code.For that sort of thing, you want to use a logger. Either Log4J or the standard Java1.4 logger would help. Basically configure it to log statements to file as your program runs.
    I get no errors, just a blank screenThat could indicate that the page ran enough to fill up the page buffer, and then failed. When you view source, do you see anything on the page at all?

  • Best way to create, modify, XML with JSP ?  HELP

    Hi friends,
    As i am new to XML,
    I know there are two APIs used for XML processing, i want to know as a begineer level, which API
    is easy and good to implement XML with JSP.
    1) SAX
    2) DOM
    i want to make a log file in XML, so on web page it will be displayed on HTML form through XSL.
    Since there is good tutorial on http://www.w3schools.com/dom
    but i think its HTML dom
    I want XML procession through JAVA CODE , what should i use ? and give some good tutorials on XML DOM
    that is used with JAVA / JSP.
    HELP.
    Edited by: Ghanshyam on Sep 19, 2007 3:24 PM

    Well what i think is you gonna checkout with your requirements before implementing any of the popular XML parsing mechnisms.
    If you are intrested in faster processing @sacrifising a gud amount of your Memory,DOM is the one which you are looking for.
    If you are instrested in Managing your memory and but if you are ok with sacrifising speed SAX is the best solution.it works on what is called a push technology.
    and if you think either way you might have to look towards a pull parser which is StAX (Streaming API for XML Parsing)
    it'd be a gr8 idea if you can go through the below article which explians about each of the parsing mechanisms
    http://www.stylusstudio.com/xml/parser.html#*
    coming back to helpful resources as far java is concern checkout the below link which might be of some help.
    and the main thing is that all of these parser there is a defined specification you might find implementations of different vendors on this.
    eg:Sun Provides one with JDK itself,same as IBM provides one,oracle does the same & so on...
    your first task would be to focus on one such implementation which can cater your requirements.
    DOM:*
    Basic Parsing Objects / Interfaces Involved while DOM parsing:
    http://www.w3.org/TR/DOM-Level-2-Core/java-binding.html
    Breif Overview & few important API details:
    http://www.developerlife.com/domintro/default.htm
    Simple Example:
    http://www.brics.dk/~amoeller/XML/programming/domexample.html
    Others:
    http://www.roseindia.net/xml/dom/
    http://java.sun.com/j2ee/1.4/docs/tutorial/doc/JAXPDOM.html#wp79994
    http://java.sun.com/webservices/jaxp/dist/1.1/docs/tutorial/dom/1_read.html
    SAX:*
    http://www.javacommerce.com/displaypage.jsp?name=saxparser1.sql&id=18232
    http://java.sun.com/webservices/jaxp/dist/1.1/docs/tutorial/sax/index.htm
    http://java.sun.com/developer/Books/xmljava/ch03.pdf
    http://java.sun.com/j2ee/1.4/docs/tutorial/doc/JAXPSAX.html#wp69937
    http://www.onjava.com/pub/a/onjava/excerpt/java_xslt_ch5/index.html?page=6
    StAX:*
    http://java.sun.com/webservices/docs/1.6/tutorial/doc/SJSXP2.html
    http://javaboutique.internet.com/tutorials/stax/
    http://today.java.net/pub/a/today/2006/07/20/introduction-to-stax.html
    Hope this might be of some help :)
    REGARDS,
    RaHuL
    http://weblogs.java.net/blog/spericas/archive/2006/04/sun_stax_parser.html

  • Problems with Tomcat 4.0 and jdk 1.3.1 (jsp:include) Help Gurus...

    Im running examples of the include:
    <jsp:include page="xxx.jsp" flush="true">
    and received error:
    org.apache.jasper.JasperException: No se puede compilar la clase para JSP
    An error occurred at line: 17 in the jsp file: /jsp/include/include.jsp
    Generated servlet error:
    /Programas/Tomcat4/work/localhost/examples/jsp/include/include$jsp.java:79: Method include(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.String, javax.servlet.jsp.JspWriter, boolean) not found in class org.apache.jasper.runtime.JspRuntimeLibrary.
    JspRuntimeLibrary.include(request, response, "/jsp/include/foo.html" + jspxqStr, out, true);
    ^
    Please Help me Im running this equal with:
    <%@ include file="xxx.jsp" %>
    and runnig fine....

    The two means of including files are different in their approach.
    Using <jsp:include .../> compilation of the included jsp is done at run -time not during compilation.
    Using <%@ include .../> compiles at compile time.
    Looking at the error it seems that the method JspRuntimeLibrary.include is not being found which suggests that you may have a classpath problem. Check that there is not a servlet.jar in the classpath that is from a earlier spec than the one provided with Tomcat.
    Dave

  • Problem with String in JSP! Help Me

    Hi all,
    i spent my whole day with this error. How can i solve it. I am trying to convert a string array to Integer array. The program is taking all the select input from the previous JSP page and then converting them into integer array for storing to database. i am catching them as request.getParameterValues(); but i found out that if i select 4 item from the menu it is storing in 8 array cells and the format is if you select 1 2 3 4 the it stores [1 null 2 null 3 null 4 null] i guessed that those are null values. so i have tried to select only 1 2 3 4 from the array and it is showing number format error on tomcat. here is the code guys. Please i am tired of it please help me. Thanks. SORRY I TRIED TO SEPARATE THE CODE BUT IT SEEMS LIKE THERE ARE SOME PROBLEM IN THE FORUM SETTINGS. so the code is:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <%@page import="java.io.*"%>
    <%@page import="java.sql.*"%>
    <%@page import="java.lang.String.*"%>
    <%@page import="java.lang.Character.*"%>
    <%@page import="java.util.*"%>
    <%@page import="java.text.*"%>
    <HTML>
    <HEAD>
    <TITLE> HR ADVANTAGE TIMESHEET </TITLE>
    </HEAD>
    <BODY>
    <%
    String emplno = request.getParameter("emplno");
    String date = request.getParameter("date");
    String proposal = request.getParameter("proposals");
    String network1 = request.getParameter("network");
    String suppassociates = request.getParameter("suppasso");
    String intmngt = request.getParameter("intmgt");
    String client[] = request.getParameterValues("client");
    String client1= request.getParameter("client1");
    String clientunit[] = request.getParameterValues("clientunit");
    String clientunit1=request.getParameter("clientunit1");
    boolean bool=true;
    int staffid = Integer.parseInt(emplno);
    int len=0;
    len=client.length;
    //String[] check_client = new String[len];
    //check_client=client;
    //int check_length=0;
    //check_length=check_client.length;
    //int unitlength=0;
    //unitlength=clientunit.length;
    int arr_length=0;
    arr_length=len-(len/2);
    int[] array = new int[arr_length];
    int j=0;
    j=arr_length;
    for (int i=0; i<len-1; i++)
    bool=true;
    if(client=="\0")
    bool=false;
         if(bool==true)
         array[arr_length-j]=Integer.parseInt(client[i]);
              j=j-1;
              if(j==0)
              break;
    %>
    </BODY>
    </HTML>
    The error is:
    org.apache.jasper.JasperException: For input string: ""
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:367)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:293)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:240)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    root cause
    java.lang.NumberFormatException: For input string: ""
         java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
         java.lang.Integer.parseInt(Integer.java:489)
         java.lang.Integer.parseInt(Integer.java:518)
         org.apache.jsp.store_jsp._jspService(store_jsp.java:107)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:136)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:320)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:293)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:240)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:856)

    what are you trying to test with client [ i ] == "\0"
    You sure you dont need to test against null ?

  • Is it possible for jsp(tomcat container)  access ejb deployed in sun app se

    if it's possible ,how to implement

    Hi,
    Yes it is possible for a JSP in tomcat container to lookup EJB in sun app server.
    Please refer following article for guidelines. If you need further help please revert back.
    http://www.onjava.com/pub/a/onjava/2003/02/12/ejb_tomcat.html?page=2
    HTH
    VJ

  • JSP, Tomcat 5, Oracle9i

    Hi everyone,
    My Tomcat 5 runs OK with JSP files that don't need access to any database. However, I got error message when running any JSP files that need access to Oracle9i. Below is my "test.jsp" that will get error when running http://localhost/test.jsp.
    <%@ page import="java.awt.*, java.awt.event.*, java.sql.* , java.text.*, java.io.*" %>
    <!------------------------------------------------------------------
    * This is a test page to Oracle9i database.
    --------------------------------------------------------------------!>
    <HTML>
         <HEAD>
              <TITLE>Test</title>
         </head>
         <BODY BGCOLOR=EOFFFO>
              <B>I'm using connection and querying EMP names and
                   salaries from the EMP table in the schema SCOTT.
              </b>
              <P>
                   <%
                        try
                             Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@127.0.0.1:1521:ORCL","scott","tiger");
                                  Statement stmt = conn.createStatement();
                                  String query = "SELECT empno, ename, sal FROM scott.emp ORDER BY ename";
                                  ResultSet rset = stmt.executeQuery(query);
                                  while(rset.next())
                                       out.println( "\n"
                             + "Employee No: " + rset.getInt("empno") + "\n"
                             + "Employee Name: " + rset.getString(2) + "\n"
                             + "Salary ($): " + rset.getFloat(3) + "\n"
                             stmt.close();
                        catch (SQLException e)
                             out.println("<P>" + "There was an error doing the query:");
                             out.println ("<PRE>" + e + "</pre> \n <P>");
                   %>
              </p>
         </body>
    </html>
    I got the error below:
    I'm using connection and querying EMP names and salaries from the EMP table in the schema SCOTT.
    There was an error doing the query:
    java.sql.SQLException: No suitable driver
    What is the driver? Where can I go to get it? How can I install it?
    Please help. Thank you.

    Hi
    First of all classess12.jar or ojdbc.jar must be in classpath of your web app (WEB-INF/lib) or server's extensions dir (usually SERVER_INST/lib/ext).
    MOST IMPORTANT:
    To use driver you must register it within DriverManager. Specification requires drievers to register within static initializer so to register driver you need to do:
    Class.forName("oracle.jdbc.driver.OracleDriver");
    before calling DriverManager.getConnection(...)
    should help
    cheers
    Kula

  • Newbie to JSP needs help

    I'm running tomcat and apache and basic servlets work fine, however when I try the usebean tag; I get an error message "CLASS not found". The class object is in the same directory as the servlet?
    Any suggestions?
    Kurt Radamaker
    Orlando FL

    I don't think it is. How do I tell? I'm pretty green with jsp and java, so I'm sorry I can't be of more help.
    Kurt Radamaker
    Orlando FL

  • JSP/Tomcat/MySQL

    Hello JSP developers!
    I have a problem trying to connect to MySQL database when I am doing a JSP or a servlet. I think the problem has to be with Tomcat, because when I do a java application with a database connection works perfectly, so there must be Tomcat.
    I am working with Java j2sdk1.4.0 and Netbean as my IDE. When I compile the JSP under the IDE does not give me any errors but when I try to see the result with Tomcat 4.0 does not seem to recognize the mm.mysql driver and gives me the following errors:
    Generated servlet error:
    D:\Apache Tomcat 4.0\work\localhost\_\JspMySQL$jsp.java:75: Class org.apache.jsp.Connection not found.
    Generated servlet error:
    D:\Apache Tomcat 4.0\work\localhost\_\JspMySQL$jsp.java:76: Class org.apache.jsp.ResultSet not found.
         ResultSet results;
    It gives me more errors, related to the connection. If you are willing to help me I can send you the exception report that Tomcat generates.
    I would really appreciate if you help me about this issue, because I am beginnig to get frustated.
    Thanks!!!!

    It appears that your JspMySQL.jsp does not import the java.sql package. Try adding the following line at the top of the JSP:
    <%@ page import="java.sql.*" %>

  • BEAN ITERATION IS THIS A BUG in JSP /TOMCAT?

    Hi,
    I am new to JSP but I cant understand why I am getting this problem. I am trying simply to loop thro' an array of beans and print out their value.
    A code sample is below:
    <%@ page import="subscription.*" %>
    <jsp:useBean id="event" class="subscription.EventBean"/>
    <%
    EventBean[] events = (EventBean[]) request.getAttribute("events");
    <%for (int i=0;i< events.length;i++) {
    event= events;
    %>
    <b>bean is</b><jsp:getProperty name="event" property="id" /> </b>
    <%}%>
    All I get is a list of event ids at 0 as opposed the the id values. It seems to not be referencing the new bean.
    If I change the jsp;getProperty to <%=event.getId()%> the correct ids are retrieved. I am using Tomcat 4.1.
    I can only think this is user error, as I have not found any similar listings
    Help would be welcomed!
    Emma.

    Hi,
    Thankyou for trying to help. Unfortuanately you solution does not work as
    you are assiging an object (EventBean) to an array of objects (EventBean).
    I can help thinking problem I am getting is because somehow when you do a
    <jsp:useBean> to instantiate a bean you can reassign it later on in a scriplet, which is what I am doing. Why you cant is not something I understand.
    Maybe it would help if I explained what I want to do. I am trying to get an array of beans from one jsp page and print them out in another.
    so my thoughts were (and ironically the text book I am using does exactly this)
    //instantiate an EventBean using
    <jsp:useBean id="event" class="subscription.EventBean"/>
    //get the attributes (they are attributs cos I am dispatching servlet to //jsp page)
    <% EventBean[] events = (EventBean[]) request.getAttribute("events"); %>
    //This now gives me the array of eventbeans I want to pring out and //rather than do it all in a scriplet try to use jsp tags which is what //all the bks say you should do.
    //so I iterate thro' array and assign my EventBean object that I //instantiated using the jsp:useBean
    <%
    for (int i=0;i< events.length;i++) {
    event= events;
    %>
    //now I try to print out a property (id in this instance)...
    <jsp:getProperty name="event" property="id" />
    <% } %>
    but IT DOES NOT WORK!! I have to go <%=event.getId() %>
    my bean is dead simple and works if I am doing simple stuff like setting and getting attributes on a single bean.
    Maybe I a not getting scoping in JSP , it is not that clear,like normal
    java code and any docs to look at would be welcomed.
    Emmma.

  • How to Connect JSP (Tomcat) with MS access Database

         ^
    Hi all:
    I have been trying to connect JSP using tomcat server with database in MS Access..I have been going through the required steps...but it seems it is a bit complicated...pls help.
    ps: I used to get this message when I run the program:
    C:\jakarta-tomcat-4.0-b5\work\localhost\feras\db1_jsp.java:71: Class org.apache.jsp.PreparedStatement not found.
         PreparedStatement sql;
         ^
    C:\jakarta-tomcat-4.0-b5\work\localhost\feras\db1_jsp.java:81: Undefined variable or class name: DriverManager
                   dbconn = DriverManager.getConnection(url);
                   ^
    C:\jakarta-tomcat-4.0-b5\work\localhost\feras\db1_jsp.java:111: Class org.apache.jsp.SQLException not found.
              catch (SQLException s)

    Hi friends:
    this is the source code, I am working on tomcat server, and it doesn't work at all
    <html>
    <head>
    <%@ page
         import = "java.io.*"
         import = "java.lang.*"
         import = "java.sql.*"
    %>
    <title>
    JSP Example 2
    </title>
    </head>
    <body>
    <h1>JSP Example 3</h1>
    <%
         String     place;
         String url = "jdbc:odbc:ferasdb";
         Connection dbconn;
         ResultSet results;
         PreparedStatement sql;
         try
              Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
              try
                   int     latitude,longitude,easting,northing;
                   boolean     doneheading = false;
                   dbconn = DriverManager.getConnection(url);
                   place = request.getParameter("place");
                   sql = dbconn.prepareStatement("SELECT * FROM gazetteer WHERE feature = '" + place + "'");
                   results = sql.executeQuery();
                   while(results.next())
                        if(! doneheading)
                             out.println("<table border=2>");
                             doneheading = true;
    latitude = results.getInt("latitude");
    longitude = results.getInt("longitude");
    easting = results.getInt("easting");
    northing = results.getInt("northing");
                        out.println("<tr><td>" + latitude);
                        out.println("<td>" + longitude);
                        out.println("<td>" + easting);
                        out.println("<td>" + northing);
                   if(doneheading)
                        out.println("</table>");
                   else
                        out.println("No matches for " + place);
              catch (SQLException s)
                   out.println("SQL Error<br>");
         catch (ClassNotFoundException err)
              out.println("Class loading error");
    %>
    </body>
    </html>

  • Jsp errot help!

    i have 4 error after compling this files, cannot 1 help pls!
    <%@ page import="java.io.*"%>
    <%@ page import="java.util.zip.*"%>
    <%@ page import="java.lang.Thread"%>
    <%@ page import="java.net.URL"%>
    <%@ page import="java.net.URLConnection"%>
    <%@ page import="java.sql.*"%>
    <%@ page import="java.util.*"%>
    <%@ page import="java.util.StringTokenizer.*"%>
    <%
    class ThreadBase implements Runnable
    int counter = 0;
    public void run()
         try
              Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
         catch(ClassNotFoundException e)
              System.out.println(e);
         Connection c = DriverManager.getConnection("jdbc:odbc:MHuman");
         Statement s = c.createStatement();
              int x = 1;
              String x_str = "";
              do{
                        x_str = Integer.toString(x);
                        if (x==23) x_str = "X";
                        else if (x==24) x_str="Y";
                   try
                        String sqlstr = "CREATE TABLE Chromosome"+x_str+" " +
                        "(ID number, HChr varchar (20), Hstart number, Hend number, MChr varchar (20), Mstart number, Mend number)";
                        System.out.println(sqlstr);
                        try { s.execute("Drop table Chromosome"+x_str+"");
                   catch (Exception e) { };
                   s.execute(sqlstr);
    catch(SQLException e)
    e.printStackTrace();
    // Create BufferedReader object.
    BufferedReader br = null;
    try
              br = new BufferedReader(
              new FileReader("C:\\downloadChr\\mhuman\\chr"+x_str+".txt"));
    catch(IOException e)
         System.out.println(e);
    String line, ID, HChr, Hstart, Hend, MChr, Mstart, Mend, sql;
    StringTokenizer st;
    try
         cs();
         while ((line = br.readLine()) != null)
                   st = new StringTokenizer(line, " ");
                   ID = st.nextToken();
                   HChr = st.nextToken();
                   Hstart = st.nextToken();
                   Hend = st.nextToken();
                   MChr = st.nextToken();
                   Mstart = st.nextToken();
                   Mend = st.nextToken();
                   if (!MChr.startsWith("chrNA"))
                        if (!MChr.startsWith("chrM"))
                             if (!MChr.startsWith("chrUn"))
                                  if (!MChr.startsWith("chrFinished"))
                        sql = "INSERT INTO Chromosome"+x_str+" " +
                        "VALUES (" + ID + ", '" + HChr + "', " + Hstart + ", " + Hend + ", '" + MChr + "', " + Mstart + ", " + Mend + ")";
                        //System.out.println(sql);
                        s.executeUpdate(sql);
    catch(IOException e)
    System.out.println(e);
    }while (x++ < 12);
         c.close();
         private void cs()
              int a = counter;
              a++;
              counter = a;
              System.out.println("Thread is running with Chr " + counter);
    C:\Program Files\Tomcat 4.1\work\Standalone\localhost\examples\jsp\HMC\HTML\testDL3_jsp.java:74: unreported exception java.sql.SQLException; must be caught or declared to be thrown
    An error occurred at line: 9 in the jsp file: /jsp/HMC/HTML/testDL3.jsp
    Generated servlet error:
         Connection c = DriverManager.getConnection("jdbc:odbc:MHuman");
    ^
    An error occurred at line: 9 in the jsp file: /jsp/HMC/HTML/testDL3.jsp
    Generated servlet error:
    C:\Program Files\Tomcat 4.1\work\Standalone\localhost\examples\jsp\HMC\HTML\testDL3_jsp.java:76: unreported exception java.sql.SQLException; must be caught or declared to be thrown
         Statement s = c.createStatement(); ^
    An error occurred at line: 9 in the jsp file: /jsp/HMC/HTML/testDL3.jsp
    Generated servlet error:
    C:\Program Files\Tomcat 4.1\work\Standalone\localhost\examples\jsp\HMC\HTML\testDL3_jsp.java:139: unreported exception java.sql.SQLException; must be caught or declared to be thrown
                        s.executeUpdate(sql);
    ^
    An error occurred at line: 9 in the jsp file: /jsp/HMC/HTML/testDL3.jsp
    Generated servlet error:
    C:\Program Files\Tomcat 4.1\work\Standalone\localhost\examples\jsp\HMC\HTML\testDL3_jsp.java:153: unreported exception java.sql.SQLException; must be caught or declared to be thrown
         c.close();
    ^
    4 errors

    Your Connection object and Statement object is written outside try{}.
    Put all your code inside try{}.
    Hope this will solve your problem.

  • Oracle J2EE container, Web Layout, JSP, Tomcat

    Please help me with the next questions:
    1)Oracle DB server and Oracle J2EE container are located in different places. The jsp in Oracle report web layout was generated. I put this JSP on the Oracle J2EE container and tried to run this jsp:
    http://localhost:port/reports/weblayout.jsp and got the next error:
    javax.servlet.jsp.JspException
         at oracle.reports.jsp.ReportTag.doStartTag(ReportTag.java:341)
         at groups.jspService(_groups.java:55)
         at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
         at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:302)
         at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:407)
         at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:330)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:336)
         at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:59)
         at oracle.security.jazn.oc4j.JAZNFilter.doFilter(JAZNFilter.java:283)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:523)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:269)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:735)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:243)
         at com.evermind.util.ThreadPoolThread.run(ThreadPoolThread.java:64)
    Do I need to deploy this jsp on Oracle J2EE container and if yes in what way?
    2)can I run this jsp in Tomcat?
    Thank you.

    hello,
    reports JSPs need the report server environment availabel and can not be deployend to a vanilla J2EE container. you can take a look at our "Tools" section of the reports page here on OTN (go to the reports homepage and click on the "search" link in the news section. there you can look for "tools and utilities" which contain instructions on how what you need to do. keep in mind though, that this is not a supported configuration. the only way to deploy a reports JSP is inside the J2EE container of the EE edition of the appliation server.
    at this point we do not provide any instruction for other, non oracle, containers.
    thanks,
    ph.

  • Language problem in JSP please help

    Hi all java guru;
    Altough I tried all different way I can not solve the my problem.
    My problem is Turkish language problem in JSP.
    If my jsp page use database applications such as push or pull data to my SQL 2000 database or call some datas from database, some data which contains turkish caracter are seen wrong. suc as ����� is to ??????
    what is the problem?
    But important point is that; this is only Database data which come from sql database. But I can see JSP data or HTML data truly.
    I try different method to solve in JSP page;
    1-request.setEncoding("iso-8859-9");
    or
    request.setCharacterEncoding( "windows-1250" );
    2-
    @contentType="text/html; charset=iso-8859-9"
    @page pageEncoding="iso-8859-9"
    3-
    <meta http-equiv="Content-Language" content="tr">
    <META http-equiv="Content-Style-Type" content="text/css">
    4-
    ISO-8859-9 is turkish charecter spefications
    String TR_tlp = new String(NEW_TALEP.getBytes(),"ISO-8859-9"); // this parm is inserting database but problem is go on.
    5-
    for the database...
    Properties props = new Properties();
    props.put("user","login");
    props.put("password","password");
    props.put("charSet","UNICODE");
    6-
    url= "jdbc:microsoft:sqlserver://IP_NO:1433;databasename=database;TRUSTED_CONNECTION = true;CHARSET="+sun.io.ByteToCharConverter.getDefault().getCharacterEncoding();
    or
    url= "jdbc:microsoft:sqlserver://IP_NO:1433;databasename=database;TRUSTED_CONNECTION = true;CHARSET=ISO-8859-9"
    con= DriverManager.getConnection(url, kulad, sifre);
    I am using tomcat 5.0.19,
    is there any way to solve this problem... Please help......

    Were you ever able to solve your problem?
    I have a similar problem.
    My database is storing the characters correctly and they can be viewed in Java, but when I try to convert them to unicode using:
    String inputUtf8 = new String(input.getBytes(),charset);
    it works for almost all characters, but some come through as noncharacter "boxes."
    The characters that come through as boxes in iso8859-1 are the ones that are in the "supplementary" character range of that set, such as:
    - curved left and right quotes
    - "TM" symbol
    - bullets
    - m dash and n dash
    (see this table: http://www.csgnetwork.com/htmlchrset.html for a more complete list of the supplementary characters )
    Any idea what I need to do to have these characters show up properly?

Maybe you are looking for

  • Cannot view new files on networked mac

    Hi all, I posted this last year but I think it was in the wrong section.....here goes again.. I have 2 macs linked via an ethernet cable (g4/400 g4/1.2dual). The 400 is on 10.3.9 and the 1.25 is on 10.4.11 When I do the "Connect to Server" thing from

  • Error in CF Administrator After Update to 9.0.1

    I'm attaching an image of the error I get when I click the first "Settings" Link under "Server Settings" menu.  I did some searching but I couldn't find anyone that was having a similar problem. Any help would be appriciated. Thanks, Paul

  • Need help hooking up 2 i pods  -  please

    I have an ipod classic and have my library set up for a long time. I bought a nano for my daughter for xmas and hooded it up. I think I should have selected new device or something because her nano is now connected to my classic so all my songs are o

  • Os x build 12c60 apple tv mirroring

    Hello, i was trying to mirror my imac (build12C60, all new software) to my apple tv 2g (build12C60, all new software) but it did not work. I can also not see the typical button for mirroring! Can anybody tell me if it is possible to use mirroring wit

  • Upgrading from Windows 7 32 bit to Windows 8.1 64 bit

    I have Windows 7 32 bit. Recognizing I can't upgrade to 64 bit and over write the 32 bit system my question I have multiple SSD. My existing winn7 occupies C:\ Can I install the new windows 8.1 64 bit on a separate drive and then rename it to the C:\