This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JSP and the fly likes Displaying an inline error message in a JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Displaying an inline error message in a JSP" Watch "Displaying an inline error message in a JSP" New topic
Author

Displaying an inline error message in a JSP

Jahnavi Kondapaneni
Ranch Hand

Joined: Jan 25, 2008
Posts: 56
Hi all,

Can anybody help me out in displaying an inline error message in a JSP instead of using displaying alerts using Javascript.
Thanks in advance


Regards
Janu
Swastik Dey
Rancher

Joined: Jan 08, 2009
Posts: 1449
    
    6

You might use inline style sheet for this, in the following example if you leave the text field blank it will display an error message, and once again when the text field gets the focus that message will disappear



Swastik
Jahnavi Kondapaneni
Ranch Hand

Joined: Jan 25, 2008
Posts: 56
Swastik,

Thank you.
Your code is working....
But I want to know what is the use of <fmt> tag .
Swastik Dey
Rancher

Joined: Jan 08, 2009
Posts: 1449
    
    6

Its a part of JSTL and can be used to display any formatted output for e.g



You can also set the date patterns, time zone etc.
 
jQuery in Action, 2nd edition
 
subject: Displaying an inline error message in a JSP
 
Similar Threads
Please wait message
Displaying database results with JSTL (was 'Struts')
ActionErrors from Action Class are not displaying in struts jsp page
Struts
error-page from JSP displaying inline instead of _self