aspose file tools*
The moose likes Spring and the fly likes problem in reading requestMapping in spring mvc 3.0 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "problem in reading requestMapping in spring mvc 3.0" Watch "problem in reading requestMapping in spring mvc 3.0" New topic
Author

problem in reading requestMapping in spring mvc 3.0

hem kumar
Ranch Hand

Joined: Sep 05, 2005
Posts: 97
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.


.....For Every Problem There Is a Solution.....
Regards, Hem
Vyas Sanzgiri
Ranch Hand

Joined: Jun 16, 2007
Posts: 686

Can you please add code tags and post your complete code? Looks like your syntax is incorrect


===Vyas Sanzgiri===
My Blog
hem kumar
Ranch Hand

Joined: Sep 05, 2005
Posts: 97
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: problem in reading requestMapping in spring mvc 3.0