1

hi I would like to know how to place a attribute "value","defaultValue" or "placeholder" from form:input

Original Code

 <form:input path="ggpath" cssStyle="width:100%"/>

What I want

 <form:input path="ggpath" cssStyle="width:100%" value="example"/>

but if I place value attribute. It does give me an error. Any help would be greatly appreciated

Jon
  • 384
  • 6
  • 18

2 Answers2

1

Use following code

<form:input path="ggpath" style="width:100%" placeholder="example"/>
Balwinder Singh
  • 2,272
  • 5
  • 23
  • 34
0

One way to do this is to keep that default value in command object like

private string ggpath="example";

This will be displayed as default value in the form. From spring 3.0 you can use placeholder tag also directly

Krishna
  • 1
  • 2