简体   繁体   English

在Spring MVC中加密URL参数

[英]Encrypting URL parameters in spring MVC

I am creating an application using spring mvc, in all of my application i have written the methods using @Request Mapping in the following manner: 我正在使用spring mvc创建一个应用程序,在我所有的应用程序中,我都以以下方式使用@Request Mapping编写了方法:

@RequestMapping(value = "/txnMst/{portNumber}", method = RequestMethod.GET)

As you can see that in the request mapping i am passing the portNumber which is displayed later in the URL like this (portNumber is 3333 in the example): 如您所见,在请求映射中,我正在传递portNumber ,该portNumber稍后将显示在URL中(例如,端口号为3333):

http://localhost:8080/admin/txnScript/txnMst/3333

Now i want to hide these data ie the portNumber, is there any way how i can achieve this. 现在我想隐藏这些数据,即portNumber,有什么方法可以实现这一点。

Please provide some help. 请提供一些帮助。

If the client doesn't need this data why are you storing it in URL? 如果客户端不需要此数据,为什么要将其存储在URL中? An alternative place to store that data is in the session. 在会话中可以替代存储数据的位置。

Storing server values in client, expecting that them will be returned unaltered is a bad idea. 将服务器值存储在客户端中,期望它们将原封不动地返回是一个坏主意。

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

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