Olá
Pessoal segue o arquivo de propertie o jsp e minha action, estou tentando pegar no jsp <s:textfield label="%{getText(‘login.usu’)}"
Deveria mostrar para mim : User Name porem não mostra nada alguem saberia me dizer o que falta?
Grato
LoginAction.properties
====================Propeties===============
login=Login
login.usu=User Name
login.senha=Password
============================jsp=============================
<%@ taglib prefix="s" uri="/struts-tags" %>
<html>
<head>
<title>Validation - Login</title>
<s:head/>
</head>
<body>
<s:form action="checkLogin" validate="true">
<ul>
<li id="liForm">
<label class="desc">Login</label>
<s:textfield label="%{getText('login.usu')}" name="usu" > </s:textfield>
<s:password label="Senha" name="senha" > </s:password>
<s:submit value="Entrar"/>
</li>
</ul>
</s:form>
</body>
</html>
//===============LoginAction.java==============================
package example;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import org.apache.struts2.interceptor.SessionAware;
import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
import example.ClienteBean;
import example.ClienteDAO;
import java.util.Map;
public class LoginAction extends ActionSupport implements SessionAware{
private static final long serialVersionUID = -300519118088286674L;
private Map<String, Object> map;
private String usu = "";
private String senha = "";
private ArrayList clientes = new ArrayList();
public String execute(){
Map session = ActionContext.getContext().getSession();
ActionContext context = ActionContext.getContext();
if (hasActionErrors() || hasFieldErrors()){
return "input";
}
else {
try {
ClienteDAO cli = new ClienteDAO();
setClientes(cli.BuscaCliente());
} catch (Exception e1) {
System.out.println("Erro clienteDAO:" + e1.getCause() );
}
return "sucesso";
}
}
@SuppressWarnings("unchecked")
public void setSession(Map map){
this.map = map;
}
public String getSenha() {
return senha;
}
public void setSenha(String senha) {
this.senha = senha;
}
public void setUsu(String usu) {
this.usu = usu;
}
public ArrayList getClientes() {
return clientes;
}
public void setClientes(ArrayList clientes) {
this.clientes = clientes;
}
public String getUsu() {
return usu;
}
}