aspose file tools*
The moose likes Java in General and the fly likes wordings for error message Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "wordings for error message" Watch "wordings for error message" New topic
Author

wordings for error message

Mohan Mehra
Ranch Hand

Joined: Jul 28, 2011
Posts: 66
there is a name field ok. and it these are the conditions:
the first character should not be space followed by alphanumeric and no special characters allowed.

the above line is very long, i just want one short name for this conditions to display to the user when the user enters wrong characters in the name field
Nitin Surana
Ranch Hand

Joined: Jan 21, 2011
Posts: 129

Invalid data. E.g. data d23adsf.
rohit chavan
Ranch Hand

Joined: Oct 08, 2010
Posts: 131

split it up in 2-3 different messages(condition wise) and show appropriate message/s when user gives wrong input.



Hope it helps.
rohit chavan
Ranch Hand

Joined: Oct 08, 2010
Posts: 131

rohit chavan wrote:split it up in 2-3 different messages(condition wise) and show appropriate message/s when user gives wrong input.



Hope it helps.


This is just a pseudo code...
Randall Twede
Ranch Hand

Joined: Oct 21, 2000
Posts: 4339
    
    2

Upper and lower case characters only.

or

Upper and lower case characters only(no spaces).


SCJP
Visit my download page
Winston Gutkowski
Bartender

Joined: Mar 17, 2011
Posts: 7029
    
  16

Mohan Mehra wrote:i just want one short name for this conditions to display to the user when the user enters wrong characters in the name field

Personally, I like Rohit's answer; however, you could eliminate one of your conditions by simply running String.trim() on the input, especially if you tell them in advance that this is what will happen, eg:
Please enter name (leading/trailing spaces will be ignored)

Winston


Isn't it funny how there's always time and money enough to do it WRONG?
Artlicles by Winston can be found here
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19541
    
  16

Also, start with "" instead of null, or your error message will start with "null " - null will be turned into the String "null" when concatenated to a String.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Mohan Mehra
Ranch Hand

Joined: Jul 28, 2011
Posts: 66
thanks you all for the reply. it has helped me.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: wordings for error message
 
Similar Threads
Validating domain name with struts validator
want to show error message when illegal characters are entered in input fields
this one's is easy. need help. wordings for error message
special characters
how to make text field to accept only alphabets