【发布时间】:2018-02-22 20:31:36
【问题描述】:
我目前正在使用 SPRING,我想将用户的详细信息从数据库(我正在使用 postgresql)打印到 HTML 页面(基于百里香的模板),有什么方法可以从我的 Controller 类中做到这一点,以及如何在 HTML Thymeleaf 页面上打印?
这是我的代码的详细信息:
控制器类,
package com.owlexa.cms.web.controller;
// ...
import com.owlexa.cms.dto.UsersDto;
import com.owlexa.cms.model.Role;
import com.owlexa.cms.model.Users;
import com.owlexa.cms.search.UserSearchParams;
import com.owlexa.cms.service.UserService;
@Controller
@RequestMapping("/case")
@SessionAttributes("searchParamSession")
public class CaseController extends BaseController {
Logger log = Logger.getLogger(this.getClass());
@Autowired
private MessageSource messageSource;
@Autowired
UserService userService;
@PreAuthorize("hasAnyAuthority('" + ACLConstant.MENU_CASE_PAYMENT + "','" + ACLConstant.MENU_CASE_ACTIVECASE + "')")
@RequestMapping(value = "/searchCase", method = {RequestMethod.GET, RequestMethod.POST})
public String searchpayment(Model model, HttpServletRequest request) {
return "case/searchCase";
}
}
这是我的html页面
<tr>
<td><label>Provider Name </label></td>
<td><label>:</label></td>
<td>
<input type="text" value="**(GET USER FIRST NAME ?)**" style="width:275px;" readonly="readonly">
</td>
</tr>
提前谢谢,如果您需要其他详细信息,我会更新它。
【问题讨论】:
标签: java html spring postgresql thymeleaf