java - (SPRING) get user's information from postgresql database and print in thymeleaf html -


i'm using spring, , want print out user's detail database (i'm using postgresql) html page (thymeleaf based template), there way controller class, , how print on html thymeleaf page?

here's detail of code:

controller class,

    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";         }      } 

here's html page

                <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"> </input>                     </td> 

thx in advance, if u need details, update it.

assuming implement userdetails interface , class has property firstname:

<input type="text" data-th-value="${#request.userprincipal.principal.firstname}"> 

Comments

Popular posts from this blog

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -

python - Error while using APScheduler: 'NoneType' object has no attribute 'now' -