我想在某些情况下绕过Spring webflow(Spring 2.0.5)应用程序的登录表单(因此登录表单是为普通用户提供的,但是当URL就像http://server.com/myspringapp/fakelogin?username = FakeUser&password = FakePassword然后不应该向用户显示登录表单,而是根据请求参数在内部进行身份验证,然后将其带到安全页面.
所以我不想要Preauthenticastion,而是特殊场合的透明身份验证(当URL如上所述).我看到了诸如http://forum.springsource.org/showthread.php?t=59108之类的线程,但没有提到解决方案的地方.我尝试实现AuthenticationProcessingFilter但不太确定如何实现requiresAuthentication()方法.
以下是我当前的安全性XML:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:security="http://www.springframework.org/schema/security"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-2.0.xsd">
<bean id="customAuthenticationProvider" class="com.myco.jsf.spring.security.MyAuthenticationProvider">
<security:custom-authentication-provider/>
<constructor-arg>
<ref bean="webSessionFactory"/>
</constructor-arg>
<constructor-arg>
<ref bean="authenticationBridge"/>
</constructor-arg>
</bean>
<bean id="myEntryPoint" class="com.myco.web.filter.CustomAuthenticationEntryPoint">
<property name="loginFormUrl" value="/spring/login" />
</bean>
<bean id="myProcessingFilter" class="com.myco.web.filter.CustomAuthenticationProcessingFilter">
<security:custom-filter position="AUTHENTICATION_PROCESSING_FILTER" />
<property name="defaultTargetUrl" value="/spring/secure" />
<property name="authenticationFailureUrl" value="/spring/login" />
<property name="alwaysUseDefaultTargetUrl" value="false" />
<property name="filterProcessesUrl" value="/spring/j_spring_security_check" />
<property name="authenticationManager" ref="authenticationManager" />
<!--
<property name="allowSessionCreation" value="true" />
-->
</bean>
<security:authentication-manager alias="authenticationManager"/> …Run Code Online (Sandbox Code Playgroud) 我希望能够从我的应用程序动态公开各种基于时间和计数的指标.Perf4j可以很好地适应时间,但不允许以我所知道的简单方式进行计数.
比如我能做到
StopWatch dbWriteTime = new Log4JStopWatch("ServiceName:DBWrite");
dbWriteTime.start();
... execute DB stuff here
dbWriteTime.stop();
Run Code Online (Sandbox Code Playgroud)
并且您可以将这些指标设置为以任何时间间隔记录,并且它可以很好地完成.但有时候我想做点什么
Metric metric = new Metric("ServiceName:OrdersPerRequest");
metric.put(50);
Run Code Online (Sandbox Code Playgroud)
我可以将perf4j计时器lib调用50次,但这是一个非常糟糕且效率低下的黑客,可以在日志中获取我的指标.有谁知道一个好的开源库可以做两种类型的指标?此外,如果它可以监视输出指标日志并将它们转储到一个很好的集中式数据库.另外,如果您知道一个好的开源Web前端来绘制图形并显示这种数据,我会对此非常感兴趣.看来这一定是很多人以前需要的东西.
我目前有一个像这样工作的系统:
插入IP,它会将IP发布到另一个.php页面.但是,当我尝试发布http://google.com时,它不会将域转换为IP.
我该怎么办?例如,当用户插入http://google.com或任何域时,它将自动解析IP.
我知道函数gethostbyadd,我不知道如何构造它,例如表单,表格,发布数据.
谢谢,如果任何可以帮助.
作为一名C++开发人员,我偶尔会遇到像iText,Batik,JasperReports和JFreeChart这样的Java库.在每种情况下,等效的跨平台C++库似乎都不太成熟,更昂贵或不可用.
使用我的C++应用程序中的这些Java库进行报告,制图和类似工作是否切实可行?如果是这样,这样做的最佳方法是什么?
在数学中,符号18 < age < 30表示年龄必须介于值18和30之间.是否可以在if语句中使用这种符号?例如,我尝试过执行
if(18 < age < 30)
Run Code Online (Sandbox Code Playgroud)
我得到奇怪的输出,所以它不太正确.有没有办法做到这一点,所以我只需要写
if(age > 18) /*blah*/;
else if(age < 30) /*same blah*/;
Run Code Online (Sandbox Code Playgroud)
我正在Ubuntu上用Python开发一个应用程序,我正在使用子进程在python中运行外部二进制文件.由于这些二进制文件是在运行时生成的并且可能变得流氓,因此我需要对这些二进制文件的内存占用量和运行时间保持严格的标签.有没有我可以在运行时限制或监视这些二进制程序的内存使用情况?为了这个目的,我真的很讨厌在子进程中使用类似"ps"的东西.
根据我的研究,看起来Javascript的正则表达式没有任何内置等效于Perl的/ x修饰符,或.NET的RegexOptions.IgnorePatternWhitespace修饰符.这些非常有用,因为它们可以使复杂的正则表达式更容易阅读.首先,我错过了什么,是否有一个内置的Javascript相当于这些?其次,如果没有,有没有人知道一个好的jQuery插件将实现这个功能?由于Javascript明显的正则表达式限制,必须将复杂的正则表达式压缩成一行是一种遗憾.
我必须生成范围内的数字[-100; 2000]在C++中.如果只有正数,我怎么能用rand呢?有什么快捷方式吗?
在我的程序中,我经常使用集合来存储对象列表.目前我使用ArrayList来存储对象.我的问题是:这是最好的选择吗?使用LinkedList可能会更好吗?或者是其他东西?
要考虑的标准是:
我需要的操作是:
有什么想法吗?
更新:我的选择是:ArrayList :)基于此讨论以及以下内容:
如何删除链接并保留文本?
text text text. <br><a href='http://www.example.com' target='_blank' title='title' style='text-decoration:none;'>name</a>
Run Code Online (Sandbox Code Playgroud)
像这样:
text text text. <br>
Run Code Online (Sandbox Code Playgroud)
我还有问题.....
$text = file_get_contents('http://www.example.com/file.php?id=name');
echo preg_replace('#<a.*?>.*?</a>#i', '', $text)
Run Code Online (Sandbox Code Playgroud)
在那个网址是那个文本(带链接)......
这段代码不起作用......
怎么了?
有人能帮我吗?
c++ ×3
java ×3
performance ×2
php ×2
.net ×1
collections ×1
hyperlink ×1
javascript ×1
metrics ×1
monitoring ×1
python ×1
random ×1
regex ×1
subprocess ×1
whitespace ×1