Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/401.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 如何在web.xml中创建多个通配符url模式?_Java_Servlets_Jetty_Web.xml - Fatal编程技术网

Java 如何在web.xml中创建多个通配符url模式?

Java 如何在web.xml中创建多个通配符url模式?,java,servlets,jetty,web.xml,Java,Servlets,Jetty,Web.xml,在码头上,如何走下一条路线 我这样试过: /users/*/transactions/* 但我得到一个错误,如下所述: java.lang.IllegalArgumentException:Servlet规范12.2冲突:glob'*'只能存在于基于前缀的匹配的末尾:错误规范“/users/*/transactions” 这个问题的解决方案是什么?在web.xml中,如果您给出如下URL模式: 服务器名 /使用者/* 因此,URL模式/users/*表示将接受所有以/users/开头并以任

在码头上,如何走下一条路线

我这样试过:

/users/*/transactions/*
但我得到一个错误,如下所述:

java.lang.IllegalArgumentException:Servlet规范12.2冲突:glob'*'只能存在于基于前缀的匹配的末尾:错误规范
“/users/*/transactions”


这个问题的解决方案是什么?

web.xml
中,如果您给出如下URL模式:


服务器名
/使用者/*
因此,URL模式
/users/*
表示将接受所有以
/users/
开头并以任何内容结尾的请求。例如:
/users/get/all

但是你不能给出像
/users/*/anything/*/..
这样的URL模式,这是不允许的

12.2映射规范的屏幕截图,来自


太糟糕了!我不知道这是不可能的。我已经添加了pdf。请参考它。如果您不介意使用非标准Jetty-only功能,有一种方法可以使用URI模板或正则表达式来映射servlet(但不能通过
WEB-INF/WEB.xml
)。你有兴趣吗?
/users/*/transactions/*