1) Write the servlet class.
2) Configure web.xml or through some annotations based on the version you are using.
3) build war file.
4) deploy the war file
5) invoke the servlet like http://localhost:8080/<<app/contextname>>/<<URL pattern>>
If you had looked into FAQS session, you would certainly find examples on how to setup the web application or through google
All the best.
Welcome to Javaranch Mahera i also dont know much about servlets but did a little google search
Mahera Shaikh wrote:Thnx Rajni G Sir..
But i need it in quiet clarified language...
Each step with exaplanation....
Please do post with detailed explanation...
Hi Mahera, have you considered looking at the example which Vishal provided or the "HelloWorld" servlet given in the link provided? What are the issues you are facing in understanding those examples? Please do not hesitate to ask your questions, but I would still ask you to look into those links before.
I tried with Rose India..
but getng a error report
File Not found...
Vishal Hegde wrote:
Ulf Dittmer wrote:
Mahera Shaikh wrote:I tried with Rose India..
Don't ever use that site - it's full of erroneous code, bad advice and bad practices.
what about its theory knowledge for basics??
I agree with Ulf. It is not a good site. Teaching bad code and poor practices is not a good way to learn basics or anything else.
For e.g. you have a servlet called MyServlet. The you should keep the MyServlet.class under WEB-INF\classes. Now you have to create your web.xml something like this
Save this as web.xml in WEB-INF folder. I assume your context folder name is mysite
Restart tomcat and try to execute like