すべての結果に対して特定のパラメーターを送信したい。
struts.xml
:
<action name="modifierPara" method="modifierPara"
class="ma.ensao.evalmetrics.view.ParametrageAction">
<interceptor-ref name="loginStack" />
<result name="ssCara">
<param name="etat">ssCara</param>
/WEB-INF/admin/projets/parametrer/modifierSubCara.jsp
</result>
<result name="metric">
<param name="etat">metric</param>
/WEB-INF/admin/projets/parametrer/modifierMetric.jsp
</result>
</action>
の値に応じて、異なる引数でetat
実行します。linkController.modifier
ma.ensao.evalmetrics.view.ParametrageAction
:
public class ParametrageAction extends ActionSupport {
private static final long serialVersionUID = 9149826260758390091L;
private Parametrage para;
private Long id;
private ParaManager linkController;
private String etat;
private String etatSuivant;
public ParametrageAction() {
linkController = new ParaManager();
}
public String getSpecificPara() {
try {
this.setPara(linkController.getSpecificPara(getId()));
} catch (Exception e) {
e.printStackTrace();
}
return SUCCESS;
}
public String modifierPara() {
try {
if (etat.equals("cara")){
linkController.modifier(para,"cara");
etatSuivant= "ssCara";
}else if(etat.equals("ssCara")){
linkController.modifier(para,"ssCara");
etatSuivant="metric";
}else if(etat.equals("metric")){
linkController.modifier(para,"metric");
etatSuivant="SUCCESS";
}
} catch (Exception e) {
e.printStackTrace();
}
System.out.println("coucouuuuu from parm action");
return etatSuivant;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public ParaManager getLinkController() {
return linkController;
}
public void setLinkController(ParaManager linkController) {
this.linkController = linkController;
}
public static long getSerialversionuid() {
return serialVersionUID;
}
public Parametrage getPara() {
return para;
}
public void setPara(Parametrage para) {
this.para = para;
}
public String getEtat() {
return etat;
}
public void setEtat(String etat) {
this.etat = etat;
}
}