File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes custom error messages Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "custom error messages" Watch "custom error messages" New topic

custom error messages

Nicola Guy
Ranch Hand

Joined: Jun 23, 2004
Posts: 91
hi i'm doing a basic log in application to learn how to use struts. and was just wondering if anyone could help me with this minor problem.

when logging in i have it set that if the user doesn't enter their username or password that the page is reloaded and an error message appears beside the missing field.

However the error message has "null" placed at the start and end of the message.

The actual text itself ie "Username is required" comes form a .properties file

any ideas

thanx in advance
Pankaj Narang
Ranch Hand

Joined: Jun 07, 2004
Posts: 81
hi guy

Check the .properties file in thet the message where you have writen "Username is required" check for the symbol like {0} if this present that means it take some parameters remove that and you will not get null then

Try this , may solve your problem
Best Regards
I agree. Here's the link:
subject: custom error messages
It's not a secret anymore!