• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Spring MVC 3: java.lang.IllegalStateException

 
Rohit Bhal
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.
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac 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
Sheriff
Posts: 17278
6
IntelliJ IDE Mac 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
Sheriff
Posts: 17278
6
IntelliJ IDE Mac 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic