• Post Reply Bookmark Topic Watch Topic
  • New Topic

Servlet question  RSS feed

Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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("<FORM METHOD=Post Action=________________>");
form is displayed with 2 text fields.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!