Opa galera, blz?
to usando o ubuntu 9.10
baixei o tomcat pelo site dele mesmo,
extrai ele em downloads -> tomcat6
criei um servlet só pra testa
package br.com.caelum.servlet;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class OiMundo extends HttpServlet{
@Override
protected void service(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException{
PrintWriter pw = response.getWriter();
pw.println("<html>");
pw.print("Caelum explica");
pw.print("</html>");
}
}
e meu web.xml ficou assim
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<display-name>prjTeset</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
<servlet>
<servlet-name>servletDeTestes</servlet-name>
<servlet-class>br.com.caelum.servlet.OiMundo</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>servletDeTestes</servlet-name>
<url-pattern>/oi</url-pattern>
</servlet-mapping>
</web-app>
bem, quando eu do um Run On Server
ele aparece o seguinte erro
que a porta 8080 ja esta sendo usada por outra aplicacao
e tal…
como faço pra resolver isso?
alias…
qnd vo no terminal e
coloco
max@max-desktop:~/Downloads/apache-tomcat-6.0.26/bin$ ./startup.sh
Using CATALINA_BASE: /home/max/Downloads/apache-tomcat-6.0.26
Using CATALINA_HOME: /home/max/Downloads/apache-tomcat-6.0.26
Using CATALINA_TMPDIR: /home/max/Downloads/apache-tomcat-6.0.26/temp
Using JRE_HOME: /usr
Using CLASSPATH: /home/max/Downloads/apache-tomcat-6.0.26/bin/bootstrap.jar
max@max-desktop:~/Downloads/apache-tomcat-6.0.26/bin$
e vo em local localhost:8080 a msg é
It works !
qnd coloco o /oi.jsp
da 404
ajudaaa xD