• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Servlet question

 
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
}
reply
    Bookmark Topic Watch Topic
  • New Topic