This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Servlets and the fly likes Servlet question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Servlet question" Watch "Servlet question" New topic
Author

Servlet question

Lucky Singh
Ranch Hand

Joined: Jan 19, 2004
Posts: 125
Hi,
I was going through 'Wrox Professional Server programming- Part 1'.
Had the following question with respect to the Chat servlets example mentioned there.
I have a servlet that displays an HTML form. This form contains two text fields in which we enter the name of the chat room and its description.
On submitting the form, this must go to ChatRoom.java which is a jar file already ready in Tomcat-- (lib subdirectory).
ChatRoom.java adds a new chat room to its stack.
My questions were-
Do I need to have both doGet() and doPost() in my servlet?
I had some blank spaces in my HTML form. How do I fill up the gaps, for example form action?
Where will I include code for servlet to pass chatroom name and chatroom description to ChatRoom.java? What will the code look like?
public void doGet(...........)
{
out.println("<HTML>");
out.println("<FORM METHOD=Post Action=________________>");
form is displayed with 2 text fields.
}
 
 
subject: Servlet question
 
Similar Threads
Servlet strange?
A problem in executing the servlet
Session Problem
PersonalizeWelcome servlet question...
questions where to put the servlets