Struts validator message


Web tier: servlets, JSP, Web frameworks: Struts validator message

  1. Struts validator message (1 messages)

    I am using the Validator framework for my Struts 1.2.7 app. The application has a login page(Login.jsp) and after a successful login the user is taken to a selection page (SelectAR.jsp). There is one dropdown on the selection page for which a selection is required to be made. The validation works fine but somehow the validation error header message (under logic:messagesPresent) shows up even when SelectAR.jsp is first loaded (no validation errors).

    Here is my jsp -

    <%@taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
    <%@taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
    <%@taglib uri="/WEB-INF/app.tld" prefix="app"%>
    <link href="<html:rewrite page="/css/argenerator.css" />" rel="stylesheet" type="text/css">
    <title>AR# Generator - Generate AR#</title>
    <body topmargin="0">
    <html:img page="/img/banner.jpg" /><br>
    <font size="2">Welcome, <bean:write name="user" property="firstName" />.
    <bean:message key="errors.validation.header"/> (***this message***)
    <html:messages id="error">
    <bean:write name="error"/><br>
    <table width="790" cellspacing="0" cellpadding="0">
    <tr><td> </td></tr>
    <html:form action="" method="post">
    <tr><td align="center">
    <h3>Generate AR# for
    <html:select property="region" size="1">
    <html:option value="">--Select One--</html:option>
    <html:optionsCollection name="regions" value="region" label="regionName"/>
    <tr><td align="center">
    <html:submit><bean:message key="button.generate" /></html:submit>
    <html:link page="/" styleClass="coolButton">Exit</html:link>
    <%@include file="Contact.jsp"%>

    Why is it entering the logic:messagesPresent loop when there are no errors generated when the page first loads?
  2. Struts validator message[ Go to top ]