Using both Thymeleaf and JSP

前端 未结 4 1626
南旧
南旧 2020-12-01 01:35

I was using JSP + JSTL but I\'m boring of c:if, c:choose, ...

So, I want my JSP pages to be rendered with both JSP and Thymeleaf (I plan to remove all JSTL as soon a

4条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-01 02:12

    Alternatively, two servlets works fine. The key is to keep servlet configuration minimal and include an appConfig.xml for database and other services (this avoids massive duplication of configuration)

    Web.xml:

    
    
       Spring MVC Application
    
       
          AssessmentAdmin
          
             org.springframework.web.servlet.DispatcherServlet
          
          1
       
     
          AssessmentAdmin
          /xz/*
       
       
       
    
          AssessmentAdminTL
          
             org.springframework.web.servlet.DispatcherServlet
          
          1
          
       
          AssessmentAdminTL
          /xztl/*
       
       ........

    servlet for jsp:

    
    	
    	
    		
    		 
    		  
    	
    
    
    
    	..........
    
    
    
    	
    	
    
    
    
    

    servlet for thymeleaf

    
    	
    
    
    
        
        
        
        
      
        
      
        
      
       
      
        
       
        
     
       
      
        
       	
      
      
    
    
    	
    	

    Tried it and it works fine

提交回复
热议问题