我正在关注spring-data-rest指南使用REST访问JPA数据.当我发布一条新记录时,它会被插入(响应是201).这很好,但是有没有办法配置REST MVC代码来返回新创建的对象?我宁愿不必发送搜索请求来查找新实例.
我正在设置一个不使用xml的新Web应用程序(没有web.xml,没有spring.xml).我几乎一切都工作,除了我无法弄清楚如何注册SaltSource.我需要用Java等效替换以下内容.
<authentication-manager>
<authentication-provider user-service-ref="authService" >
<password-encoder hash="sha" ref="myPasswordEncoder">
<salt-source user-property="salt"/>
</password-encoder>
</authentication-provider>
</authentication-manager>
Run Code Online (Sandbox Code Playgroud)
到目前为止,我在Java中有这个.
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
ReflectionSaltSource rss = new ReflectionSaltSource();
rss.setUserPropertyToUse("salt");
auth.userDetailsService(authService).passwordEncoder(new MyPasswordEncoder());
// How do I set the saltSource down in DaoAuthenticationProvider
}
Run Code Online (Sandbox Code Playgroud)
那么如何注册SaltSource以便它最终出现在DaoAuthenticationProvider中(就像xml过去一样)?
我正在尝试使用Android Webview来显示一些"活动"内容(根据某些输入设置而变化的图像集).内容将是本地(离线).
我想使用Angular.js来控制将在页面上显示的媒体.
那么,对于这个问题......我的Angular应用程序如何在启动时接收JSON数据?我看到的问题是,web视图不允许的角度来延迟加载其他文件(我已经遇到了这个试图使用HTML模板自定义指令.这需要封闭HTML模板到一个HTML文件).
我的Android活动可以在某处写出选项,但Angular如何能够读取它们?换句话说,有没有办法绕过webview的安全设置,不允许Angular.js延迟加载其他文件?