E ae galera, blz?
Estou criando um Hello World com struts2 mas to recebendo um erro que não consegui resolver.
Meu código é bem simples:
Web.xml
[code]<?xml version="1.0" encoding="UTF-8"?>
ProjetoStruts
[/code]
Action
[code]package com.fiap.action;
import com.opensymphony.xwork2.ActionSupport;
public class HelloWorldAction extends ActionSupport {
private String message;
public String execute()
{
setMessage("Essa é uma mensagem do Hello World do Struts 2!");
return SUCCESS;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
}
[/code]
jsp
[code]<?xml version="1.0" encoding="ISO-8859-1" ?>
<jsp:root xmlns:jsp=“http://java.sun.com/JSP/Page” version=“2.0”>
<jsp:directive.page contentType=“text/html; charset=ISO-8859-1"
pageEncoding=“ISO-8859-1” session=“false”/>
<jsp:output doctype-root-element=“html"
doctype-public=”-//W3C//DTD XHTML 1.0 Transitional//EN"
doctype-system=“http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
omit-xml-declaration=“true” />
<%@ page contentType=“text/html; charset=UTF-8” %>
<%@ taglib prefix=“s” uri=”/struts-tags” %>
struts.xml
[code]<?xml version="1.0" encoding="UTF-8" ?>
/HelloWorld.jsp [/code]tenho as seguintes libs adicionadas no projeto:
asm-3.1.jar
asm-commons-3.1.jar
commons-beanutils-1.8.0.jar
commons-chain-1.2.jar
commons-collections-3.1.jar
commons-digester-2.0.jar
commons-fileupload-1.2.2.jar
commons-io-2.0.1.jar
commons-lang-2.5.jar
commons-lang3-3.1.jar
commons-logging-1.1.1.jar
commons-logging-api-1.1.jar
commons-validator-1.3.1.jar
freemarker-2.3.16.jar
javassist-3.11.0.GA.jar
ognl-3.0.1.jar
struts2-convention-plugin-2.2.3.1.jar
struts2-core-2.2.3.1.jar
xwork-core-2.2.3.1.jar
Eu tento acessar pela URL: http://localhost:8090/ProjetoStruts/HelloWorldAction/hello
E dá o seguinte erro:
There is no Action mapped for namespace [/HelloWorldAction] and action name [hello] associated with context path [/ProjetoStruts]
já tentei variar essa URL, por exemplo: http://localhost:8090/ProjetoStruts, http://localhost:8090/ProjetoStruts/hello
E sempre dá esse There is no action…
desde já agradeço a quem puder ajudar.