i just learn core java
and i want to make web application
its ok with my old jdk 6
or should download java ee sdk
for web application
i have download tomcat 6
and i am trying to make simple page using servlets
but its giving me error "request resource is not available"
what should do
i am not using any IDE.....
public class Example extends HttpServlet
public void servise(HttpServletRequest req,HttpServletResponse res)throws ServletException,IOException
out.println("<html><head> <title> hi buddy</title></head>");
out.println("<body> i am impressed with you</body></html>");
sajid dayer wrote:C:\Users\ac\Desktop\apache-tomcat-6.0.44\webapps\demo\WEB-INF\web.xml.txt
and this folder structure is look like this
and i m accessing like this
and also try like this http://localhost:8080/helloworld
Your web.xml looks like a txt file C:\Users\ac\Desktop\apache-tomcat-6.0.44\webapps\demo\WEB-INF\web.xml.txt
Please change to web.xml file and deploy in tomcat.
From your code, looks like you are using the default package for your servlet, which is not a recommended practice.
Use proper package for your servlet and mention the same in web.xml.
Then in your servlet, you should not be overriding the service (not servise)method. Instead override and implement the doGet() and doPost() methods.
sajid dayer wrote:war file means?
Your servlet should be part of a war file to be deployed in Tomcat. You can deploy exploded war as well, but I would recommend war files for starters.
This old but mostly valid thread will be a useful read.
Hope this helps