• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Redirecting pages

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Goo Morning I have problem redirecting my User when they try to Logon Here is my UserController Code:

@RequestMapping(value="registerArtist.html",method = RequestMethod.POST)
public ModelAndView showInput(@RequestParam("username")String username,@RequestParam("password")String password)
{
ModelAndView model= new ModelAndView();
User user = userService.login(username, password);

if(user!= null)
{
if(user.getUsername().equals(username) && user.getPassword().equals(password))
{
model.setViewName("artistRegistration");
}
else
{
model.setViewName("register");
}
}else
{
model.setViewName("index");

}
return model;
}

And here is where I want User to go when their Logon Details are correct this is my JSP:

<form method="post" action="/KyaamiProject/registerArtist.html">
<input type="text" path="username" id="login_username" onfocus="if (this.value=='username') this.value = '';" onblur="if (this.value=='') this.value = 'username';" value="username" placeholder="username" />
<input type="password" path="password" id="login_password" onfocus="if (this.value=='password') this.value = '';" onblur="if (this.value=='') this.value = 'password';" value="password" placeholder="password" />
<input type="submit" value="Log-in" style="height: 25px; width: 50px" class="tbutton small" />
</form>

Please Help!!!
 
Ranch Hand
Posts: 672
4
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
what problem are you facing? TellTheDetails, else people will have to just keep guessing, and you wont get quicker and useful replies.

Show us your UserService class, just guessing, issue may be user returned from UserService is always null.
 
reply
    Bookmark Topic Watch Topic
  • New Topic