Note that there are some explanatory texts on larger screens.

plurals
  1. POStruts2 Validation Messages do not show
    primarykey
    data
    text
    <p>I have a strange issue down here. My struts2 <code>addFieldError(fieldName,ErrorMessage)</code> IS NOT showing the error on my jsp</p> <p>also I AM extending <code>ActionSupport</code> , and in my Struts.xml I DO NOT have my theme set to simple.</p> <p>My ActionListener is</p> <pre><code>package pebsms.actionBeans.UserActions; import pebsms.business.UserBusiness.Impls.UserBusinessImpl; import com.opensymphony.xwork2.ActionSupport; public class LoginAction extends ActionSupport { UserBusinessImpl userBusiness; public String userPassword; public String userName; public String getUserName() { return userName; } public void setUserName(String userName) { this.userName = userName; } public String getUserPassword() { return userPassword; } . public String execute() { return SUCCESS; } public void validate() { if (getUserPassword().length() &lt;= 0) addFieldError(userPassword, "Enter Password"); if (getUserName().length() &lt;= 0) addFieldError(userName, "Enter UserName"); if (!userBusiness.authenticateUser(userName, userPassword)) addActionError("User authentication failed");** } } </code></pre> <p>My Struts.xml is</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8" ?&gt; &lt;!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2.0.dtd"&gt; &lt;struts&gt; &lt;constant name="struts.devMode" value="true" /&gt; &lt;package name="default" namespace="/" extends="struts-default" &gt; &lt;action name="Login" &gt; &lt;result&gt;/pages/LoginScreen/Login.jsp&lt;/result&gt; &lt;/action&gt; &lt;action name="LoginAction" class="userAction"&gt; &lt;result name="input"&gt;/pages/LoginScreen/Login.jsp&lt;/result&gt; &lt;/action&gt; &lt;/package&gt; &lt;/struts&gt; </code></pre> <p><code>addFieldError</code> doesn't come up with the error messages on my jsp like it should automatically, even though the method is called inside the validate().</p>
    singulars
    1. This table or related slice is empty.
    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.
    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