tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "anunay ashish" <anun...@tis.co.in>
Subject Servlet and JSP.
Date Mon, 06 Oct 2003 10:07:14 GMT
Hi,
I have a problem regarding my servlet.
The JSP file calling the servlet is having the following code:
<HTML>
 <HEAD>
  <TITLE> Page format </TITLE>
  <META NAME="Generator" CONTENT="EditPlus">
  <META NAME="Author" CONTENT="">
  <META NAME="Keywords" CONTENT="">
  <META NAME="Description" CONTENT="">
 </HEAD>

 <BODY>
  <%@ page import="java.sql.*" %>
  <jsp:useBean id="dbBean" scope="session" class="com.scheduler.DBUpdate" />
  <!--In the above statement the bean tag made an object of the class and
called the constructor too.-->
  Welcome! The available page formats are:
  <br>
  <table border="1">
   <tr><td><b>Page format</b></td></tr>
    <%
     ResultSet testRS;
     String query = "Select * from lookup_page_format"; //On giving a ;
after the query did not return any record.
     dbBean.process(query);
     try
      {
       testRS = dbBean.getResultSet();
       while(testRS.next())
        {
         out.print("<tr><td>" + testRS.getString(2) + "</td></tr>");
         System.out.println(testRS.getString(2));
        }
      }
     catch (SQLException e)
      {
       out.print("SQLException :" + e);
      }
    %>
  </table>
  Please add a new page format of your choice:
  <form action="servlet/com.scheduler.addDataServlet" method="GET">
   <input type="text" name="newPageFormat">
   <input type="Submit" name="submitButton" value="Submit">
  </form>
 </BODY>
</HTML>

The bean as well as the servlet packages is in the same folder as:
C:\Program Files\Apache Group\Tomcat
4.1\webapps\Tracking_system\WEB-INF\classes\com\scheduler

If I change the method in servlet from doGet to doPost and make the
corresponding change in form method to "POST" then the JSP throws an error
of something related to my bean package.

Is the problem related to GET/POST? or to the fact that both the packages
are in the same folder?

Regards,
Anunay Ashish.




---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message