another modifier to the textfield would be VALUE, which you could set as 'x'.

i.e., "<input type=text name=t1 value=" + x + ">"

Note: for anyone who doesn't know everything there is to know about HTML off th top of
their head (me for exaample, and probably most of us) CuteHTML (www.cuteHTML.com) is 
god.
Lots of libraries and it helps you fill in all the junk in the HTML that we usually 
can't
remember off the tops of oyur respective heads.

-Danny

s saravanan wrote:

> Hi everybody,
>
>       I don't know how to display the values in textfield in the servlet
> program. I want the 'x' value(see the program) to be printed in the
> textfield 't1'.
>
>      Can u help on this immediately!!!
>
> My part of code is:
> *******************
>
>     String u1=request.getParameter("un");
>     String p1=request.getParameter("pw");
>     PrintWriter out=response.getWriter();
>     response.setContentType("text/html");
>     try
>    {
>     Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
>     Connection con=DriverManager.getConnection("jdbc:odbc:test1", "sa", "");
>
>     Statement stmt=con.createStatement();
>     String query="select * from userdetails where username='"+u1+"'"+"AND
> password='"+p1+"'";
>     ResultSet rs = stmt.executeQuery(query);
>
>     if(rs.next())
>     {
>
>      out.println("<html>"+"<body bgcolor=#CCCCFF>");
>      String x=rs.getString(1);
>      //out.println(x);
>      out.println("<br>");
>      out.println("<b>"+"username: "+"</b>"+"<input type=text name=t1 >");
>      out.println("</body>"+"</html>");
>
>     }
>     else
>     {
>       response.sendRedirect("/comfortsbiz/updaterr.html");
>     }
>
> Bye
> sar.
>
> _____________________________________________________________________________________
> Get more from the Web.  FREE MSN Explorer download : http://explorer.msn.com
>
> ___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to