E ai pessoal,
Estou começando a desenvolver com struts 2 e estou com umas dúvidas…
Tenho o seguinte código em minha action
[code]public String execute () throws Exception
{
EntityManager em = getEntityManager ();
if (this.idInstituicao <= 0)
{
SIA siaService = new SIA ();
this.estados = siaService.listarEstado ();
if (this.idEstado > 0)
{
// carregar instituições
this.instituicoes = new ArrayList<Instiuicao>();
Instiuicao inst = new Instiuicao();
inst.setIdInstituicao (1);
inst.setNome ("Instituição Falcatrua");
this.instituicoes.add (inst);
} else
{
this.instituicoes = new ArrayList<Instiuicao> ();
}
return LOGIN;
}
return "index";
}
public String montaInstituicoes () throws Exception
{
SIA siaService = new SIA ();
this.estados = siaService.listarEstado ();
return LOGIN;
} [/code]
Como faço para chamar o segundo método da action?
O xml do meu struts.xml
<action name="index" class="br.estacio.matriculas.control.IndexAction">
<result name="index">/matriculas/index.jsp</result>
<result name="login">/matriculas/login.jsp</result>
</action>
estou chamando da seguinte forma http://localhost:8080/aplicacao/index.action