I'm trying to put together a form that uses the bang notation for action
methods and for whatever reason I can't seem to get the aliased
validation XML files to work and have to resort to some fairly nasty
@SkipValidation hacks. Anyone see this also or is there a patch for it
in a version later than 2.0.6?
Here's my example form and action:
<struts:form action="newsPersist!save">
<struts:textarea name="news.article" label="Article body"
labelposition="top" required="true"/>
<struts:textfield name="news.date" label="Post date"
labelposition="top" required="true"/>
<struts:submit name="Submit" value="Submit"/>
</struts:form>
public class NewsPersist extends BaseAction {
private Integer id;
private News news;
@Inject
public NewsPersist(JPAService jpaService, Configuration configuration) {
super(catapultBeanService, configuration);
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public News getNews() {
return news;
}
public void setNews(News news) {
this.news = news;
}
@SkipValidation
public String add() {
return "form";
}
@SkipValidation
public String edit() {
news = jpaService.getById(News.class, id);
if (news == null) {
addActionError("News item was removed.");
return "notFound";
}
return "form";
}
public String save() {
jpaService.persist(news);
return "success";
}
}
And finally, I have a single validation file named:
NewsPersist-validation.xml
What I figured would work was an XML file named:
NewsPersist-save-validation.xml
This doesn't seem to work however. Any ideas?
-bp
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]