0

I am getting the Model Attribute Object's, Key and value pair in the url,I have to hide those key-value pair or else it should be values alone.

Ex:consider the following url,

http://localhost:8080/Sample/showPage.htm?

name=ram&std=II&sec=A

&Search=Get

this name,std and sec forms the model attribute object 'StudentDetails' pojo class,I want the url like below:

 http://localhost:8080/Sample/showPage.htm?

ram/II/A/Get

user2507974
  • 122
  • 1
  • 2
  • 15

1 Answers1

0

In the Controller, assuming that you have a method call showPage

Use the following,

   @RequestMapping(value = "/{name}/{std}/{sec}/{Search}", method = RequestMethod.GET)
   public String showPage(@PathVariable("name") String name,@PathVariable("std") String std,
                          @PathVariable("sec") String sec,@PathVariable("Search") String Search) throws Exception {        
        // use the values name, std, sec and search as you need.     
        }
Santosh
  • 17,667
  • 4
  • 54
  • 79