什么是JSPJSP全名為Java Server Pages,java服務(wù)器頁(yè)面。JSP是一種基于文本的程序,其特點(diǎn)就是HTML和Java代碼共同存在!

為什么需要" />

国产成人精品无码青草_亚洲国产美女精品久久久久∴_欧美人与鲁交大毛片免费_国产果冻豆传媒麻婆精东

15158846557 在線咨詢 在線咨詢
15158846557 在線咨詢
所在位置: 首頁(yè) > 營(yíng)銷資訊 > 網(wǎng)站運(yùn)營(yíng) > JSP是什么?

JSP是什么?

時(shí)間:2023-11-10 07:48:01 | 來(lái)源:網(wǎng)站運(yùn)營(yíng)

時(shí)間:2023-11-10 07:48:01 來(lái)源:網(wǎng)站運(yùn)營(yíng)

JSP是什么?:如果你了解什么是Servlet,那JSP就很好學(xué)了,如果該回答幫助到你,不妨給我點(diǎn)個(gè)贊!

什么是JSP

JSP全名為Java Server Pages,java服務(wù)器頁(yè)面。JSP是一種基于文本的程序,其特點(diǎn)就是HTML和Java代碼共同存在

為什么需要JSP

JSP是為了簡(jiǎn)化Servlet的工作出現(xiàn)的替代品,Servlet輸出HTML非常困難,JSP就是替代Servlet輸出HTML的。

簡(jiǎn)單使用一下JSP

<%@ page contentType="text/html;charset=UTF-8" language="java" %> <html> <head> <title>簡(jiǎn)單使用JSP</title> </head> <body> </body> </html><%@ page contentType="text/html;charset=UTF-8" language="java" %> <html> <head> <title>簡(jiǎn)單使用JSP</title> </head> <body> <% String s = "HelloWorld"; out.println(s); %> </body> </html>








JSP的工作原理

package org.apache.jsp;import javax.servlet.*;import javax.servlet.http.*;import javax.servlet.jsp.*;import java.util.Date;public final class _1_jsp extends org.apache.jasper.runtime.HttpJspBase implements org.apache.jasper.runtime.JspSourceDependent { private static final JspFactory _jspxFactory = JspFactory.getDefaultFactory(); private static java.util.List<String> _jspx_dependants; private javax.el.ExpressionFactory _el_expressionfactory; private org.apache.tomcat.InstanceManager _jsp_instancemanager; public java.util.List<String> getDependants() { return _jspx_dependants; } public void _jspInit() { _el_expressionfactory = _jspxFactory.getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory(); _jsp_instancemanager = org.apache.jasper.runtime.InstanceManagerFactory.getInstanceManager(getServletConfig()); } public void _jspDestroy() { } public void _jspService(final HttpServletRequest request, final HttpServletResponse response) throws java.io.IOException, ServletException { final PageContext pageContext; HttpSession session = null; final ServletContext application; final ServletConfig config; JspWriter out = null; final Object page = this; JspWriter _jspx_out = null; PageContext _jspx_page_context = null; try { response.setContentType("text/html;charset=UTF-8"); pageContext = _jspxFactory.getPageContext(this, request, response, null, true, 8192, true); _jspx_page_context = pageContext; application = pageContext.getServletContext(); config = pageContext.getServletConfig(); session = pageContext.getSession(); out = pageContext.getOut(); _jspx_out = out; out.write("/r/n"); out.write("/r/n"); out.write("<html>/r/n"); out.write("<head>/r/n"); out.write(" <title>簡(jiǎn)單使用JSP</title>/r/n"); out.write("</head>/r/n"); out.write("<body>/r/n"); String s = "HelloWorda"; out.println(s); out.write("/r/n"); out.write("</body>/r/n"); out.write("</html>/r/n"); } catch (Throwable t) { if (!(t instanceof SkipPageException)){ out = _jspx_out; if (out != null && out.getBufferSize() != 0) try { out.clearBuffer(); } catch (java.io.IOException e) {} if (_jspx_page_context != null) _jspx_page_context.handlePageException(t); } } finally { _jspxFactory.releasePageContext(_jspx_page_context); } }}out.write("/r/n"); out.write("/r/n"); out.write("<html>/r/n"); out.write("<head>/r/n"); out.write(" <title>簡(jiǎn)單使用JSP</title>/r/n"); out.write("</head>/r/n"); out.write("<body>/r/n");String s = "HelloWorda"; out.println(s);

Servlet+Tomcat

JSP(了解即可)

監(jiān)聽(tīng)器和過(guò)濾器


海量視頻資源

在公主號(hào)下回復(fù)「888」即可獲取?。?br>



本已收錄至我的GitHub精選文章,歡迎Starhttps://github.com/ZhongFuCheng3y/3y
求點(diǎn)贊 求關(guān)注? 求分享 求留言 對(duì)我來(lái)說(shuō)真的 非常有用!?。?/blockquote>

收藏等于白嫖,點(diǎn)贊才是真情!

收藏等于白嫖,點(diǎn)贊才是真情!

收藏等于白嫖,點(diǎn)贊才是真情!

關(guān)鍵詞:

74
73
25
news

版權(quán)所有? 億企邦 1997-2025 保留一切法律許可權(quán)利。

為了最佳展示效果,本站不支持IE9及以下版本的瀏覽器,建議您使用谷歌Chrome瀏覽器。 點(diǎn)擊下載Chrome瀏覽器
關(guān)閉