• 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:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

Spring MVC - Search query

 
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can somebody please post a small example on how to implement in spring mvc a simple search page ..

search page -> users enters criteria -> search results on the same page.

I do not want the whole code.

Here is what I am trying and is not working ( ontroller class)


I now need to add this to the model and return to the same page, I came from.. How do I do this? Model object is not available to onSubmitMethod.

Here is an extract from from my view resolver.


I need to go back to "searchService" and with the model updated.
Also, I tried getFormView() but that does not seem to work.. plus the model still needs to go to jsp..

Many Thanks
 
rahul khanna
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I tried creating a model inside the "onSubmit" method and then do


I then get the following exception :




Many Thanks
 
Ranch Hand
Posts: 1936
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

rahul khanna wrote:I tried creating a model inside the "onSubmit" method and then do



You should use getFormView method, and you have to use Map and put command object in Map as well.

The code should be like this:

reply
    Bookmark Topic Watch Topic
  • New Topic