This week's book giveaway is in the General Computing forum. We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line! See this thread for details.
The "PersonObject" class needs to have a "doGet()" method. If you want the "doGet()" method to do exactly the same thing as the "doPost()" method does, then your "doGet()" method can simply be:
using this url [URL=http://localhost:8080/HFchapter5/PersonObject.do]
always causes a GET type request. The typical way to do a POST type request is with an HTML form where the form tag has method="POST"
jyothi sanka
Ranch Hand
Joined: Aug 27, 2001
Posts: 39
posted
0
Thank you everybody. Now Servlet is working.
jyothi sanka
Ranch Hand
Joined: Aug 27, 2001
Posts: 39
posted
0
Hi, That one is worked when we use string Attribute. But when I tried to access JavaBean class jsp can't access the bean class. I am using Eclipse and Tomcat with SysDeo tomcat plugin for creating Tomcat project. This is my directory: Package HFChapter5: I wrote PersonObject servlet class and Person Bean class in this directory web-inf/src . I wrote result.jsp in HFChapter5. jsp is not able to find the Bean class? Where do I have to write Bean class? Thank you
hi,
your HttpServlet mostly uses any one of the HTTP methods as GET or POST
for every HTML page the default method taken for <form .... method="GET"> is GET
Even if you declare it or not...
You have to declare post if you are handling a post request
so for supporting both the methods, it'll be better to override both the methods in your servlet