Hi,
I'm new into JSP technology.
I have used only Servlets before,
with JBuilder 3 Enterprise.
I would like to know a system with
JSP+Servlets to make something like
these steps I have into my servlet:
1) I have a HTML <form> with a text
field. The user types a username
that should be searched into a
database.
2) JSP receives a request and call
a servlet to verify the username.
DOUBT: How to start the communication
between JSP and Servlet and
how to send username data ?
3) Servlet searches for username into a
database. If there is, it should return
all records matching this name with the
fields Name/Address/etc; otherwise, it
should return an error msg.
DOUBT: Is it possible to return a Query
result object from Servlet to JSP?
How to return error msg ?
4) JSP should receive the Query (or error msg)
and format the HTML output to the browser.
At my servlets, many times I need to do something
like this:
if ("some code condition")
out.println("<font size=X1 color=Y1 ...");
else if ("some other code condition")
out.println("<font size=X2 color=Y2 ...");
...
else
out.println("<font size=Xn color=Yn ...");
This is a simple example of HTML code that is
linked to logic conditions. I think this type
of code has to stay at Servlet, not JSP,isn't it?