Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / November 2005

Tip: Looking for answers? Try searching our database.

a Struts question

Thread view: 
shoa - 20 Nov 2005 02:06 GMT
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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.