• 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
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

Spring MVC-Data is not Displaying in View Page What I bind in Controller  RSS feed

 
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friends,
I am new to Spring Mvc. I tried on HTML form using @RequestParam annotation in Spring Mvc. But Output is not displaying in view page. Please help me.

Advance Thanks
Surendra Meruva

web.xml:-



dispatcher-servlet.xml:-


StudentAdmissionController:-


AdmissionForm.jsp:-


AdmissionSuccuess.jsp:-

output.JPG
[Thumbnail for output.JPG]
When I run the application I got this output..
 
Ranch Hand
Posts: 672
4
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you check with ModelAndViews addAttribute method instead of using addObject?

If addAttribute also is not working, then can you check by giving ${2+2} and see if the EL is working.
 
meruva surendra
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Prasad Krishnegowda wrote:Can you check with ModelAndViews addAttribute method instead of using addObject?

If addAttribute also is not working, then can you check by giving ${2+2} and see if the EL is working.





Its showing no such method when using addAttribute and i gave ${2+2} the it is coming fine on view as "4"
 
Prasad Krishnegowda
Ranch Hand
Posts: 672
4
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok. just to check, can you add this object and check if its been accessible in JSP.
m1.addObject("test","test123");
 
meruva surendra
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Prasad Krishnegowda wrote:ok. just to check, can you add this object and check if its been accessible in JSP.
m1.addObject("test","test123");



Now also not coming
 
Prasad Krishnegowda
Ranch Hand
Posts: 672
4
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you change the method below

to
 
meruva surendra
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Prasad Krishnegowda wrote:Can you change the method below

to



Ichanged method. but it saying no such method found.
System.out.println("Name:"+name); // Here printed what i entered in form.for exmaple i enter surendra. here that name printed. is Empty method also printing false
 
Prasad Krishnegowda
Ranch Hand
Posts: 672
4
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
where it is telling nosuchmethod?Did you notice the change i have made in the method?
Remove the ModelAndView reference, we are now using ModelMap directly and returning the view as String.
 
meruva surendra
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
on Eclipse IDE.
 
Prasad Krishnegowda
Ranch Hand
Posts: 672
4
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
which part of the code is producing that error?
Did you replace the entire function with what i posted?
 
meruva surendra
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i replaced you are given function but output is same
 
meruva surendra
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Its coming ...thank you so much...if you don't mind will you give yourr mail?
 
Prasad Krishnegowda
Ranch Hand
Posts: 672
4
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can send an PM to me..
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your code is absolutely fine which you have send, the reason why you are not able to get the desired output on browser is because you have imported the portlet package in the controller instead of servlet
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!