简体   繁体   English

控制器中的Spring MVC URL映射对于动态URL

[英]Spring MVC URL mapping in controller For dynamic URLs

I have a page with part of a URL that is dynamic eg 我有一个带有一部分URL的页面,该URL是动态的,例如

http://localhost:8080/myApp/myPageList.htm?recNo=107&recNo=-96&recNo=-24&recNo=-9&recNo=38&recNo=-21&recNo=-50&crimeRecNo=-110

The last part of the page recNo is a parameter passed to the page. 页面recNo的最后一部分是传递给页面的参数。 However, the parameter value was encrypted. 但是,参数值已加密。 I would like to know how I can set the urlMapping in the controller. 我想知道如何在控制器中设置urlMapping I will be posting the data and i will require a urlMapping to process this form. 我将发布数据,并且需要urlMapping来处理此表单。

So based on your comments your request mapping should be 因此,根据您的评论,您的请求映射应为

@RequestMapping("/myPageList.htm")

And the signature of your method something like 和你的方法的签名像

public WhateverType myPageList(@RequestParam("recNo") List<Integer> recNo, ...

assuming that recNo are integer values. 假设recNo是整数值。

Using SimpleUrlHandlerMapping ( doc sample )might help. 使用SimpleUrlHandlerMapping文档 示例 )可能会有所帮助。

Have a look at ControllerClassNameHandlerMapping here , as well 这里也查看ControllerClassNameHandlerMapping

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM