java - Cannot handle request by requestMapping -


i need handle requests like

www.example.com/student/thisisname?age=23&country=uk&city=london 

i interested in thisisname part , value of city parameter.

i have following requestmapping not work. tried {name}{.*:city} well.

@requestmapping(value = "/{name:.*}{city}", method = requestmethod.get) 

you can 2 ways. either using @requestparam or @pathvariable

  1. by using @requestparam
@requestmapping(value = "/name", method = requestmethod.get) public void somemethod(@requestparam string city){} 
  1. by using @pathvariable
@requestmapping(value = "/name/{city}", method = requestmethod.get) public void somemethod(@pathvariable string city){} 

you can use of method need concentrate on url


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -