我正在尝试使用Maven过滤过滤Spring配置文件.我的POM配置如下:
...
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.2</version>
<configuration>
<webResources>
<resource>
<filtering>true</filtering>
<targetPath>WEB-INF/context</targetPath>
<directory>src/main/webapp/WEB-INF/context</directory>
<includes>
<include>applicationContext.xml</include>
</includes>
</resource>
</webResources>
</configuration>
</plugin>
...
Run Code Online (Sandbox Code Playgroud)
和
<profiles>
<profile>
<id>desarrollo</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<build>
<filters>
<filter>src/main/properties/dev.properties</filter>
</filters>
</build>
</profile>
<profile>
<id>pruebas</id>
<build>
<filters>
<filter>src/main/properties/test.properties</filter>
</filters>
</build>
</profile>
...
Run Code Online (Sandbox Code Playgroud)
它直接调用Maven时效果很好.
不幸的是,当使用Eclipse WTP和m2e在Tomcat 6中热部署webapp时,它总是选择未经过滤的applicationContext.xml版本.(文件夹target/m2e-wtp/web-resources/WEB-INF/context中的文件applicationContext.xml永远不会被过滤)
我找不到有关该主题的任何有用文档.我甚至不确定它是否在m2e中实现.
我的配置有问题,或者这是一个未实现的功能?
我已将server.xml主机部分中的领域设置设置为如下所示:
<Realm className="org.apache.catalina.realm.JDBCRealm" driverName="org.gjt.mm.mysql.Driver"
connectionURL="jdbc:mysql://localhost:3306/test" connectionName="test" connectionPassword="test"
userTable="users" userNameCol="user_name" userCredCol="user_pass" userRoleTable="user_roles"
roleNameCol="user_role" />
Run Code Online (Sandbox Code Playgroud)
也在web.xml中:
<security-role>
<role-name>ADMIN</role-name>
</security-role>
<security-constraint>
<web-resource-collection>
<web-resource-name>critical</web-resource-name>
<url-pattern>/admin/*</url-pattern>
<http-method>GET</http-method>
<http-method>POST</http-method>
</web-resource-collection>
<auth-constraint>
<role-name>ADMIN</role-name>
</auth-constraint>
</security-constraint>
<login-config>
<auth-method>FORM</auth-method>
<form-login-config>
<form-login-page>/login.jsp</form-login-page>
<form-error-page>/error.jsp</form-error-page>
</form-login-config>
</login-config>
Run Code Online (Sandbox Code Playgroud)
我有数据库设置.但是当env熏制了login.jsp时,即使我输入了正确的密码,我也被重定向到了error.jsp
我想知道是否有办法在这个过程中发现什么是错的.我可以在Eclipse中执行此操作或任何其他可能解决问题的提示吗?
我正在使用大量使用Iterables(java.lang.Iterable)的API,但我无法直接在JSP页面上使用它们,因为JSTL标记和EL无法处理它们.现在,我正在将每个迭代变换为一个列表,然后再渲染它们.
如果没有先前的转换,最简洁,最简单的方法是什么?做最新的JSTL-Jasper-EL-taglibs等.版本支持吗?我在哪里可以找到这些信息?我没有发现任何关于它谷歌搜索...
我知道我可以使用Iterable.iterator(),但我不能在JSP中调用该方法,只能在我的控制器类中调用,这是非常有限的.
我希望在用户会话结束时删除一些临时文件.与文件关联的信息存储在用注释的对象中@SessionAttributes.
我发现处理这个问题的唯一方法是创建一个HttpSessionListener.
是否有更高级别,简化,Springy方式来收听会话结束事件,我可以轻松获取带注释的对象?
我有一个具有公共https区域的webapp,以及使用SSL重新协商的使用客户端证书保护的私有https.在具有APR的Tomcat 7中,此配置可正常工作(并非没有大量工作).
现在我正在和Jetty一起工作,但我已经尝试了所有东西,但我无法让它发挥作用.
客户端证书对话框从未出现在浏览器中,我总是收到HTTP 403错误.
我的环境是:jdk 1.7.0.02 jetty 9.0.0.M3从Eclipse Helios用m2e启动.(码头:运行)
服务器似乎已经SSL重新协商启动,测试它指示在这里,所以我敢肯定有与SSL重新协商安全问题没有问题.
我已经覆盖了ClientCertAuthenticator(能够调试)并创建了一个自定义的LoginService,看起来X509Cert似乎永远不会出现在请求中.
看起来永远不会触发SSL重新协商,并且身份验证失败,因为请求中没有证书.
LoginService配置只对每次验证返回true.如果被问到,我也可以发布它们,但重要的方法永远不会被调用.
如果我使用needCLientCert或wantClientCert应用程序工作正常,但随后浏览器要求公共区域中的证书.
我的配置文件:
web.xml:http://pastebin.com/LQ3RcWY4
jetty.xml:http://pastebin.com/iE9xqcLq
jetty-context.xml:http://pastebin.com/rcSsBfRW
pom.xml(jetty部分):http://pastebin.com/wBLATggq
我错过了一些明显的东西吗 我不知道.我经常搜索并尝试了很多可能的配置,但是没有运气.
在AWS ECS中创建容量提供程序时。我们正在填充的目标容量%值,在超过该值后,我们的集群缩小,但我很好奇当前集群的这个值是如何计算的,如果我想检查集群的当前值是多少,我可以在哪里检查这个。我在cludwatch方面没有找到任何数据。
Visual Studio 2010中此C++代码失败:
const sregex_iterator end;
for (sregex_iterator match(origString.begin(), origString.end(), regex(regExPattern)); match != end; ++match)
{
useMatch(*match);
}
Run Code Online (Sandbox Code Playgroud)
在第一个循环之后,在第一个迭代器increment(operator++)中,调试器失败,表明regex_iterator是"孤立的".
我注意到可疑的正则表达式构造函数(我从某处复制了片段),我尝试了这个:
const sregex_iterator end;
regex regexObj(regExPattern);
for (sregex_iterator match(origString.begin(), origString.end(), regexObj); match != end; ++match)
{
useMatch(*match);
}
Run Code Online (Sandbox Code Playgroud)
这非常有效.
但是,为什么第一次尝试失败了?我认为它必须与for范围或可能与内联构造函数以及迭代器构造函数中的regex参数是引用的事实...
但是,正如我前一段时间在stackoverflow中读到的那样,我只记得我理解的东西,并且我想知道在C++中使用构造函数作为函数参数是否安全(new当然不使用).