本文将带您了解关于WEB-INF下的Struts2ConventionPlugin和JSP文件的新内容,同时我们还将为您解释web-inf下的jsp怎么访问的相关知识,另外,我们还将为您提供关于and
本文将带您了解关于WEB-INF下的Struts 2 Convention Plugin和JSP文件的新内容,同时我们还将为您解释web-inf下的jsp怎么访问的相关知识,另外,我们还将为您提供关于android-maven-plugin,instrumentation testing和testSize、Cannot assign configuration entry ''pluginArtifacts'' with value ''${plugin.artifacts}''、extjs 能与 struts2 的 convention-plugin 整合么?、Extjs3.x Struts2 -Json-plugin学习实例的实用信息。
本文目录一览:- WEB-INF下的Struts 2 Convention Plugin和JSP文件(web-inf下的jsp怎么访问)
- android-maven-plugin,instrumentation testing和testSize
- Cannot assign configuration entry ''pluginArtifacts'' with value ''${plugin.artifacts}''
- extjs 能与 struts2 的 convention-plugin 整合么?
- Extjs3.x Struts2 -Json-plugin学习实例
WEB-INF下的Struts 2 Convention Plugin和JSP文件(web-inf下的jsp怎么访问)
使用Struts2约定插件时,即使未定义,该插件也会自动将hello-world.action
请求转发给。/WEB-INF/content/hello-world.jsp``HelloWorld.java
另一方面,我们将JSP文件放在WEB-INF下以避免直接访问JSP文件。
我认为常规插件的这种行为破坏了JSP访问策略。任何人都可以通过简单地调用a,即时构建动作来直接访问JSP。
我对么?!如果是,我们可以禁用此功能吗?
答案1
小编典典不,您不太正确。如果页面位于下方,则无法直接访问WEB-INF
。约定插件Action
通过约定从类中为基于XML的配置创建了其他功能。因此,您只能访问那些操作返回的结果。约定插件将其配置放置在XWork包下,如docs和此答案中所述。因此,解决冲突是可能的,如果您不指定父包。您还可以使用约定注释来自定义生成的配置。该公约插件默认扫描为基础包下的类,这可能是struts
或者actions
是可配置的,并有Action
后缀。这些都是约定插件的默认配置。如果您想更改默认设置,可以在中使用常量标签struts.xml
或中的相应属性struts.properties
。
但是,文档尚不清楚其处理方式
__URL识别的 无效 结果
另外,不清楚使用哪个URL进行标识。我认为您已经熟悉了无操作配置,因为默认情况下会使用操作类,因此您无需执行操作即可返回结果SUCCESS。但是,问题甚至不在这里。上面提到的约定插件及其创建的配置还放置了一个未知的处理程序,该处理程序应处理不存在配置的URL(即不是由约定创建的)。这是问题的根源。该插件也不允许替换/覆盖配置。令人高兴的是,有一个未知的处理程序管理器(如果需要,可以替换),该处理程序通过对"unknown-handler-stack"
,由该经理管理。使用处理程序堆栈,您可以配置未知处理程序的迭代顺序。请注意,当处理程序返回操作配置时,循环结束。这意味着,如果您创建自己的未知处理程序并在堆栈中设置顺序,则可以绕过约定处理程序。
。
android-maven-plugin,instrumentation testing和testSize
但是,如果我想同时进行中小型测试,不仅是小型还是非中型测试,我该怎么办?有这个问题的解决方案吗?
解决方法
Running all small tests: adb shell am instrument -w -e size small com.android.foo/android.test.InstrumentationTestRunner
Running all medium tests: adb shell am instrument -w -e size medium com.android.foo/android.test.InstrumentationTestRunner
Running all large tests: adb shell am instrument -w -e size large com.android.foo/android.test.InstrumentationTestRunner
即使您使用plain adb命令来运行测试,也必须使用两个进程分别运行中小型测试,一个接一个. Android Maven插件只是adb命令的另一个包装器,所以没有办法通过android-maven-plugin配置AFAIK来改变默认行为.
如果你仔细阅读InstrumentationTestRunner API doc,你会注意到有一个有趣的命令用法:
Filter test run to tests with given annotation: adb shell am instrument -w -e annotation com.android.foo.MyAnnotation com.android.foo/android.test.InstrumentationTestRunner
If used with other options,the resulting test run will contain the union of the two options. e.g. “-e size large -e annotation com.android.foo.MyAnnotation” will run only tests with both the LargeTest and “com.android.foo.MyAnnotation” annotations.
注释配置作为实验API添加(标记为@hide,有关详细信息,请参阅this version history),并且未在am instrument options list中记录.理论上,您可以创建自己的注释类(请参阅SmallTest.java作为示例),标记所有@MediumTest与@CustomizedTest一起使用-e size和-e annotation来实现你想要的:同时从两个注释中运行union测试,所有这些都在一个命令中.
不幸的是,android-maven-plugin不支持注释配置,请参阅plugin documentation和latest source code.可能的解决方法是使用exec-maven-plugin运行plain adb shell am instrument命令.
希望这是有道理的.
Cannot assign configuration entry ''pluginArtifacts'' with value ''${plugin.artifacts}''
下了个新项目,一运行就报这个错误
Failed to execute goal org.codehaus.mojo:findbugs-maven-plugin:3.0.1:findbugs (findbugs) on project mdipesb: Unable to parse configuration of mojo org.codehaus.mojo:findbugs-maven-plugin:3.0.1:findbugs for parameter pluginArtifacts: Cannot assign configuration entry ''pluginArtifacts'' with value ''${plugin.artifacts}'' of type java.util.Collections.UnmodifiableRandomAccessList to property of type java.util.ArrayList -> [Help 1]
[ERROR]
一查代码,看到引入了这么个插件
将这个插件去掉,打包成功,但总不能真去掉吧。
发现这个问题和maven版本有关系,将你的maven版本设置一下即可
我默认的是3.6 的maven版本,超过3.5版本的好像都有这个问题。
extjs 能与 struts2 的 convention-plugin 整合么?
最近想整合 extjs 和 struts2 的 convention-plugin,在 jsp 文件里面通过 user!user.action 访问正常,但貌似通过在 extjs 的 js 文件里通过 user!user.action 是访问不到 action 类里面的。所以怀疑 extjs 能否支持 convention-plugin 插件,求高手解答!Extjs3.x Struts2 -Json-plugin学习实例
Extjs3.x Struts2 -Json-plugin学习实例 01
http://www.javaeye.com/topic/797690
Extjs3.x Struts2 -Json-plugin学习实例-搭建开发环境 02
http://www.javaeye.com/topic/794201
Extjs3.x Struts2 -Json-plugin学习实例 -后台数据处理 03
http://www.javaeye.com/topic/794216
Extjs3.x Struts2 -Json-plugin学习实例 -struts.xml配置 04
http://www.javaeye.com/topic/794219
可惜 我不玩 Extjs 我玩的是 Jquery
不过 下面这个 不错
[原创]Struts2 + JQuery + JSON实现AJAX
http://www.javaeye.com/topic/560638
Extjs3.x Struts2 -Json-plugin学习实例 -首页框架代码 05
http://www.javaeye.com/topic/794221
今天的关于WEB-INF下的Struts 2 Convention Plugin和JSP文件和web-inf下的jsp怎么访问的分享已经结束,谢谢您的关注,如果想了解更多关于android-maven-plugin,instrumentation testing和testSize、Cannot assign configuration entry ''pluginArtifacts'' with value ''${plugin.artifacts}''、extjs 能与 struts2 的 convention-plugin 整合么?、Extjs3.x Struts2 -Json-plugin学习实例的相关知识,请在本站进行查询。
本文标签: