srinivas
srinivas

Reputation: 21

how to display a blank space instead of a "0" in the input spring tag

In my application, i need to have a text field (MNC ID), which is int type,empty while its displayed in the form as a blank space, but instead its appering as "0" as the value.How can i do this?I am using but as i found that i dont have a value tag in the form:input of spring tag, how can i include a value tag in the form:input tag so the i can leave it blank ""? pls help me in this regard

Upvotes: 1

Views: 2861

Answers (2)

axtavt
axtavt

Reputation: 242706

You can create a custom PropertyEditor which would convert 0 to empty string and vice versa. See, for example, here.

Upvotes: 0

user41871
user41871

Reputation:

Use type Integer instead of type int.

Upvotes: 5

Related Questions