galera, decidi tentar aprender struts2, so que ta dando um erro e nao consigo achar o problema, passei a tarde inteira tentando pensar nisso, ate o povo la do trabalho nao soube o por que nao esta rodando!
ja comparei com varios hellowords que deu certo e parece estar tudo em ordem....
voces conseguem ver algum problema???
struts.xml
<?xml version="1.0" encoding="UTF-8"?>
<struts>
<!-- <include file="struts-default.xml" /> -->
<package name="default" extends="struts-default">
<action name="HelloStruts2" class="struts2.action.HelloStruts2" >
<result name="SUCCESS">/struts2/HelloStruts.jsp</result>
</action>
</package>
</struts>
HelloStruts2.jsp
package struts2.action;
public class HelloStruts2 {
private String nome;
public HelloStruts2() { }
public String execute(){
this.nome="josé";
return "SUCCESS";
}
public String getNome() {
return nome;
}
public void setNome(String nome) {
this.nome = nome;
}
}
web.xml
<?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>struts2</display-name>
<!-- filtro struts2 -->
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
index.jsp
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@taglib uri="/struts-tags" prefix="s"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>HelloWordStruts2</title>
</head>
<body>
<center>
<s:a href="HelloStruts.action">Clique aqui!</s:a>
</center>
</body>
</html>
HelloStruts.jsp
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@taglib uri="/struts-tags" prefix="s" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>HelloWordStruts2</title>
</head>
<body>
<center>
<h1>Olá - <s:property value="nome" /></h1>
</center>
</body>
</html>
minha estrutura de diretorios está assim
[img] http://www.postimage.org/image.php?v=Pq1b_onS
[/img]
OBS: struts.xml está fora do pacote struts2.action!
eu mando rodar e ele simplismente da erro 404.
eu faço deploy dele no tomcat 6 e vou em status do servidor e todas as aplicaçoes estao on ,somente essa aplicaçao fica off, ja tentei startar mas nao sobe, sempre fica off !!!!
minha cabeça está borbulhando aqui!! :evil: :evil: :evil:
por favor, alguem sabe o que pode estar acontecendo???
muito obrigado!