作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我需要以我在文本和在线中查看过的PDF
上载grails
。这是我到目前为止在 Controller 中拥有的
def upload = {
def f = request.getFile('myFile')
if(!f.empty) {
f.transferTo( new File('/some/local/dir/myfile.txt') )
response.sendError(200,'Done');
} else {
flash.message = 'file cannot be empty'
render(view:'uploadForm')
}
}
<g: uploadForm action="upload">
<input type="file" name="myFile"/>
<input type= "submit" value="Upload"/>
</g: uploadForm>
Message: Error processing GroovyPageView: Grails tag [g:] was not closed
Line | Method
->> 461 | doFilter in \grails-app\views\report\create.gsp
Caused by GrailsTagException: Grails tag [g:] was not closed
->> 36 | doCall in C:/Users/Owner/Desktop/grails-app/views/report/create.gsp
<div class="fieldcontain ${hasErrors(bean: reportInstance, field: 'location', 'error')} required">
<label for="location">
<g:message code="report.location.label" default="Location" />
<span class="required-indicator">*</span>
</label>
<g:select id="location" name="location.id" from="${lc.Location.list()}" optionKey="id" required="" value="${reportInstance?.location?.id}" class="many-to-one"/>
</div>
<div class="fieldcontain ${hasErrors(bean: reportInstance, field: 'published', 'error')} required">
<label for="published">
<g:message code="report.published.label" default="Published" />
<span class="required-indicator">*</span>
</label>
<g:datePicker name="published" precision="day" value="${reportInstance?.published}" />
</div>
<div class="fieldcontain ${hasErrors(bean: reportInstance, field: 'title', 'error')} ">
<label for="title">
<g:message code="report.title.label" default="Title" />
</label>
<g:textField name="title" value="${reportInstance?.title}"/>
</div>
<div class="fieldcontain ${hasErrors(bean: reportInstance, field: 'myFile', 'error')} ">
<label for="myFile">
<g:uploadForm action="upload"/>
<input type="file" name="myFile"/>
<input type= "submit" value="Upload"/>
</g:uploadForm>
</label>
</div>
最佳答案
从中删除/
<g:uploadForm action="upload"/>
<g:uploadForm action="upload">
....
</g:uploadForm>
关于grails - 在grails中上传PDF,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20289507/
我有以下正则表达式 /[a-zA-Z0-9_-]/ 当字符串只包含从 a 到z 大小写、数字、_ 和 -。 我的代码有什么问题? 能否请您向我提供一个简短的解释和有关如何修复它的代码示例? //var
我是一名优秀的程序员,十分优秀!