you cannot use java.awt.TextArea in a servlet. AWT api is for making
applications. The error its giving is that of html textarea, which is true
also. Coz ultimately when u run the server in the browser it will throw html
as output if there is any. If you want you can write an applet and then call
it through servlet.

or change your code to

out.println("<textarea></textarea>");

just check the syntax.

Regards,
Vikramjit Singh,
Systems Engineer,
GTL Ltd.
Ph. 7612929-1031


-----Original Message-----
From: Bob Prah [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 13, 2002 3:24 AM
To: [EMAIL PROTECTED]
Subject: Invalid Text


Hi,

Has anybody any idea how to display a textarea in a servlet. I have a page
(generated by a servlet) which is suppose to display a textarea,
but if I do call this page, instead of displaying the textarea, it throws
the following error msg. :

****

java.awt.TextArea[text0,0,0,0x0,invalid,text=,editable,selection=0-0,rows=10
,columns=50,scrollbarVisibility=both]


*****


My code looks something like :



import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.sql.*;
import java.awt.*;
import java.lang.*;


public class adminServlet extends HttpServlet {

    ActualNews adminActual;
    ResultSet res;
    TextArea newsText = new TextArea(10,50);


    public void init(ServletConfig config) throws ServletException {
            super.init(config);

    }

    protected void processRequest(HttpServletRequest request,
HttpServletResponse response)
    throws ServletException, IOException {

    response.setContentType("text/html");
        java.io.PrintWriter out = response.getWriter();


       adminActual = new ActualNews();

       newsText.getText();
       try {
       newsText.setText(adminActual.newsSummary());
       } catch (SQLException e){}

       out.println(newsText);



    }


    protected void doPost(HttpServletRequest request, HttpServletResponse
response)
    throws ServletException, java.io.IOException {
            processRequest(request, response);
    }


}

___________________________________________________________________________
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