Setting the default jsp view with spring mvc

前端 未结 4 1740
陌清茗
陌清茗 2020-12-08 08:06

I want to set one of jsp files in my jsps folder as the default view for the application. Is there any way we can tell in that a

4条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-08 08:57

    Solved -

    A file in the welcome file list has to be a real file , hence abc.htm did not work. The only way to accomplish was to create an index.jsp and redirect it using

    
    

    also in yourapplication-servlet.xml you need to specify the bean mapping like

      
        
        
        
      
    

    A welcome-file has to be a REAL file on the file system it doesn't work with mapped urls. You can create an index.jsp which redirects to the mapped url, but it has to be an actual file. Nothing to do with spring it is stated in the servlet spec that it has to be this way, although behavior might vary on different app servers in general it has to be a real file.

    I hope this help someone

提交回复
热议问题