Hi..
    recently i installed tomcat 4.0.1, it installed prefectly, running prefectly all 
the examples but i get confiused about how should i run my own developed servlet in 
which directory should i put those .java and .class files,
    i sending the html file and servlet file, html take the input and send it to 
servlet and it will return the html file with user input..

with best regards,
sanjay jadhav

servelt file as under..
------------------------
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.lang.*;

public class ExampServlet extends HttpServlet {
    public void doPost(HttpServletRequest request,HttpServletResponse response) throws 
ServletException, IOException {
 response.setContentType("text/html");
 PrintWriter out = response.getWriter();
        out.println("<title>Example</title>" +
                     "<body bgcolor=FFFFFF>");

        out.println("<h2>Button Clicked</h2>");

        String DATA = request.getParameter("DATA");

        if(DATA != null){
                out.println(DATA);
        } else {
                out.println("No text entered.");
        }

        out.println("<P>Return to <A HREF=../simpleHTML.html>Form</A>");
        out.close();
    }
}

html file as under
-------------------
<HTML>
<HEAD>
<TITLE>Example</TITLE>
</HEAD>
<BODY BGCOLOR="WHITE">

<TABLE BORDER="2" CELLPADDING="2">
<TR><TD WIDTH="275">

<H2>I'm a Simple Form</H2>

Enter some text and click the Submit button.<BR>
Clicking Submit invokes
<A HREF="ExampServlet.java">ExampServlet.java</A>,<BR>
which returns an HTML page to the browser.

<FORM METHOD="POST" ACTION="JSP/Servlet/ExampServlet">

<INPUT TYPE="TEXT" NAME="DATA" SIZE=30>

<P>
<INPUT TYPE="SUBMIT" VALUE="Click Me">
<INPUT TYPE="RESET">
</FORM>

</TD></TR>
</TABLE>

</BODY>
</HTML>

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com
��칻�&ޙ����b����ڽ�.��&�+an�r�('���H�
LDDI1h�ؠz�fj)m�X��ǫ�6�j˧r����[�ܬz�R<�SL2$Ңg�zW�j{E(����'��W��Ƨm��wZ�m��ڭ�b��#j���w(���)�z���f�m���j���w(��k�ۜ��㲟�j�m�Xm����
���j{h��'���������a���0����&����)�{�m�����)�׫r�


Reply via email to