
Originally Posted by
davidwaf
Hi all,
Am doing some work in Spring 3, together with tiles2. I am using the MVC, and am kind of stuck. I have a method in a controller, defined as :
@RequestMapping("/content/stories/view/{storyid}")
public ModelAndView editStoryPage(HttpServletRequest request, @PathVariable("storyid") int storyid) {
...
}
In my tiles xml definition, how do i dynamically map the {storyid} to a definition: the following is not working
<definition name="content/stories/**" extends="classic.definition">
<put-attribute name="title" value="View story" />
<put-attribute name="body" value="/WEB-INF/jsp/content/stories/viewstory.jsp" />
</definition>
So in short, if execute something like:
localhost/content/stories/1
localhost/content/stories/2
localhost/content/stories/3
all these should map to the definition in tiles.xml.
hope this explains my dilema.
Thanks a mill.
I don't follow your question neither whether it is a valid view name definition in Tiles. You can definite your view as content/stories/1, content/stories/2 and so on and return the different views based on the path variable. BTW what is the point to have various views while its components always are the same?
[URL="http://vicina.info"] 新闻,社区新闻,分类广告