小编Car*_*pez的帖子

使用java配置在Spring中进行404错误重定向

如您所知,在XML中,配置它的方法是:

<error-page>
    <error-code>404</error-code>
    <location>/my-custom-page-not-found.html</location>
</error-page>
Run Code Online (Sandbox Code Playgroud)

但我还没有找到一种方法在Java配置中执行此操作.我尝试的第一种方式是:

@RequestMapping(value = "/**")
public String Error(){
    return "error";
}
Run Code Online (Sandbox Code Playgroud)

它似乎工作,但它检索资源有冲突.

有办法吗?

java spring spring-mvc

21
推荐指数
5
解决办法
4万
查看次数

在MenuItem上显示进度条,即使它处于分割操作栏模式

我正在检查如何将菜单项的图标更改为进度条加载动画.我试过了

<item android:id="@+id/action_favorite"
    android:icon="@drawable/ic_action_heart"
    clasificados:showAsAction="always|collapseActionView"
    clasificados:actionViewClass="android.widget.ProgressBar"/>
Run Code Online (Sandbox Code Playgroud)

我正在使用分割操作栏模式.当我点击它时,图标消失,进度条显示在顶部栏上.

我需要改变什么?

android android-progressbar android-menu android-actionbar android-actionbar-compat

10
推荐指数
1
解决办法
4851
查看次数

没有使用javaconfig定义名为'springSecurityFilterChain'的bean错误

我在增加弹簧安全性方面遇到了一些问题.它显示一个错误:没有定义名为'springSecurityFilterChain'的bean

public class WebInitializer implements WebApplicationInitializer {

    public void onStartup(ServletContext servletContext) throws ServletException {


        // Create the 'root' Spring application context
        AnnotationConfigWebApplicationContext rootContext = new AnnotationConfigWebApplicationContext();
        rootContext.register(App.class);
        servletContext.addListener(new ContextLoaderListener(rootContext));


       // security filter
        servletContext.addFilter(
                "springSecurityFilterChain",
                new DelegatingFilterProxy("springSecurityFilterChain"))
                .addMappingForUrlPatterns(null, false, "/*");

        // Manage the lifecycle of the root application context
        AnnotationConfigWebApplicationContext webContext = new AnnotationConfigWebApplicationContext();
        webContext.register(WebConfig.class);
        webContext.setServletContext(servletContext);


        ServletRegistration.Dynamic servlet = servletContext.addServlet("dispatcher", new DispatcherServlet(webContext));
        servlet.addMapping("/");
        servlet.setLoadOnStartup(1);
    }
}
Run Code Online (Sandbox Code Playgroud)

在我添加安全过滤器的那一刻,它显示了这个错误.我一直在疯狂地试图解决这个问题而没有成功.

这是我的WebSecurityConfigurerAdapter

@Configuration
@EnableWebSecurity
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
    @Autowired
    public void configureGlobal(AuthenticationManagerBuilder …
Run Code Online (Sandbox Code Playgroud)

java spring spring-mvc spring-security

9
推荐指数
3
解决办法
2万
查看次数

JBPM使用JSON进行休息调用

我们想使用其余的API在JBPM6中启动一个进程.我们需要将一个对象作为流程变量传递.

我们知道如何做JAXB和执行调用.但我们想用JSON和/ runtime/{deploymentId}/process/{processDefId}/start来做

可能吗?我们试着没有成功.

rest json drools jbpm

6
推荐指数
1
解决办法
3366
查看次数

检查列表中的对象是否具有drools值

检查列表中的对象是否具有drools值时,我遇到了一些问题.

我的模特是这样的

class Products{
    private List<Approver> approvalPath;
}
class Approver{
    private String employeeName;
}
Run Code Online (Sandbox Code Playgroud)

所以,我需要制定这样的规则

rule "member"
    when
        //approvalPath has an approver with name "Charles" (for example)
    then
        //do something
end
Run Code Online (Sandbox Code Playgroud)

我该怎么做?

list drools object

4
推荐指数
1
解决办法
7662
查看次数

如何从另一个片段更新片段的Lis​​tView?

我怎样才能传达listviewListFragment的事件发生后Fragment内的另一个Fragment

ListFragment(片段A)我有一个方法来刷新ListView.但是,我需要在点击Button内部之后刷新它Fragment,这是另一个的孩子Fragment(片段b)

它像FragmentA(listFragment)| FragmentB(详细视图)(片段C - B的子片段)

我该怎么做?

android android-listview android-fragments

4
推荐指数
1
解决办法
8924
查看次数