a Struts question

S

shoa

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
 
R

Ravi

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.
 
T

Tim B

shoa said:
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
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Struts I18N 2
Struts 3
Javascript and Struts, question 2
Struts Question 3
Struts Tiles Error 0
Basic Struts work flow question 0
Struts link problem 2
Struts 2 advice with displaying a List 3

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top