Hello
By using Struts framwork, I can print out error in the welcome.jsp file by
using this code:
<html>
....
<html:errors/>
...
</html>
If there is an errors, the error messages will be printed out. If there is
no error, no message will be printed out.
What I really want is how to know there is error or not. The reason for this
is that if there is any error, I will have to do an action in this
welcome.jsp file (e.g display a small popup window)
Thank you
S.Hoa
Ravi - 21 Nov 2005 05:50 GMT
Hi,
I think , u probably approach in this way....
In the corresponding action servlet which forwards to welcome.jsp...
probably
u can chk for errors using validate method manually... then based on
the result...u can forward to a success or failure page...
Bye,
Ravi.
Tim B - 21 Nov 2005 16:11 GMT
> Hello
>
[quoted text clipped - 14 lines]
> Thank you
> S.Hoa
if you are using Struts version 1.1 or later, try using the
<logic:messagesPresent> tag
to detect and display a particular error:
<logic:messagesPresent>
<html:messages id="mySpecificError" property="firstName">
<bean:write name="mySpecificError"/>
</html:messages>
</logic:messagesPresent>
where firsName is the name you saved the error under when doing your
validation