Hi Alberto
 
Thank you very much for helping.
You are correct - I'm not very comfortable in Java - only been using it for two days.
I *will* go and re-read the books I have - but there is somewhat of an urgency that
I get this to work, hence my message.
Thanks once again for helping.
 
Brad
 
----- Original Message -----
Sent: Monday, October 01, 2001 6:10 PM
Subject: Re: newbie question on methods in classes

Hi,
 
I think you are not very comfortable with Java... You can not use a class method outside an instance of this class. You should use something like
 
LoginForm myForm = new LoginForm();
out.println(myForm.LoginForm());
 
You should review the OOPrograming theory!
-----Mensaje original-----
De: A mailing list for discussion about Sun Microsystem's Java Servlet API Technology. [mailto:[EMAIL PROTECTED]]En nombre de Brad Thomas
Enviado el: lunes, 01 de octubre de 2001 9:36
Para: [EMAIL PROTECTED]
Asunto: newbie question on methods in classes

hi all
 
I'm an absolute newbie to Java, but have programmed in Visual Basic for the last
5 years. I successfully created a Java servlet in Forte for Java Community Edition 3.0,
and viewed it successfully in a web browser.
 
Now, I'd like to add some more info to the webpage that is generated by the servlet.
The servlet uses a method called processRequest, as shown below:
 
    protected void processRequest(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, java.io.IOException {
 
        String temp = null;
        response.setContentType("text/html");
        java.io.PrintWriter out = response.getWriter();
       
        //* output your page here
        out.println("<html>");
        out.println("<head>");
Now, I'd like to add some more output from info read from a database. (I've got that part
working too, thanks to some code I found elsewhere on the 'net.)
Basically, what I'd like to say is:
 
        out.println(LoginForm());
 
where LoginForm is a method that returns a string containing all the HTML for the login page.
I can't use JSP's because all the content is stored in the database, and the DB has its own interface
for managing the content in it, including the Login form.
 
The error I receive from the compiler is:
 
mywebapp.java [62:1] cannot resolve symbol
symbol  : method LoginForm  ()
location: class mywebapp
        out.println(LoginForm());
                       ^
1 error
Errors compiling mywebapp.
 
 

Reply via email to