This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
hi all actually my server guy has deleted web.xml by mistake & now i not able to run servlets. can someone help me in writing a web.xml to even run a simple HelloWorld application. i wrote web.xml as follows, plz specify any modifications to be done : <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd"> <web-app> <servlet> <servlet-name> HelloWorld </servlet-name> <servlet-class> HelloWorld </servlet-class> </servlet>
</web-app> tia malhar
Anthony Villanueva
Ranch Hand
Joined: Mar 22, 2002
Posts: 1055
posted
0
If you are using tomcat4, you can also go to {tomcat_install_dir}\conf and copy the web.xml file there. Copy it to your webapps's WEB-INF folder and edit this web.xml to your preferences.
Malhar Barai
Author
Ranch Hand
Joined: Aug 17, 2001
Posts: 399
posted
0
If you are using tomcat4, you can also go to {tomcat_install_dir}\conf and copy the web.xml file there. Copy it to your webapps's WEB-INF folder and edit this web.xml to your preferences.
dear actually i dont hv access to any other folders, so cant copy frm there & basically the server is maintained by a fool...he doesnt know any thing abt configurations & all my requests wud be remain unattended. so basically i'll hv to rewrite the file... thnx anyway malhar
Anthony Villanueva
Ranch Hand
Joined: Mar 22, 2002
Posts: 1055
posted
0
Well... okay. Anyway your web.xml looks ok unless you happen to package your servlets.
Malhar Barai
Author
Ranch Hand
Joined: Aug 17, 2001
Posts: 399
posted
0
Anyway your web.xml looks ok unless you happen to package your servlets.
well... i m not using package but still its giving 404 error..
Did you restart the server? and did you put the web.xml in
'webapps/ROOT/WEB-INF/'? Rene
dear rene i only hv access to web-inf folder, cant know if its under web-apps/ROOT... i m still looking at anthony's solution & trying to get the port, but if the port is 80 i think we wud be better off writing as http://<hostname>/... instead of http://<hostname>:80/... thnx anyway malhar
Anthony Villanueva
Ranch Hand
Joined: Mar 22, 2002
Posts: 1055
posted
0
Rene is right. You have to find out somehow if the web.xml is in the right directory. Also you must restart Tomcat for your new web.xml to take effect.
sandeep balyan
Ranch Hand
Joined: Jul 25, 2001
Posts: 134
posted
0
Hi have a look <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "web-app_2_3.dtd"> <web-app> <display-name>urchoice</display-name> <description> any message description </description> <servlet> <servlet-name>HelloServlet</servlet-name> <description> abt servlet </description> <servlet-class>myservlet.servlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>HelloServlet</servlet-name> <url-pattern>/hello/*</url-pattern> </servlet-mapping> <welcome-file-list> <welcome-file>index.html</welcome-file> </welcome-file-list> </web-app> regds ---------- if any problem chk the version of web-app_2_3.dtd and use according ----------------