Including JSP page into another JSP page, how to avoid multiple HEAD / BODY sections?

前端 未结 4 997
逝去的感伤
逝去的感伤 2021-01-14 13:17

I would like to include a JSP page into another JSP page. Let\'s say that I have master.jsp that is including slave.jsp.

As slave.jsp

4条回答
  •  甜味超标
    2021-01-14 13:48

    I went for this solution by passing a parameter when including the page.

    in master.jsp

    
      blablabla
      
        
      
    
    
      blablabla
      
      
    
    

    and then in slave.jsp the parameter is read and the custom part of the page is rendered.

    
      
         head section here [without the  tags !]
      
      
         body section here [without the  tags !]
      
    
    

    not too nice to see but working. In this way I am able to remove the duplication of HEAD and BODY parts.

提交回复
热议问题