控制器中的Spring MVC URL映射对于动态URL [英] Spring MVC URL mapping in controller For dynamic URLs

查看:413
本文介绍了控制器中的Spring MVC URL映射对于动态URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个网页的部分网址是动态的。

I have a page with part of a URL that is dynamic e.g.

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


$ b b

页面的最后一部分recNo是传递给页面的参数。但是,参数值已加密。我想知道如何在控制器中设置 urlMapping 。我将发布数据,我将需要 urlMapping 来处理此表单。

The last part of the page recNo is a parameter passed to the page. However, the parameter value was encrypted. I would like to know how I can set the urlMapping in the controller. I will be posting the data and i will require a urlMapping to process this form.

推荐答案

因此,根据您的意见,您的请求映射应为

So based on your comments your request mapping should be

@RequestMapping("/myPageList.htm")

您的方法的签名类似

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

假设 recNo 是整数值。

这篇关于控制器中的Spring MVC URL映射对于动态URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆