Note that there are some explanatory texts on larger screens.

plurals
  1. POStruts Validation Framework: Validation Summary is blank
    primarykey
    data
    text
    <p><strong>BACKGROUND</strong></p> <p>I am learning Struts 1.x and currently on the validation framework.</p> <p><strong>PROBLEM</strong></p> <p>I have it in a semi-working condition. Currently it is showing the validation errors, but in a javascript alert.. and then the validation summary (the thing generated by <code>&lt;html:error&gt;</code>) is blank.. well, it has 3 bullet points where the validation errors are supposed to be, but no text.</p> <ol> <li>I would not have expected it to use a javascript alert. I only want the validation summary. How can I turn this off, if possible?</li> <li>Why is the validation summary missing text?</li> </ol> <p><strong>EDIT</strong></p> <p>Here is some of the code, if it helps.</p> <p>struts-config.xml</p> <pre><code>&lt;form-beans&gt; &lt;form-bean name="ProductActionForm" type="actionForms.ProductActionForm"/&gt; &lt;/form-beans&gt; </code></pre> <p>validation.xml</p> <pre><code>&lt;form name="ProductActionForm"&gt; &lt;field property="name" depends="required"&gt; &lt;arg key="ProductActionForm.name"/&gt; &lt;/field&gt; &lt;field property="price" depends="required,float"&gt; &lt;arg key="ProductActionForm.price"/&gt; &lt;/field&gt; &lt;field property="quantityInStock" depends="integer,intRange"&gt; &lt;arg0 key="ProductActionForm.quantityInStock"/&gt; &lt;arg1 name="intRange" key="${var:min}" resource="false"/&gt; &lt;arg2 name="intRange" key="${var:max}" resource="false"/&gt; &lt;var&gt; &lt;var-name&gt;min&lt;/var-name&gt; &lt;var-value&gt;0&lt;/var-value&gt; &lt;/var&gt; &lt;var&gt; &lt;var-name&gt;max&lt;/var-name&gt; &lt;var-value&gt;9999&lt;/var-value&gt; &lt;/var&gt; &lt;/field&gt; &lt;/form&gt; </code></pre> <p>JSP HTML:</p> <pre><code>&lt;html:javascript formName="ProductActionForm" /&gt; &lt;html:errors&gt;&lt;/html:errors&gt; &lt;html:form action="/AddProductAction" method="post" onsubmit="validateProductActionForm(this);"&gt; &lt;table class="table table-striped"&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td&gt;Name: &lt;/td&gt; &lt;td&gt;&lt;html:text property="name" /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Price: &lt;/td&gt; &lt;td&gt;&lt;html:text property="price" /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;# In Stock &lt;/td&gt; &lt;td&gt;&lt;html:text property="quantityInStock" /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;/td&gt; &lt;td&gt;&lt;input type="submit" class="btn btn-primary" value="Submit" /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;/html:form&gt; </code></pre> <p><strong>EDIT 2</strong></p> <p>Here are some screenshots:</p> <p>Showing javascript alert: <img src="https://i.stack.imgur.com/HRnxJ.png" alt="Showing javascript alert"></p> <p>Showing blank validation summary: <img src="https://i.stack.imgur.com/HD5w3.png" alt="Showing blank validation summary"></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload