Galera estou tentando fazer o hello world no struts 2,
mas não sei que erro estou tendo.
bem…
web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
<display-name>struts</display-name>
<filter>
<filter-name>s2</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
</filter>
<filter-mapping>
<filter-name>s2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
struts.xml
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<include file="struts-default.xml"/>
<package name="default" extends="struts-default">
<action name="index" method="execute" class="com.mlc.study.IndexAction">
<result>/index.jsp</result>
</action>
</package>
</struts>
IndexAction
package com.mlc.study;
import com.opensymphony.xwork2.ActionSupport;
public class IndexAction extends ActionSupport {
private static final long serialVersionUID = -6539916823610058982L;
String message = "Ainda não";
public String execute(){
message = "Olá Mundo";
return "Olá Mundo";
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
}
Eu acesso pela url
http://localhost:8080/struts/index.action
Alguém me dá uma luz. :roll:
Foi mal, sei que a dúvida é básica, mas me atolei.
Abraços.