create.gsp
<g:uploadForm action="save" >
<fieldset class="form">
<g:render template="form"/>
</fieldset>
<fieldset class="buttons">
<g:submitButton name="create" class="save" value="${message(code: 'default.button.create.label', default: 'Create')}" />
</fieldset>
</g:uploadForm>
------------------------------------------------------------------------------------------------
_form.gsp
<div class="fieldcontain ${hasErrors(bean: QM_NewsInstance, field: 'add_date', 'error')} required">
<label for="add_date">
<g:message code="QM_News.add_date.label" default="Adddate" />
<span class="required-indicator">*</span>
</label>
<g:datePicker name="add_date" precision="day" value="${QM_NewsInstance?.add_date}" />
</div>
<div class="fieldcontain">
<label for="type">
File
</label>
<input type="file" id="upload" name="upload"/>
</div>
----------------------------------------------------------------------
在控制器中获取add_date为空,求指点一下。
另外新建grails群327195023。一起讨论学习。