Results 1 to 2 of 2
  1. #1
    avinashpaul is offline Member
    Join Date
    Feb 2009
    Posts
    1
    Rep Power
    0

    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;
    }

  2. #2
    RamyaSivakanth's Avatar
    RamyaSivakanth is offline Senior Member
    Join Date
    Apr 2009
    Location
    Chennai
    Posts
    835
    Rep Power
    6

    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

Similar Threads

  1. Errors.
    By rocky in forum New To Java
    Replies: 4
    Last Post: 04-09-2009, 08:05 AM
  2. Replies: 3
    Last Post: 03-08-2009, 01:51 AM
  3. makeButton errors
    By ljk8950 in forum AWT / Swing
    Replies: 12
    Last Post: 08-10-2008, 01:10 AM
  4. help with these errors
    By oceansdepth in forum New To Java
    Replies: 3
    Last Post: 04-16-2008, 04:55 PM
  5. Errors in constructor
    By ai_2007 in forum Advanced Java
    Replies: 0
    Last Post: 07-01-2007, 05:35 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •