display tag query
I have code:
<display:table name="sessionScope.allUserslist" id="user开发者_Go百科List" export="false" pagesize="1">
<display:column title="Select" style="width: 90px;">
<input type="checkbox" name="optionSelected" value="<c:out value='${userList.loginName}'/>"/>
</display:column>
<display:column property="loginName" sortable="false" title="UserName" paramId="loginName"
style="width: 150px; text-align:center" href="./editUser.do?method=editUser"/>
<display:column property="role" sortable="false" title="UserRole" paramId="role"
style="width: 150px; text-align:center"/>
</display:table>
On click of login name, I am moving to a new page where I need to get all the of user, I am just getting the name not the role, on click of link I am calling an action where in the method I am trying to read the data from the form using
User u=(User)form;
u.getRole();
but it's null. Where am I going wrong ?
The link sends only the loginName parameter. You have to decide how to get the rest of the data about the user. Using
u.getRole();
implies that you have a form bean that accepts the role as a value from the client. The link that you create does not send this value to the server.
Maybe the user is in your database and you need to use the loginName to query the database for the rest of the user data including role.
精彩评论