java spring restful-url 带分号 [英] java spring restful-url with semi-colon

查看:98
本文介绍了java spring restful-url 带分号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在处理一个需要在我们的 restful-url 方案中使用分号的项目.

I am currently working on a project that requires the use of a semi-colon in our restful-url scheme.

正如您想象的那样,我们在解决这个问题时遇到了问题 - 底层的 Java HTTPServletRequest 表现不佳.

As you can imagine, we're having issues pulling this off - the underlying Java HTTPServletRequest isn't playing nicely.

有没有办法解决这个问题?

Is there a way to work around this issue?

示例restulf-URL:

example restulf-URL:

http://service/BOB;MIKE/

看起来 Spring 只在/service/bob 上工作 - ;MIKE 被截断了.

Looks like Spring is only working on /service/bob - the ;MIKE gets truncated.

我们已经尝试过 %3B(或类似的 %3F),但它不起作用.

We've tried %3B (or %3F something like that) and it doesn't work.

提前致谢!

ct

推荐答案

这是您可以在 URI 中合法使用的所有分隔符的列表:

this is the list of all the delimiters you can legally use in a URI:

! $ & ( ) * , ; = + ' : @ / ?

尝试每一个,看看哪个适合你.

try each and see which works for you.

显然 Spring 抢走了您的 ;.我不确定这是否是 Servlet 的事情,但无论如何,它很糟糕.网络框架应允许开发者构建任何合法的 URI.

apparently Spring robs you of the ;. I'm not sure if that's a Servlet thing, but in any case, it sucks. A web framework should allow developers to construct ANY legal URIs.

这篇关于java spring restful-url 带分号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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