No mapping found for HTTP request with URI [/Springmvc/test] in DispatcherServlet with dispatche
原因:表单有日期,实体对应字段也是日期类型,所以报错,把实体和库字段设置程String,就会成功保存。
ERROR [org.springframework.web.context.ContextLoader] Context initialization failed
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'customUseController': Unsatisfied dependency expressed through field 'customUseService'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.huotu.scrm.service.service.customUse.CustomUseService' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
原因:serviceImpl继承service接口,应该在serviceImpl上面增加注解@Service,如下
@Service
@Transactional
public class CustomUseServiceImpl implements CustomUseService {
org.thymeleaf.exceptions.TemplateInputException
错误原因是each循环之后
<tr th:each="customBrs,cusBrs:${customBRSPage}">
<th th:text="${customBrs.oddNum}"></th>
<th th:text="${customBrs.BRS007}"></th>
<th th:text="${customBrs.BRS003}"></th>
<th th:text="${customBrs.BRS004}"></th>
<th th:text="${customBrs.BRS005}"></th>
<th th:text="${customBrs.BRS006}"></th>
<th>
<div>
<input type="button" value="预览" class="btn-pre" onclick="pre(this)">
<input type="button" value="编辑" class="btn-pre" onclick="editBrs(this)">
<input type="button" value="删除" class="btn-pre" onclick="delBrs(this)">
</div>
</th>
</tr>
把
${customBrs.oddNum}
//写成
${cusBrs.oddNum}