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.