This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Five Lines of Code and have Christian Clausen on-line!
See this thread for details.
Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Spring MVC 3: java.lang.IllegalStateException

 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
Could someone help me understand what am I doing wrong in the following code due to which I am getting this error:


UserManagementController.java



signUp.jsp


Could someone help me understand it?

Thanks.
 
ranger
Posts: 17346
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In your jsp don't you need

#{} around all the variable names?

Mark
 
Rohit Bhal
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Mark
I am using the User backing object for form representation. Do you think we need ${} around all the variables for that?
I have never handled form using ${} around variables in spring mvc 3.
I am just not able to understand why am I getting this error and what am I doing wrong here?

Thanks for reply though:)

 
Mark Spritzler
ranger
Posts: 17346
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Deshraj Kiran wrote:Hi Mark
I am using the User backing object for form representation. Do you think we need ${} around all the variables for that?
I have never handled form using ${} around variables in spring mvc 3.
I am just not able to understand why am I getting this error and what am I doing wrong here?

Thanks for reply though:)



Yes "$" not "#" sorry got my symbols mixed up.

Which uses ${myvar}, if you don't have it, the jsp has no idea what myvar by itself means.

Mark
 
Rohit Bhal
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Mark
I was mistakenly using the wrong import for ModelAndView.
I was supposed to use org.springframework.web.servlet.ModelAndView but the one I was mistakenly using was org.springframework.web.portlet.ModelAndView.

I've got the code working now.

Thanks
 
Mark Spritzler
ranger
Posts: 17346
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Deshraj Kiran wrote:Hi Mark
I was mistakenly using the wrong import for ModelAndView.
I was supposed to use org.springframework.web.servlet.ModelAndView but the one I was mistakenly using was org.springframework.web.portlet.ModelAndView.

I've got the code working now.

Thanks



Cool.

Mark
 
If you open the box, you will find Heisenberg strangling Shrodenger's cat. And waving this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic