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
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: 72
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: 132

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: 132

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: 4347
    
    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: 7784
    
  21

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?
Articles by Winston can be found here
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19693
    
  20

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: 72
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