⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 req_url.xtp

📁 解压在c盘
💻 XTP
字号:
<s1 title="URLs"><p>The <var/request/>object breaks down the request URL into components.  Servlets and JSPpages can use those components to vary the response while using thesame servlet or JSP page.</p><p>Some reasons you may need to look at the URL information:</p><ul><li>form submission<li>selecting sections of a manual<li>displaying different stories on a news site<li>displaying comments on a discussion group<li>sort preferences for the discussion site<li>search results</ul><s2 title="RequestURI"><p><var/getRequestURI()/> returns the full path, excluding any query string.</p></s2><s2 title="ServletPath"><p><var/getServletPath()/> returns the URI prefix that matches theservlet.  In the case of a JSP, it will return everything up to the*.jsp.</p><p>The servlet path is useful for servlets like JSP, XTP, or SSI thatread and transform files.</p></s2><s2 title="PathInfo"><p><var/getPathInfo()/> returns everything after the ServletPath.</p><p>A discussion board servlet could use PathInfo to select storiesand comments.</p></s2><s2 title="QueryString"><p><var/getQueryString()/> returns the query string, everything afterthe '?'</p><p>Often, query strings are the result of form submissions but it'salso useful for database-driven sites.  For example, you might encode"story 15, comment 7" of a discussion as <var//comment.xtp?story=15&comment=7/>.</p></s2><example>http://localhost:8080/test/env.jsp/tail?a=b</example><example title='env.jsp'>&lt;table>&lt;tr>&lt;td>URI         &lt;td>&lt;%= request.getRequestURI() %>&lt;tr>&lt;td>ServletPath &lt;td>&lt;%= request.getServletPath() %>&lt;tr>&lt;td>PathInfo    &lt;td>&lt;%= request.getPathInfo() %>&lt;tr>&lt;td>QueryString &lt;td>&lt;%= request.getQueryString() %>&lt;tr>&lt;td>a           &lt;td>&lt;%= request.getParameter("a") %>&lt;/table></example><results>URI          /test/env.jsp/tailServletPath  /test/env.jspPathInfo     /tailQueryString  a=ba            b</results></s1>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -