作者uioty (uioty)
看板java
标题[问题] java spring RequestMapping问题
时间Thu Feb 25 09:06:18 2016
各位好,最近接触到了java spring
因为这对我来讲是很新的工具,有些地方实在想不通怎麽用...
目前我想试着由使用者输入然後用RequestMapping产生一个页面
简单来讲,我的问题是
有没有可能这样做:
@RequestMapping(value = "/user/{userInput}", method = RequestMethod.GET)
其中userInput是从另外的页面读取使用者输入的资料这样
比如说,使用者在另外的页面输入:books
然後可以产生一个页面 网址是localhost/user/books
不好意思大概问了很粗浅的问题...>_<
谢谢
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 134.71.249.99
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/java/M.1456362380.A.CD2.html
1F:推 swallowcc: 可以啊 02/25 10:57
2F:推 swallowcc: 你拿到值以後ModelAndView设一下viewName跟处理过得到 02/25 11:00
3F:→ swallowcc: 的资料,就可以导向你要去的页面了 02/25 11:00
4F:推 yyc1217: 请用@PathVariable 02/27 14:03