-
May 15th, 2012, 04:16 AM
#1
Registration form
Hallo everyone i'm trying to create a registration form. In this form there are field like username,password etc. Moreover i want to add at this form a listbox which i want to contain some fields. These fields are retrieved from a server. I manage to retrieve these fields successfully but i can't enhance them into the form. Here is my code:
My model:
public class Registration {
private String username;
private String password;
private List<String> researchareas;
get/set methods
}
Controller:
The view:
<c:url var="reginto" value="/registration" />
<form:form modelAttribute="registrationAttribute" method="GET" action="${reginto}">
<table>
<tr>
<td><form:label path="username">Username:</form:label></td>
<td><form:input path="username"/></td>
</tr>
<tr>
<td><form:label path="password">Password:</form:label></td>
<td><form:input path="password"/></td>
</tr>
<tr>
<td><form:label path="researchareas">Research area:</form:label></td>
<td>
<form:select path="researchareas" items="${researchareas}" multiple="true" />
</td>
</tr>
I'm taking an exception which says:
org.springframework.beans.NotReadablePropertyExcep tion: Invalid property 'researchareas' of bean class [org.client.model.registration.Registration] Bean property 'researchareas' is not readable or has an invalid getter method: Does the return type of the getter match the parameter type of the setter?
And in the second part i want to send this form to the server.
When i'll send this to the server i want to make a change in the researcharea field.
I don't want to send it as a String, i want to send it as HATOEAS. Actually i receive
it as HATOEAS and with a process i transorm it String.Now i want to do the opposite.
I don't have idea how can i do these two parts.nothing seems to work. Please, if
anyone has an idea, propose it to me.
Thanks in advance
Last edited by alexios.7; Aug 16th, 2012 at 05:56 AM.
-
May 15th, 2012, 11:03 AM
#2
model.addAttribute("researchareas",lista); adds a list or a map?
Amila Domingo
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules