`
lt200819
  • 浏览: 188944 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

<%@include%>和<jsp:include>的区别

 
阅读更多
<%@include%>和<jsp:include>的区别

<jsp:include> :动态包含

第一种情况(<jsp:include>包含的是html文件):

DynamicInclude.jsp:

[html]
<%@pagecontentType="text/html;charset=gb2312"%> 
<html> 
         <head> 
                   <title>动态包含</title> 
         </head> 
         <bodystylebodystyle="background-color:lightblue"> 
  
                   <jsp:include page="header.html"flush="true"/><!--动态包含--> 
  
                   <tablebordertableborder="1" align="center"> 
                            <tr> 
                                     <td>姓名</td><td>性别</td><td>年龄</td><td>爱好</td> 
                            </tr> 
                            <tr> 
                                     <td>a</td><td>b</td><td>c</td><td>d</td> 
                            </tr> 
                   </table> 
         </body> 
</html> 
<%@pagecontentType="text/html;charset=gb2312"%> <html> <head> <title>动态包含</title> </head> <bodystyle="background-color:lightblue"> <jsp:include page="header.html"flush="true"/><!--动态包含--> <tableborder="1" align="center"> <tr> <td>姓名</td><td>性别</td><td>年龄</td><td>爱好</td> </tr> <tr> <td>a</td><td>b</td><td>c</td><td>d</td> </tr> </table> </body> </html>


Header.html :

[html]
<h2styleh2style="font-family:arial;color:red;font-size:25px;text-align:center"> 
         动态包含的标题(HTML) 
</h2> 
<h2style="font-family:arial;color:red;font-size:25px;text-align:center"> 动态包含的标题(HTML) </h2>
运行之后,只生成一个servlet,和上面的代码对应如下:

[java]
out.write("\r\n"); 
out.write("<html>\r\n"); 
out.write("\t<head>\r\n"); 
out.write("\t\t<title>动态包含</title>\r\n"); 
out.write("\t</head>\r\n"); 
out.write("\t<bodystyle=\"background-color:lightblue\">\r\n"); 
out.write("\r\n"); 
out.write("\t\t"); 
<span style="color:#ff0000;">org.apache.jasper.runtime.JspRuntimeLibrary.include(request,response, "header.html", out, true);</span> 
out.write("<!--动态包含-->\r\n"); 
out.write("\r\n"); 
out.write("\t\t<table border=\"1\"align=\"center\">\r\n"); 
out.write("\t\t\t<tr>\r\n"); 
out.write("\t\t\t\t<td>姓名</td><td>性别</td><td>年龄</td><td>爱好</td>\r\n"); 
out.write("\t\t\t</tr>\r\n"); 
out.write("\t\t\t<tr>\r\n"); 
out.write("\t\t\t\t<td>a</td><td>b</td><td>c</td><td>d</td>\r\n"); 
out.write("\t\t\t</tr>\r\n"); 
out.write("\t\t</table>\r\n"); 
out.write("\t</body>\r\n"); 
out.write("</html>"); 
out.write("\r\n"); out.write("<html>\r\n"); out.write("\t<head>\r\n"); out.write("\t\t<title>动态包含</title>\r\n"); out.write("\t</head>\r\n"); out.write("\t<bodystyle=\"background-color:lightblue\">\r\n"); out.write("\r\n"); out.write("\t\t"); <span style="color:#ff0000;">org.apache.jasper.runtime.JspRuntimeLibrary.include(request,response, "header.html", out, true);</span> out.write("<!--动态包含-->\r\n"); out.write("\r\n"); out.write("\t\t<table border=\"1\"align=\"center\">\r\n"); out.write("\t\t\t<tr>\r\n"); out.write("\t\t\t\t<td>姓名</td><td>性别</td><td>年龄</td><td>爱好</td>\r\n"); out.write("\t\t\t</tr>\r\n"); out.write("\t\t\t<tr>\r\n"); out.write("\t\t\t\t<td>a</td><td>b</td><td>c</td><td>d</td>\r\n"); out.write("\t\t\t</tr>\r\n"); out.write("\t\t</table>\r\n"); out.write("\t</body>\r\n"); out.write("</html>");
第二种情况(<jsp:include>包含的是jsp文件):

DynamicInclude.jsp:

[html]
<%@pagecontentType="text/html;charset=gb2312"%> 
<html> 
         <head> 
                   <title>动态包含</title> 
         </head> 
         <bodystylebodystyle="background-color:lightblue"> 
  
                   <jsp:include page="header.jsp"flush="true"/><!--动态包含--> 
  
                   <tablebordertableborder="1" align="center"> 
                            <tr> 
                                     <td>姓名</td><td>性别</td><td>年龄</td><td>爱好</td> 
                            </tr> 
                            <tr> 
                                     <td>a</td><td>b</td><td>c</td><td>d</td> 
                            </tr> 
                   </table> 
         </body> 
</html> 
<%@pagecontentType="text/html;charset=gb2312"%> <html> <head> <title>动态包含</title> </head> <bodystyle="background-color:lightblue"> <jsp:include page="header.jsp"flush="true"/><!--动态包含--> <tableborder="1" align="center"> <tr> <td>姓名</td><td>性别</td><td>年龄</td><td>爱好</td> </tr> <tr> <td>a</td><td>b</td><td>c</td><td>d</td> </tr> </table> </body> </html>
Header.jsp :
[html]
<%@pagecontentType="text/html;charset=gb2312"%> 
<html> 
         <body> 
                   <h2styleh2style="font-family:arial;color:red;font-size:25px;text-align:center"> 
                            动态包含的标题(JSP) 
                   </h2> 
         </body> 
</html> 
<%@pagecontentType="text/html;charset=gb2312"%> <html> <body> <h2style="font-family:arial;color:red;font-size:25px;text-align:center"> 动态包含的标题(JSP) </h2> </body> </html>
运行之后,生成了两个servlet:DynamicInclude_jsp.java和header_jsp.java,这也是为什么 Header.jsp中要写上<%@page contentType="text/html;charset=gb2312"%>和完整的<html></html>和<body></body>,而Header.html不用写的原因。因为前者两个.jsp文件是两个相互独立的整体,它们之间的关系是通过request和reponse来发生的,而后者只是简单的嵌套。两个servlet对应的代码如下:



DynamicInclude_jsp.java:

[html]
out.write("\r\n"); 
out.write("<html>\r\n"); 
out.write("\t<head>\r\n"); 
out.write("\t\t<title>动态包含</title>\r\n"); 
out.write("\t</head>\r\n"); 
out.write("\t<bodystylebodystyle=\"background-color:lightblue\">\r\n"); 
out.write("\r\n"); 
out.write("\t\t"); 
<span style="color:#ff0000;">org.apache.jasper.runtime.JspRuntimeLibrary.include(request,response, "header.jsp", out, true);</span> 
out.write("<!--动态包含-->\r\n"); 
out.write("\r\n"); 
out.write("\t\t<table border=\"1\"align=\"center\">\r\n"); 
out.write("\t\t\t<tr>\r\n"); 
out.write("\t\t\t\t<td>姓名</td><td>性别</td><td>年龄</td><td>爱好</td>\r\n"); 
out.write("\t\t\t</tr>\r\n"); 
out.write("\t\t\t<tr>\r\n"); 
out.write("\t\t\t\t<td>a</td><td>b</td><td>c</td><td>d</td>\r\n"); 
out.write("\t\t\t</tr>\r\n"); 
out.write("\t\t</table>\r\n"); 
out.write("\t</body>\r\n"); 
out.write("</html>"); 
out.write("\r\n"); out.write("<html>\r\n"); out.write("\t<head>\r\n"); out.write("\t\t<title>动态包含</title>\r\n"); out.write("\t</head>\r\n"); out.write("\t<bodystyle=\"background-color:lightblue\">\r\n"); out.write("\r\n"); out.write("\t\t"); <span style="color:#ff0000;">org.apache.jasper.runtime.JspRuntimeLibrary.include(request,response, "header.jsp", out, true);</span> out.write("<!--动态包含-->\r\n"); out.write("\r\n"); out.write("\t\t<table border=\"1\"align=\"center\">\r\n"); out.write("\t\t\t<tr>\r\n"); out.write("\t\t\t\t<td>姓名</td><td>性别</td><td>年龄</td><td>爱好</td>\r\n"); out.write("\t\t\t</tr>\r\n"); out.write("\t\t\t<tr>\r\n"); out.write("\t\t\t\t<td>a</td><td>b</td><td>c</td><td>d</td>\r\n"); out.write("\t\t\t</tr>\r\n"); out.write("\t\t</table>\r\n"); out.write("\t</body>\r\n"); out.write("</html>");


header_jsp.java:   

[html]
out.write("\r\n"); 
out.write("<html>\r\n"); 
out.write("\t<body>\r\n"); 
out.write("\t\t<h2 style=\"font-family:arial;color:red;font-size:25px;text-align:center\">\r\n"); 
out.write("\t\t\t动态包含的标题(JSP)\r\n"); 
out.write("\t\t</h2>\r\n"); 
out.write("\t</body>\r\n"); 
out.write("</html>"); 
out.write("\r\n"); out.write("<html>\r\n"); out.write("\t<body>\r\n"); out.write("\t\t<h2 style=\"font-family:arial;color:red;font-size:25px;text-align:center\">\r\n"); out.write("\t\t\t动态包含的标题(JSP)\r\n"); out.write("\t\t</h2>\r\n"); out.write("\t</body>\r\n"); out.write("</html>");


<%@include%>:静态包含

第一种情况:<%@include%>包含的是jsp文件。

StaticInclude.jsp:

[html]
<%@pagecontentType="text/html;charset=gb2312"%> 
<html> 
         <head> 
                   <title>静态包含</title> 
         </head> 
         <bodystylebodystyle="background-color:lightblue"> 
  
                   <%@include file="header.jsp"%><!--静态包含--> 
                   <tablebordertableborder="1" align="center"> 
                            <tr> 
                                     <td>姓名</td><td>性别</td><td>年龄</td><td>爱好</td> 
                            </tr> 
                            <tr> 
                                     <td>a</td><td>b</td><td>c</td><td>d</td> 
                            </tr> 
                   </table> 
         </body> 
</html> 
<%@pagecontentType="text/html;charset=gb2312"%> <html> <head> <title>静态包含</title> </head> <bodystyle="background-color:lightblue"> <%@include file="header.jsp"%><!--静态包含--> <tableborder="1" align="center"> <tr> <td>姓名</td><td>性别</td><td>年龄</td><td>爱好</td> </tr> <tr> <td>a</td><td>b</td><td>c</td><td>d</td> </tr> </table> </body> </html>
header.jsp:

[html]
<%@pagecontentType="text/html;charset=gb2312"%> 
<h2styleh2style="font-family:arial;color:red;font-size:25px;text-align:center"> 
         静态包含的标题(JSP) 
</h2> 
<%@pagecontentType="text/html;charset=gb2312"%> <h2style="font-family:arial;color:red;font-size:25px;text-align:center"> 静态包含的标题(JSP) </h2>
运行之后,只生成一个servlet,和上面的代码对应如下:

[html]
out.write("\r\n"); 
out.write("<html>\r\n"); 
out.write("\t<head>\r\n"); 
out.write("\t\t<title>静态包含</title>\r\n"); 
out.write("\t</head>\r\n"); 
out.write("\t<body style=\"background-color:lightblue\">\r\n"); 
out.write("\r\n"); 
out.write("\t\t"); 
out.write("\r\n"); 
<span style="color:#ff0000;">out.write("<h2styleh2style=\"font-family:arial;color:red;font-size:25px;text-align:center\">\r\n"); 
out.write("\t静态包含的标题(JSP)\r\n"); 
out.write("</h2>");</span> 
out.write("<!--静态包含-->\r\n"); 
out.write("\t\t<table border=\"1\"align=\"center\">\r\n"); 
out.write("\t\t\t<tr>\r\n"); 
out.write("\t\t\t\t<td>姓名</td><td>性别</td><td>年龄</td><td>爱好</td>\r\n"); 
out.write("\t\t\t</tr>\r\n"); 
out.write("\t\t\t<tr>\r\n"); 
out.write("\t\t\t\t<td>a</td><td>b</td><td>c</td><td>d</td>\r\n"); 
out.write("\t\t\t</tr>\r\n"); 
out.write("\t\t</table>\r\n"); 
out.write("\t</body>\r\n"); 
out.write("</html>"); 
out.write("\r\n"); out.write("<html>\r\n"); out.write("\t<head>\r\n"); out.write("\t\t<title>静态包含</title>\r\n"); out.write("\t</head>\r\n"); out.write("\t<body style=\"background-color:lightblue\">\r\n"); out.write("\r\n"); out.write("\t\t"); out.write("\r\n"); <span style="color:#ff0000;">out.write("<h2style=\"font-family:arial;color:red;font-size:25px;text-align:center\">\r\n"); out.write("\t静态包含的标题(JSP)\r\n"); out.write("</h2>");</span> out.write("<!--静态包含-->\r\n"); out.write("\t\t<table border=\"1\"align=\"center\">\r\n"); out.write("\t\t\t<tr>\r\n"); out.write("\t\t\t\t<td>姓名</td><td>性别</td><td>年龄</td><td>爱好</td>\r\n"); out.write("\t\t\t</tr>\r\n"); out.write("\t\t\t<tr>\r\n"); out.write("\t\t\t\t<td>a</td><td>b</td><td>c</td><td>d</td>\r\n"); out.write("\t\t\t</tr>\r\n"); out.write("\t\t</table>\r\n"); out.write("\t</body>\r\n"); out.write("</html>");
第二种情况:<%@include%>包含的是html文件。

StaticInclude.jsp:

[html]
<%@pagecontentType="text/html;charset=gb2312"%> 
<html> 
         <head> 
                   <title>静态包含</title> 
         </head> 
         <bodystylebodystyle="background-color:lightblue"> 
  
                   <%@include file="header.html"%><!--静态包含--> 
                   <tablebordertableborder="1" align="center"> 
                            <tr> 
                                     <td>姓名</td><td>性别</td><td>年龄</td><td>爱好</td> 
                            </tr> 
                            <tr> 
                                     <td>a</td><td>b</td><td>c</td><td>d</td> 
                            </tr> 
                   </table> 
         </body> 
</html> 
<%@pagecontentType="text/html;charset=gb2312"%> <html> <head> <title>静态包含</title> </head> <bodystyle="background-color:lightblue"> <%@include file="header.html"%><!--静态包含--> <tableborder="1" align="center"> <tr> <td>姓名</td><td>性别</td><td>年龄</td><td>爱好</td> </tr> <tr> <td>a</td><td>b</td><td>c</td><td>d</td> </tr> </table> </body> </html>
header.html:

[html]
<%@pagecontentType="text/html;charset=gb2312"%> 
<h2styleh2style="font-family:arial;color:red;font-size:25px;text-align:center"> 
         静态包含的标题(HTML) 
</h2> 
<%@pagecontentType="text/html;charset=gb2312"%> <h2style="font-family:arial;color:red;font-size:25px;text-align:center"> 静态包含的标题(HTML) </h2>


运行之后,也是只生成一个servlet,和上面的代码对应如下:

[html]
out.write("\r\n"); 
out.write("<html>\r\n"); 
out.write("\t<head>\r\n"); 
out.write("\t\t<title>静态包含</title>\r\n"); 
out.write("\t</head>\r\n"); 
out.write("\t<bodystylebodystyle=\"background-color:lightblue\">\r\n"); 
out.write("\r\n"); 
out.write("\t\t"); 
out.write("\r\n"); 
<span style="color:#ff0000;">out.write("<h2styleh2style=\"font-family:arial;color:red;font-size:25px;text-align:center\">\r\n"); 
out.write("\t静态包含的标题(HTML)\r\n"); 
out.write("</h2>");</span> 
out.write("<!--静态包含-->\r\n"); 
out.write("\t\t<table border=\"1\"align=\"center\">\r\n"); 
out.write("\t\t\t<tr>\r\n"); 
out.write("\t\t\t\t<td>姓名</td><td>性别</td><td>年龄</td><td>爱好</td>\r\n"); 
out.write("\t\t\t</tr>\r\n"); 
out.write("\t\t\t<tr>\r\n"); 
out.write("\t\t\t\t<td>a</td><td>b</td><td>c</td><td>d</td>\r\n"); 
out.write("\t\t\t</tr>\r\n"); 
out.write("\t\t</table>\r\n"); 
out.write("\t</body>\r\n"); 
out.write("</html>"); 
out.write("\r\n"); out.write("<html>\r\n"); out.write("\t<head>\r\n"); out.write("\t\t<title>静态包含</title>\r\n"); out.write("\t</head>\r\n"); out.write("\t<bodystyle=\"background-color:lightblue\">\r\n"); out.write("\r\n"); out.write("\t\t"); out.write("\r\n"); <span style="color:#ff0000;">out.write("<h2style=\"font-family:arial;color:red;font-size:25px;text-align:center\">\r\n"); out.write("\t静态包含的标题(HTML)\r\n"); out.write("</h2>");</span> out.write("<!--静态包含-->\r\n"); out.write("\t\t<table border=\"1\"align=\"center\">\r\n"); out.write("\t\t\t<tr>\r\n"); out.write("\t\t\t\t<td>姓名</td><td>性别</td><td>年龄</td><td>爱好</td>\r\n"); out.write("\t\t\t</tr>\r\n"); out.write("\t\t\t<tr>\r\n"); out.write("\t\t\t\t<td>a</td><td>b</td><td>c</td><td>d</td>\r\n"); out.write("\t\t\t</tr>\r\n"); out.write("\t\t</table>\r\n"); out.write("\t</body>\r\n"); out.write("</html>");
由上可以总结出:

对于静态包含,<%@include%>,中包含的文件,只是简单的嵌入到主文件中,就是在jsp页面转化成Servlet时才嵌入到主文件中,因为运行的结果是只生成了一个Servlet。

而对于动态包含<jsp:incude>,如果被包含文件是动态的,那么就会生成两个Servlet,也就是被包含文件也要经过jsp引擎编译执行生成一个Servlet,两个Servlet通过request和reponse进行通信。如果被包含的文件是静态的,那么这种情况和<%@include>就很相似,只生成了一个Servlet,但是他们之间没有进行简单的嵌入,而依然是通过request和reponse进行的通信。
分享到:
评论

相关推荐

    JSP:include和include指令区别

    在JavaServer Pages (JSP) 技术中,`&lt;jsp:include&gt;` 和 `&lt;%@ include %&gt;` 是两个用于页面组合的指令,它们虽然都用于将一个或多个文件的内容插入到主页面中,但它们的工作机制和使用场景有所不同。理解这两者的区别...

    j2ee12:jsp01:jsp页面嵌套java代码、<%@ %>的使用

    5. **JSP动作标签**:除了`&lt;%@ %&gt;`,还有 `&lt;jsp:include&gt;`, `&lt;jsp:forward&gt;`, `&lt;jsp:params&gt;` 等JSP动作标签,它们用于处理页面间的跳转、包含和参数传递。 6. **EL(Expression Language)**:EL是JSP 2.0引入的一...

    jsp java 购物车

    查询到如下记录:&lt;BR&gt; &lt;% StringBuffer b=book.getMessageBybook_id(); %&gt; &lt;%=b%&gt; &lt;P&gt;如果准备订购该书,请填写订单,点击"添加到订单"按钮&lt;BR&gt; &lt;%if((book.getId())!=0) {%&gt; &lt;FORM action="&lt;%=str%&gt;" method=...

    JSP技术基础知识

    5. **动作元素**(Action):用于插入动态内容或引用外部资源,如`&lt;jsp:include&gt;`、`&lt;jsp:param&gt;`等。 #### 四、JSP的优点 1. **跨平台性**:由于Java本身具有良好的跨平台特性,因此基于JSP的应用程序可以在多种...

    jsp的include的两种用法

    JSP 中的 Include 有两种用法,分别是 `&lt;%@ include file=” ”%&gt;` 和 `&lt;jsp:include page=” ” flush=”true”/&gt;`。这两种用法都可以用于引入其他 JSP 文件,但是它们之间存在着一些关键的区别。 首先,让我们...

    include 两种用法的区别

    &lt;%-- 或者使用静态包含:&lt;%@ include file="date.jsp" %&gt; --%&gt; &lt;/head&gt; &lt;body&gt; &lt;p&gt;今天的日期是:&lt;/p&gt; &lt;/body&gt; &lt;/html&gt; ``` 如果使用`&lt;jsp:include page="date.jsp" flush="true"/&gt;`,那么每当访问`test.jsp...

    用jsp:include控制动态内容的方法.docx

    nt test&lt;/title&gt;&lt;/head&gt;&lt;body&gt;This content is statically in the main JSP file.&lt;br/&gt;&lt;jsp:include page="included.html"/&gt;&lt;/body&gt;&lt;/html&gt;]]&gt;)正如你所见,清单2使用了传统的`&lt;%@include file="..."%&gt;`伪指令来包含...

    jsp基础测试 期末考试

    考虑下面JSP文件代码片断: ...&lt;jsp:include page=”test2.jsp”&gt; &lt;jsp:param name=”username” value=”accp”/&gt; &lt;/jsp:include&gt; &lt;/BODY&gt; &lt;/HTML&gt; 以下( )代码片断放置在test2.jsp中不会导致错误。

    JSP图书管理系统

    &lt;td height="277" align="center" valign="top"&gt;&lt;%@include file="changxiao.jsp"%&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;br&gt; &lt;table width="208" height="356" border="0" cellpadding="0" cellspacing="0" background=...

    jsp页面错误信息

    &lt;tr&gt;&lt;td colspan="2"&gt;&lt;jsp:include page="view/AdminTop.jsp" /&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr bgcolor="#F0EAED"&gt; &lt;td width="180" valign="top"&gt;&lt;jsp:include page="view/AdminLeft.jsp"/&gt;&lt;/td&gt; &lt;td width="598" align=...

    JSP页面的头和脚

    `&lt;%@ include %&gt;` 指令是 JSP 提供的一种机制,用于将一个文件插入到另一个文件中。这种方式主要用于重用代码块,例如页面头部、底部等。 ##### 语法 ```jsp &lt;%@ include file="relativeURLspec" %&gt; ``` 这里的 `...

    jsp语法概述,详细讲解ppt语法的ppt,适合初学者

    动作语法包括&lt;jsp:forward&gt;、&lt;jsp:include&gt;、&lt;jsp:plugin&gt;、&lt;jsp:getProperty&gt; 和 &lt;jsp:setProperty&gt; 等。 在 JSP 语法中,声明用于在页面上输出信息,语法格式如下:&lt;%! declaration; [ declaration; ] ... %&gt; 或 ...

    JSP动作元素.pptx

    标准动作元素是JSP提供的一些基本动作元素,例如&lt;jsp:include&gt;、&lt;jsp:param&gt;、&lt;jsp:forward&gt;、&lt;jsp:useBean&gt;、&lt;jsp:getProperty&gt;、&lt;jsp:setProperty&gt;和&lt;jsp:plugin&gt;等。自定义动作元素是开发者根据需求自定义的动作...

    Jsp.rar_jsp

    &lt;jsp:include page="footer.jsp"&gt; &lt;jsp:param name="message" value="欢迎访问!"/&gt; &lt;/jsp:include&gt; &lt;/body&gt; &lt;/html&gt; ``` ### 主要标签 JSP还支持使用自定义标签库,比如JSTL(JavaServer Pages Standard Tag ...

    jsp简单语法,servlet,JSP概述,JSP页面构成,注释,指令,脚本元素,动作元素,错误处理

    - **动作元素**:用于调用JSP组件,如`&lt;jsp:include&gt;`, `&lt;jsp:forward&gt;`, `&lt;jsp:param&gt;`等。 **3. 注释** 在JSP中,可以使用HTML注释(`&lt;!-- ... --&gt;`)或Java注释(`//`, `/* ... */`)。Java注释在JSP被翻译成...

    JSP经典例子教程-100例

    &lt;p&gt;当前时间:&lt;%= currentTime %&gt;&lt;/p&gt; ``` 在这个示例中,我们首先创建了一个`Date`对象来获取当前日期时间,然后使用`SimpleDateFormat`类格式化时间字符串,最后通过`&lt;%= currentTime %&gt;`输出到页面上。 #### 4....

    学会jsp,突击jsp

    1. **JSP指令**:JSP提供了三种类型的指令,包括`&lt;%@ page %&gt;`, `&lt;%@ include %&gt;`, 和`&lt;jsp:forward&gt;`。`&lt;%@ page %&gt;`用来设置整个页面的属性,如编码、错误页面等;`&lt;%@ include %&gt;`用于在运行时将一个文件包含到...

Global site tag (gtag.js) - Google Analytics