I use spring 3.0 and I have a really simple question but didn’t find any answer on the internet. I want to generate a path (an URI) just like in my JSPs:
<spring:url value="/my/url" />
But inside a controller. What is the related service to use?
Thanks!
Edit: May it be related with this: http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/resources.html#resources-resourceloader ?
Ain’t there a better solution for this?
I would say
makes the job. There is no such built in functionality, spring:url calls UrlTag.class that has the below method to generate URL, you can use it as an insőiration for your code: