java - Can I start a HTML element in one jsp page, close it in another? -


i want know if can put start tag of html element inside "include" in jsp, , close html element outside include file, or in include file. example, have website:

<%@ page language="java" pageencoding="utf-8" %> <!doctype html>     <html>         <head>             <meta charset="utf-8">             <meta http-equiv="content-type" content="text/html;charset=utf-8">             <mytags:scriptloader />             <mytags:cssloader />         </head>         <body>             <div id="bodycontainer" class="container-fluid">             <div class="row">                 <div class="col-lg-10 col-md-10 col-sm-9">                     <jsp:include page="/web-inf/views/sidebar.jsp" />                     <div class="container-fluid">                         <h2>welcome</h2>                     </div>                 </div>             </div>             </div>             <br>             <hr />             <footer>&copy; 2015 ...</footer>         </body>     </html> 

and changed

<%@ page language="java" pageencoding="utf-8" %> <!doctype html> <%@ include file="/web-inf/views/header.jsp" %>     <div class="container-fluid">         <h2>welcome</h2>     </div> </div> <%@ include file="/web-inf/views/footer.jsp" %> 

where header.jsp is:

<html>     <head>         <meta charset="utf-8">         <meta http-equiv="content-type" content="text/html;charset=utf-8">         <mytags:scriptloader />         <mytags:cssloader />     </head>      <body>         <div id="bodycontainer" class="container-fluid">         <div class="row">             <div class="col-lg-10 col-md-10 col-sm-9">                 <jsp:include page="/web-inf/views/sidebar.jsp" /> 

and footer.jsp is:

        </div>         </div>         <br>         <hr />         <footer>&copy; 2015 ...</footer>     </body> </html> 

the thing is, eclipse keep warning tags not being closed on header.jsp , tags without start on footer.jsp.

the website working fine on web browser now, wonder if there going problems in future.

you can spill code across jsps making sure forms valid html when work together. suggested define layout in 1 jsp , sections in other required better code management.


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -