• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

problem in reading requestMapping in spring mvc 3.0

 
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i want to handle a URL which comes from the client side like this: $.ajax({url : "someString/"+ catID+"/"+productName+"/"+imageSrc,
in that above url the imageSrc contains multiple forward slashes("/").
now my controller class method for handling this looks like this:

@RequestMapping(value = "/someString/{categoryId}/{productId}/{imgSrc}", method = RequestMethod.GET)
public void someMethod(Model model,
@PathVariable("categoryId") String categoryId, @PathVariable("productId") String productId,
@PathVariable("imgSrc") String imgSrc, HttpServletRequest request)

but its not giving the correct url. The middle {productId} is always getting erased and replaced by the {imgSrc}.

is there anyway to get this working, i.e, is there anyway to handle this type of variable length string using spring mvc 3.0?
thank you.
 
Ranch Hand
Posts: 686
Netbeans IDE Chrome Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can you please add code tags and post your complete code? Looks like your syntax is incorrect
 
hem kumar
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks vyas. Actually the problem was somewhere else. The imageSrc contained a "../" at the begining and it was creating problems. The syntax code i produced here is working correctly. Now seems the problem is resolved.Thank you once again.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic