Support both jsp and jspx in spring 3.0

前端 未结 1 1464
耶瑟儿~
耶瑟儿~ 2021-01-06 18:05

i\'ve set up a roo application. The default view resolver built-in in roo is for jspx files. Is it possible to support also jsp files?. I tried configuring two viewResolvers

1条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-06 18:23

    One probably not a good solution that I can think of is to not provide a suffix, and to explicitly specify the .jsp or .jspx suffix when returning a view name.

    
                
        
        
        
    
    

    and when returning a view name:

    return "myview.jsp";
    return "myview.jspx";
    

    OR

    Another solution if you know the name pattern for your jsp and jspx views names will be to provide the view names as one more parameter to one of the resolvers:

    
                
        
        
        
        
            
        view1*
        view2*
        view3*
        
        
    
    

    If this viewresolver returns a null if it does not match any of the view patterns it would then go to your jspx view resolver.

    0 讨论(0)
提交回复
热议问题