404 Error

D

dennisg

Guest
I am having a problem with get my view returning information back to my controller. Each time i keep getting a 404 Error saying the resource is unavailable. So far when the website opens I have a default view named Start and i only have one action which makes it the default:
package com.RUM

class StartController {


def register() {
if(request.method == 'POST') {
def u = new Patient()
u.properties['login', 'password', 'firstName', 'lastName'] = params
if(u.password != params.confirm) {
u.errors.rejectValue("password", "user.password.dontmatch")
return [user:u]
} else if(u.save()) {
session.user = u
redirect controller:"store"
} else {
return [user:u]
}
}
}
}


My view looks like the following(a form asking for several fields), register.gsp:
<body id="body">
<h1>Registration</h1>
<p>Complete the form below to create an account!</p>
<g:hasErrors bean="${user}">
<div class="errors">
<g:renderErrors bean="${user}"></g:renderErrors>
</div>
</g:hasErrors>
<g:form controller="com.start" action="register" name="registerForm">
<div class="formField">
<label for="login">Login:</label>
<g:textField name="login" value="${user?.login}"></g:textField>
</div>
<div class="formField">
<label for="password">Password:</label>
<g:passwordField name="password" value="${user?.password}"></g:passwordField>
</div>
<div class="formField">
<label for="confirm">Confirm Password:</label>
<g:passwordField name="confirm" value="${params?.confirm}"></g:passwordField>
</div>
<div class="formField">
<label for="firstName">First Name:</label>
<g:textField name="firstName" value="${user?.firstName}"></g:textField>
</div>
<div class="formField">
<label for="lastName">Last Name:</label>
<g:textField name="lastName" value="${user?.lastName}"></g:textField>
</div>
<g:submitButton class="formButton" name="register" value="Register"></g:submitButton>
</g:form>
</body>

Any thoughts or ideas would be appreciated.
 
Top