|
<body>
<s:form action= "Displayerrorinfo" method= "POST" theme= "simple" >
<H1 align= "center" style= "Color:blue" >
Displayerrorinfoforstruts2demo1 (use OGNL to get the content of the stack, recommended)
<H2 dir= "RTL" >
Smooth Finishing
1.1.All Errorinfos (MAP): <s:property value= "Errors"/><br>
1.2.All Fielderrorsinfos (MAP): <s:property value= "Fielderrors"/><br>
2.1.DisplayErrorInfo in errors (errors.displayerrorinfo[0]):<s:textfield/>
<font color= "Red" >
<s:property value= "errors.displayerrorinfo[0]"/>
</font><br>
2.2.DisplayErrorInfo in errors (errors[' Displayerrorinfo '][0]):<s:textfield/>
<font color= "Red" >
<s:property value= "errors[' Displayerrorinfo '][0]"/>
</font>
<br>
<font color= "Green" > Note: When you get the value, you can customize it in your own format </font>
<br>
2.3.DisplayErrorInfo in errors (generally not used to [1], here is only testing):<s:textfield/>
<font color= "Red" >
<s:property value= "errors.displayerrorinfo[1]"/>
</font>
<br>
3.1.DisplayErrorInfo in Fielderrors (fielderrors.displayerrorinfo[0]):<s:textfield/>
<font color= "Red" >
<s:property value= "fielderrors.displayerrorinfo[0]"/>
</font>
<br>
3.2.DisplayErrorInfo in Fielderrors (fielderrors[' Displayerrorinfo '][0]):<s:textfield/>
<font color= "Red" >
<s:property value= "fielderrors[' Displayerrorinfo '][0]"/>
</font>
<br>
<font color= "Green" > Note: It is recommended to use Fielderrors value, which is used in the action this.addfielderror</font>
<br>
4.0.displayerrorinfo-user.username (correct expression. errors[' User.username '][0]):<s:textfield/>
<font color= "Red" >
<s:property value= "errors[' User.username '][0]"/>
</font>
<br>
4.1.displayerrorinfo-user.username (correct expression. fielderrors[' User.username '][0]):<s:textfield/>
<font color= "Red" >
<s:property value= "fielderrors[' User.username '][0]"/>
</font>
<br>
<font color= "Blue" >
4.2.displayerrorinfo-user.username (wrong expression 1.errors.%{user.username}[0]):<s:textfield/>
<font color= "Red" >
<s:property value= "errors.%{user.username}[0]"/>
</font>
<br> 4.3.displayerrorinfo-user.username (wrong expression 2.errors.# {user.username}[0]):<s:textfield/>
This method itself has a problem with the language, please see the specification of JSP specification
<br> 4.4.displayerrorinfo-user.username (wrong expression 3.%{errors.user.username}[0]):<s:textfield/>
<font color= "Red" >
<s:property value= "%{errors.user.username}[0]"/>
</font>
<br> 4.5.displayerrorinfo-user.username (wrong expression 4.errors.user.username):<s:textfield/>
<font color= "Red" >
<s:property value= "Errors.user.username"/>
</font>
<br>
</font>
</s:form>
<s:debug/>
</body>
|