- This topic has 2 replies, 3 voices, and was last updated 9 years, 11 months ago by nawaz777.
-
AuthorPosts
-
dknutsonMemberI’ve setup a project with spring security. My Users table is modified to include a column titled fullname. I want to use fullname when displaying information on who is logged in.
I’ve added the column to the queries in the security-content.xml
<beans:property name=”usersByUsernameQuery” value=”SELECT username,password,enabled,fullname FROM Users WHERE username = ?”/>
<beans:property name=”authoritiesByUsernameQuery” value=”SELECT u.username, u.fullname, a.authorityname FROM Users u JOIN Users_Authorities ua on u.id = ua.user_id JOIN Authorities a on ua.authorities_id = a.id WHERE u.username = ?”/>I’ve also added setter/getter to the Users.java that security created. If I then use the following command –
<sec:authentication property=”principal.fullname”/>
I then get this message –
org.apache.jasper.JasperException: org.apache.jasper.JasperException: org.apache.jasper.JasperException: javax.servlet.ServletException: javax.servlet.jsp.JspException: org.springframework.beans.NotReadablePropertyException: Invalid property ‘principal.fullname’ of bean class [org.springframework.security.authentication.UsernamePasswordAuthenticationToken]: Bean property ‘principal.fullname’ is not readable or has an invalid getter method: Does the return type of the getter match the parameter type of the setter?
Am I even going down the right path with this? What throws me is that the classes generated for User, UserDAO and UserDAOImpl do not show any query statements. Are they even used? Or are they placeholders in case I want to use them – and if so then I need to add the @NameQueries statements and supporting methods.
support-pradeepMemberdknutson,
This is a development query. I would suggest you to cross post on development forums (for ex: http://www.stackoverflow.com) for better support on this.
Let us know if you see any issues in MyEclipse.
nawaz777MemberHi Neil,
I am experimenting with different configurations to see what seems to work best (or work period in some cases). There are so many tempting plugins and scaffolding options that it’s very tempting to over-consume and end up with plugin diabetes!
______________________
C4120-782 vce -
AuthorPosts