• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to get errors in doStart() tag

 
avi paul
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have overloded TextTag so that it can show a alert.gif beside the text box whoes validation fails , but even though errors are present the RequestUtils.getActionErrors() is not fetching the code is below ,can anybody tell me what is wrong. the System.out.println("errors"+errors.size()+errors.i sEmpty()); is printing 0.

I am trying to display as shown in the attachment
public int doStartTag() throws JspException {
int returnValue = super.doStartTag();
ActionErrors errors = RequestUtils.getActionErrors(pageContext,
this.property);

System.out.println("errors"+errors.size()+errors.i sEmpty());
if ((errors != null) && (!errors.isEmpty())) {
String imageSrc = RequestUtils.message(pageContext, getBundle(),
getLocale(), this.errorImageKey);
if (imageSrc != null) {
StringBuffer imageResults = new StringBuffer();
imageResults.append("<img src=\"");
imageResults.append(imageSrc);
imageResults.append("\"");
// Print the image to the output writer
ResponseUtils.write(pageContext, imageResults.toString());
}
}
return returnValue;
}
required.jpg
[Thumbnail for required.jpg]
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why not just extend/modify the theme you're using? Much easier.
 
avi paul
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
David Newton wrote:Why not just extend/modify the theme you're using? Much easier.

can you please be more elaborate on it , what dose it mean when you said "theme"
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic