Spring - tag form:textarea must be empty, but is not error -
i want value in spring form based textarea using jstl tag, code given below
how render this?
<form:textarea value="${u.content}" path="content"> </form:textarea>
i error "tag form:textarea must empty, not" on running view page
if form bound commandname/modelattribute don't need value attribute path enough. e.g.
if form declared below.
<form:form id="form" method="post" modelattribute="formbean">
your text area needs just
<form:textarea path="name"/>
where name attribute of formbean object
public class formbean { private string name = "name"; }
pre initialized values.
@requestmapping(value="/personform") public string showform(model model) { //read values db , add model .e.g. person person = new person(); model.addattribute("person", person); return "personform"; }
jsp:
<form:form action="/personform" commandname="person" method="post"> name1: <form:textarea path="name"/> </form:form>
Comments
Post a Comment