> -----Original Message-----
> From: Jenkins, Jonathan
> Sent: 21 October 1999 11:56
> To: 'Vaidyanathan_g'
> Subject: RE: help required in using Orion serve
>
> The default path in the for invoking servlets in orion is "servlet",
> however the physical directory is called "servlets".
> If you change the form action method in the jsp file it should work..
> I got caught by that too... :-)
>
> Jon Jenkins
>
> -----Original Message-----
> From: Vaidyanathan_g [SMTP:[EMAIL PROTECTED]]
> Sent: 21 October 1999 10:57
> To: [EMAIL PROTECTED]
> Subject: help required in using Orion serve
>
> Hi,
>
>
> I have a very simple application written using jsp and java beans and
> servlets. I am using Orion Server.
>
> The code in the jsp is (file name is SelectServletBean.jsp and
> SelectServletBean.java)
>
> SelectServletBean.jsp
>
>
> <!
> SelectServletBean.html
> !>
>
> <html>
> <form method="post"
> action="http://itl-pc-2660:8080/servlets/SelectServletBean">
> query:<p>
> Enter the data source, user id, and password information:<br>
> <input size=20 name="DATABASE"> <input size=20 name="LOGIN">
> <input size=20 type="PASSWORD" name='PASSWORD'><br>
> <br>
> Select the city that you would like to query:<br>
> <input type="radio" name="CITY" value="*"> All cities <br>
> <input type="radio" name="CITY" value="Bern"> Bern <br>
> <input type="radio" name="CITY" value="London"> London <br>
> <input type="radio" name="CITY" value="Berlin"> Berlin <p>
> <input type="submit"> <input type="reset">
> </form>
> </html>
>
>
> SelectServletBean.java
>
>
> /*
> * SelectServletBean.java
> */
>
> import java.beans.*;
>
> import javax.servlet.*;
> import javax.servlet.http.*;
>
> import java.sql.*;
>
> import java.io.*;
> import java.util.*;
>
> public class SelectServletBean
> extends HttpServlet
> {
> public DataAccessBean daBean = null;
> public PropertyChangeAdapter adapter = new PropertyChangeAdapter();
> public boolean queryStatus = false;
>
> public synchronized void setQueryStatus(boolean b)
> {
> queryStatus = b;
> }
>
> public synchronized boolean getQueryStatus()
> {
> return queryStatus;
> }
>
> public void doPost (HttpServletRequest req, HttpServletResponse res)
> throws ServletException, IOException
> {
> int index;
>
> res.setContentType("text/html");
> ServletOutputStream out = res.getOutputStream();
> out.println("<html>");
> out.println("<head><title>SelectServletBean</title></head>");
> out.println("<body>");
>
> String database = req.getParameter("DATABASE");
> String login = req.getParameter("LOGIN");
> String password = req.getParameter("PASSWORD");
> String city = req.getParameter("CITY");
>
> String where;
> if (city.equals("*"))
> where = "";
> else
> where = " WHERE city = " + "'" + city + "'";
> String sql = "SELECT Country, Region, city FROM Customers" +
> where;
>
> daBean = new DataAccessBean(database, login, password, sql);
> daBean.addPropertyChangeListener(adapter);
> daBean.execQuery();
>
> if (getQueryStatus()) {
> out.println("<table border='border'>");
> out.println("<caption> Querying the Customers Table: " +
> "</caption>");
>
> String n1 = daBean.getColArray(0);
> String n2 = daBean.getColArray(1);
> String n3 = daBean.getColArray(2);
> out.println("<tr> <th>" + n1 + " <th>" + n2 +
> " <th>" + n3);
>
> int numElements = daBean.getMaxResultArrayLen();
> int currentElement = 0;
> index = 0;
>
> while(currentElement < numElements &&
> daBean.getResultArray(currentElement) != null) {
> String v1 = daBean.getResultArray(currentElement++);
> String v2 = daBean.getResultArray(currentElement++);
> String v3 = daBean.getResultArray(currentElement++);
> out.println("<tr> <td>" + v1 +" <td>" + v2 +
> " <td>" + v3);
> }
>
> } else {
> out.println(daBean.getErrorMsg());
> }
>
> out.println("</table>");
> out.println("</body></html>");
> }
>
> public String getServletInfo() {
> return "A servlet that performs queries on the " +
> "Customers database";
> }
>
> class PropertyChangeAdapter implements PropertyChangeListener
> {
> public void propertyChange(PropertyChangeEvent e)
> {
> String status = new String(e.getNewValue().toString());
>
> if(status.equals("true"))
> {
> if( daBean.getErrorMsg() != null)
> {
> setQueryStatus(false);
> }
> else{
> setQueryStatus(true);
> }
> }
> }
>
> }
> }
>
>
> Directory structure in Orion Web server:
>
> The jsp file is in Server Site/html/examples/jsp/SelectServletBean
> directory.
> The java file is in server Site/Servlets directory.
>
> The error reported is 404 NOT FOUND.
>
> Even if a simple servlet is invoked directly from the browser the same
> error
> is reported.
>
> Any specific setting to be done ?
>
> Thanks.
>
> vaidya.
>
> ==========================================================================
> =
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> FAQs on JSP can be found at:
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.html
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html