- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我们正在开发一个基于 Struts 2 的 Web 应用程序。
请告诉我 Strust 2 应用程序中哪个是正确的(标准)
<s:url var="url" action="foo" namespace="bar" />
<s:url var="url" action="/foo" namespace="/bar" />
<s:url var="url" action="foo" namespace="/bar" />
长话短说:
要获取我们在下面始终使用的操作网址
<s:url var="url" action="foo" namespace="bar" />
我们尝试向我们的应用程序添加休息支持,并使我们的应用程序支持休息和非休息操作,如 REST and non-RESTful URL's Together Configuration 中提到的那样。
还有Struts2 REST and Non-REST action together .
看来 <s:url var="url" action="foo" namespace="bar" />
始终映射到默认操作,而 <s:url var="url" action="/foo" namespace="/bar" />
工作正常。
这是 org.apache.struts2.dispatcher.mapper.PrefixBasedActionMapper
中的错误吗?类或操作和命名空间应该始终带有斜杠?
最佳答案
线下
REST and non-RESTful URL's Together Configuration
And, again, we're relying on the Convention plugin to find ourcontrollers, so we need to configure the convention plugin a bit:
<constant name="struts.convention.action.suffix" value="Controller"/>
<constant name="struts.convention.action.mapAllMatches" value="true"/>
<constant name="struts.convention.default.parent.package" value="rest-default"/>
<constant name="struts.convention.package.locators" value="example"/>
表示您应该使用约定插件,这意味着基于约定的 Action 映射器。此映射器允许操作名称带有前导斜杠。您使用 Struts 多年,应该知道默认操作映射器不会。
s:url
标签在配置中没有定义任何命名空间或操作,它使用 UrlHelper
根据自己的逻辑生成 url。生成的内容用于访问操作映射器。通常 URL 是用
http://<host>:<port>/<context>/<namespace>/<action>[.<extension>]
如果您打印从标签生成的网址,您将看到哪个是正确的。我们使用带有前导斜杠的命名空间和在操作属性中不带斜杠的操作名称。这些值应与配置设置相对应。
关于java - 命名空间(和操作)应该以斜杠开头吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44601892/
我有一个右下角倾斜的元素,我必须在其上放置一个盒子阴影。有时倾斜的 Angular 被徽章覆盖 - 我的问题不适用,如果是这样的话: 这是信息框及其边 Angular 的 (s)css 部分(还有更多
是否可以在纯 html/css 中创建类似下面的内容? 我想做这个响应式和全 (100%) 宽度(最大左 Angular 100 像素,右边最小 50 像素,类似的东西)。 最佳答案 您可以通过转换(
如何在 fabricjs 文本中为文本提供渐变或斜 Angular 效果?? http://fabricjs.com/fabric-intro-part-2/ 这里给出了形状和所有示例,我将其与文本绑
我用过: http://apps.eky.hk/css-triangle-generator/ 为彼此对 Angular 放置的两个不等边三 Angular 形生成 css: 左下三 Angular
我是一名优秀的程序员,十分优秀!