Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-22-2009, 11:40 AM
Member
 
Join Date: Feb 2009
Posts: 1
Rep Power: 0
avinashpaul is on a distinguished road
Default How to get errors in doStart() tag
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.

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;
}
Bookmark Post in Technorati
Reply With Quote
  #2 (permalink)  
Old 04-22-2009, 12:01 PM
RamyaSivakanth's Avatar
Senior Member
 
Join Date: Apr 2009
Location: Chennai
Posts: 583
Rep Power: 1
RamyaSivakanth is on a distinguished road
Default
Hi,
I think you are telling about Struts here.
ActionErrors u might have created for ActionForm.
After adding the errors in ActionErrors,Have you saved like this below
saveErrors(request,errors);
-Regards
Ramya
Bookmark Post in Technorati
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Errors. rocky New To Java 4 04-09-2009 09:05 AM
What is the difference between Semantic Errors and Logical Errors? tlau3128 New To Java 3 03-08-2009 02:51 AM
makeButton errors ljk8950 AWT / Swing 12 08-10-2008 02:10 AM
help with these errors oceansdepth New To Java 3 04-16-2008 05:55 PM
Errors in constructor ai_2007 Advanced Java 0 07-01-2007 06:35 PM


All times are GMT +2. The time now is 07:00 AM.



VBulletin, Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2009, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org