亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? webapp-begin.xtp

?? RESIN 3.2 最新源碼
?? XTP
?? 第 1 頁 / 共 4 頁
字號:
session is needed, a session will be created for the user if it has not alreadyand the <var>session</var> variable will be made available.</p><example>&lt;%@page session="true"&gt;</example><p>The default for <code>session</code> is <var>true</var>, which isconvenient for pages that need the session, but creates an undue burden on theserver if the page does not need the session.  Therefore it is best to mark allJSP pages with <code>session="false"</code> unless they really do need thesession.</p><example>&lt;%@page session="false"&gt;</example></s3></s2> <!-- obtain-jsp --></s1> <!-- obtain --><s1 name="attributes" title="Attributes"><p>Each of the objects <code>application</code>, <code>session</code>, and<code>request</code> can have <var>attributes</var>. These attributes consistof a <var>name</var> and a <var>value</var>.</p><p>Using attributes the developer can store a value for later retrieval.</p><p>The <var>name</var> is a String that uniquely identifies the attribute, and the<var>value</var> is a Java object.</p><s2 title="The API for setting and getting attributes"><p>The following methods are available for the <code>application</code>,<code>session</code>, and <code>request</code> objects.</p><deftable title="API for attributes"><tr><th>Method</th><th>Description</th></tr><tr><td>getAttribute(String name)</td><td>Return the <code>Object</code> that is associated with the passed<var>name</var>.  Usually you will need to cast the Object to whateverclass you know it to be.  If there is no attribute with the given name,<code>null</code> is returned.</td></tr><tr><td>setAttribute(String name, Object value)</td><td>Associates the given <var>name</var> with the <var>value</var>. If anattribute <code>name</code> already exists, it is replaced.</td></tr><tr><td>removeAttribute(String name)</td><td>Removes the attribute with the given <var>name</var> if it exists.</td></tr></deftable></s2><s2 title="Choosing where to put attributes"><p>As a developer you have a choice of which object to store attributesin. The object that you choose should be appropriate to the scopewithin which you will need to get that value out again.</p><p>Whenever possible put the attribute in the request object. If thatcannot work, put it in the session object. And very rarely, put valuesin the application object.  </p><p>The reason for this order is simple, all of the attributes in asession cannot be garbage collected until they are explicitly removedor the session expires. All of the objects in the application stayuntil they are explicitly removed or the web application is stopped orrestarted.</p></s2></s1> <!-- attributes --><s1 name="use-response" title="Using the Response object"><s2 title="Encoding the URL"><p>Probably the most important and most frequent usage of the responseobject is to rewrite the URL. Recall from earlier that in order tomaintain the identity of a Session with the user Resin mayhave to add a special parameter to every URL. The developer mustco-operate with this, using the <a href="javadoc|javax.servlet.http.HttpServletResponse|encodeURL(String)">response.encodeURL</a> method.</p><p>Because of this, it is a good idea to form a String for every URL youwill use in a page and store it in a variable:</p><example title="EncodingUrls.jsp - Encoding the URL's and storing them in a String variable">&lt;%    String boatUrl = response.encodeURL("water/boat.jsp");    String goatUrl = response.encodeURL("animals/goat.jsp");%&gt;&lt;%-- the presentation --%&gt;Hello, would you like some green eggs and ham?Would you, could you, on a &lt;a href='&lt;%= boatUrl %&gt;'&gt;boat&lt;/a&gt;?Would you, could you, with a&lt;a href='&lt;%= goatUrl %&gt;'&gt;goat&lt;/a&gt;?</example><p>This has the added benefit of placing all of your URL's inone place, allowing you to change them more easily.</p></s2><s2 name="redirect" title="Redirecting the users browser"><p>Sometimes it is desirable to send a redirect to the client. This is aresponse to the client that tells it to go to some other URL. This isoften used by developers so that the URL in the browser makes sense tothe user. It is however, a slow procedure because it requires aresponse to go all the way back to the browser, and then the browserwill make a new request.</p><p>The redirect is accomplished by using the <code>response.sendRedirect()</code>method. Again, the URL must be encoded, and a special kind of encodingis needed for a redirect:</p><example title="Redirect.jsp - an example of redirecting the client">&lt;%    String redirectUrl =      response.encodeRedirectURL("elsewhere.jsp");   response.sendRedirect(redirectUrl);%&gt;</example><s3 title="A note on redirecting wireless devices"><p>Redirects often do not work with wireless devices like cell phones and WMLclients, and the emulators of these devices. As well, the latency of a wirelessconnection compounds the speed problem of using redirects.  Redirects shouldprobably be avoided with wireless devices.</p></s3></s2> <!-- redirect --><s2 title="Setting the content type dynamically"><p>As mentioned eariler, the <code>&lt;%@ page contentType="..." %&gt;</code>directive can be used to tell the browser the type of content that it isgetting.</p><p>The page directive method does not allow you to do thisdynamically. You can instead use: <code>response.setContentType("...")</code>to set the content type.</p></s2><s2 title="Telling the browser not to cache the page"><p>Often it is necessary to inform the browser that a page should not becached - the browser should ask for a new copy of the page everytime. The best way to do this is by setting appropriate HTTP headersin the response to the browser.</p><p>Unfortunately, all the browsers work differently.  The following seemsto be a consensus on the headers to set:</p><example title="nocache.jsp - Stop the browser from caching the page">&lt;%/** stop browser from caching */response.setHeader("Cache-Control","no-cache,post-check=0,pre-check=0,no-cache");response.setHeader("Pragma","no-cache");response.setHeader("Expires","Thu,01Dec199416:00:00GMT");%&gt;</example></s2><s2 title="Telling the browser that the page is private"><p>A little known fact is that it is necessary to inform the browser withcertain pages that they are private pages, meaning they should neverbe seen by anyone except the current user.</p><p>This applies to any pages that the user has needed a password to get to.</p><example title="private.jsp - Telling the browser the page is private">&lt;%/** * Add an HTTP header to the response that  * indicates to the browser and any * intervening cache's that this is a private  * page, and should never be seen * by a different user. */response.addHeader("Cache-Control","private");%&gt;</example></s2></s1> <!-- use-response --><s1 name="use-request" title="Using the Request object"><s2 title="Retrieving the values set in form fields"><p>The main use of the request object is to get the values that a userhas supplied in a form submit. For example, with this HTML onpage a.jsp:</p><example title="a.jsp - a form that submits a value">&lt;%     String bUrl = response.encodeUrl("b.jsp");%&gt;&lt;%-- presentation --%&gt;&lt;form method="post" action="&lt;%= bUrl %&gt;"&gt;What is your favourite kind of eggs?&lt;input type="text" name="favegss" size="25"&gt;&lt;br&gt;&lt;input type="submit" value="Submit"&gt;&lt;input type="reset" value="Reset"&gt;&lt;/form&gt;</example><p>The value that was supplied in ``eggs'' can be retrieved with:</p><example title="b.jsp - retrieving a value from a form submit">&lt;%     String aUrl = response.encodeUrl("a.jsp");%&gt;&lt;%     String faveggs = request.getParameter("eggs");     if ((faveggs != null) &amp;&amp; (faveggs.trim().length() == 0))        faveggs = null;%&gt;&lt;%-- presentation --%&gt;&lt;% if (faveggs == null) { %&gt;No eggs supplied!&lt;a href="&lt;%= aUrl %&gt;"&gt;Try again&lt;/a&gt;&lt;% } else if (faveggs.equals("green"))  { %&gt;Of course we have &lt;%= faveggs %&gt; eggs! It's one of our favourites too.&lt;% } else { %&gt;We do not have &lt;%= faveggs %&gt; eggs.&lt;% } %&gt;</example></s2></s1> <!-- use-request --><s1 name="use-session" title="Using the Session object"><p>The Session object is used primarily to store two types ofinformation. The first is information about the user, and the secondis data that is built up and used over multiple pages.  A classicexample of information you would store in a session is user profileinformation, or a shopping cart that is filled up over many pages.</p><p>It is important to try to limit the amount of information that isstored in the session object.</p><s2 title="Explicitly causing the session to end"><p>The session object will go away if the user is inactive for a certaintime (usually 1/2 hour). You can also explicitly destroy the session,which you may want to do for example if the user chooses to logout.</p><p>This is accomplished with: <code>session.invalidate();</code></p></s2><s2 title="Doing something when the Session goes away"><p>It is possible to add a hook so that something can be done whenResin decides that a Session has expired, or the Session isexplicitly destroyed.</p><p>To accomplish this, you write a class that implements the<a href="javadoc|javax.servlet.http.HttpSessionBindingListener|"/> interface.Then you register this class with the session simply by putting it as one ofthe attributes. The Session will notify all of it's attributes that implement <a href="javadoc|javax.servlet.http.HttpSessionBindingListener|"/>.</p><example title="SessionBind.jsp - An example of getting notification when a Session is destroyed">&lt;%@page import="example.SessionListener" %&gt;&lt;%    // example.SessionListener implements HttpSessionBindingListener     SessionListener d = new SessionListener();    session.setAttribute("sessiongoesbyebye", d);%&gt;</example></s2><s2 title="Warning! One session does not mean one browser window!"><p>It is important to realize that the user can have multiplewindows open that use the same session. If the user uses the "Open innew Window" functionality of a browser, they will have two windowsopen and the Web Application will see them both as belonging to thesame session. This has some ramifications on how the Session can beused for shopping-cart like applications.</p><p>For example, let's assume that an application uses the Sessionattribute "cart" to store shopping cart information about differenttypes of juice a user has chosen to purchase. </p><p>The user may start one juice buying transaction and get to theconfirmation page, having 3 grape and 2 apple in theircart. Now, what happens if at this point they use another browserwindow to initiate another purchase? If the Web Application is usingthe Session to store shopping cart information then the second windowmay destroy the contents of the shopping cart, so that if the userfinishes the first window they end up buying nothing!</p><p>A possible solution for this is to keep a <var>version counter</var> in yourcart.  Every time the cart is changed, the version counter is updated.Then, when your application shows the "confirm purchase" page (the next actionwill cause the purchase to occur), it sends the version counter to the "confirmpurchase page".  The "confirm purchase" page submits that version counter as aparameter.  The application can check the submitted version counter, and thecurrent version counter in the shopping cart - if they are different then thecart has been modified in some other way, and a message is returned that thepurchase did not occur because the cart had been modified elsewhere.</p></s2></s1> <!-- use-session --><s1 name="errors" title="Error Handling"><s2 title="JSP Translation Time Processing Errors"><p>Some errors may occur at JSP translation time.  This could be, forexample, from an error in the syntax of some Java code in your JSP.You will usually see this error in your browser the first time you tryto access the page.  Resin can also put the error in log files.</p><p>From the JSP specification:</p><blockquote>The translation of a JSP page source into a corresponding JSP pageimplementation class using the Java technology by a JSP container canoccur at any time between initial deployment of the JSP page into theruntime environment of a JSP container, and the receipt and processingof a client request for the target JSP page. If translation occursprior to the JSP container receiving a client request for the target(untranslated) JSP page then error processing and notification isimplementation dependent. Fatal translation failures shall result insubsequent client requests for the translation target to also befailed with the appropriate error; for HTTP protocols, error statuscode 500 (Server Error).</blockquote></s2><s2 title="Coompilation Time Processing Errors"><p>Some errors may occur at the time a Servlet or other source file is beingcompiled by Resin. This could be, for example, from an error in the syntax ofthe Java code.You will usually see this error in your browser the first time you tryto access the page.  Resin might also put the error in log files.</p></s2><s2 title="Client Request Time Processing Errors"><p>Java handles runtime errors with exceptions.  If an exception is notcaught in your JSP or Servlet, Resin will use a special error pageto send results back to the browser.  Resin uses a default errorpage unless you explicitly provide an error page yourself.</p><p>From the JSP specification:</p><blockquote><p>During the processing of client requests, arbitrary runtime errors canoccur in either the body of the JSP page implementation class or insome other code (Java or other implementation programming language)called from the body of the JSP page implementation class. Such errorsare realized in the page implementation using the Java programminglanguage exception mechanism to signal their occurrence to caller(s)of the offending behavior 1 .  These exceptions may be caught andhandled (as appropriate) in the body of the JSP page implementationclass.</p><p>However, any uncaught exceptions thrown from the body of the JSP pageimplementation class result in the forwarding of the client requestand uncaught exception to the errorPage URL specified by the offendingJSP page (or the implementation default behavior, if none isspecified).

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
婷婷夜色潮精品综合在线| 国产精品久久久久久亚洲伦| 日韩经典中文字幕一区| 欧美一区二区精品| 国产最新精品精品你懂的| 国产精品少妇自拍| 欧美顶级少妇做爰| 国产精品综合网| 有坂深雪av一区二区精品| 日韩欧美在线一区二区三区| 91丨九色丨国产丨porny| 日本成人在线视频网站| 国产精品久久夜| 1024国产精品| 久久综合九色综合欧美98| 91亚洲精品乱码久久久久久蜜桃| 成人综合激情网| 日本中文在线一区| 国内精品不卡在线| 成人av资源在线观看| 精品一区二区三区av| 一区二区三区四区中文字幕| 国产无一区二区| 制服.丝袜.亚洲.另类.中文| 色欧美日韩亚洲| 国产一区二区免费视频| 日韩高清国产一区在线| 激情综合五月婷婷| 972aa.com艺术欧美| 国产成人综合亚洲91猫咪| 激情文学综合插| jlzzjlzz国产精品久久| 成人一区二区三区视频| 一本大道久久精品懂色aⅴ| 欧美色国产精品| 一本在线高清不卡dvd| 欧美精品 日韩| 亚洲国产电影在线观看| 久久九九影视网| 亚洲激情在线激情| 久久国产精品无码网站| 精品国产sm最大网站| 国产最新精品免费| 99国产精品国产精品久久| 欧美三级午夜理伦三级中视频| 欧美xxxxxxxx| 亚洲精品在线观| 一区二区中文字幕在线| 亚洲va天堂va国产va久| 亚洲一区在线观看免费| 亚洲一级二级在线| 激情久久五月天| 91传媒视频在线播放| 日本韩国精品一区二区在线观看| 欧美大片顶级少妇| 精品处破学生在线二十三| 亚洲美女视频在线观看| 亚洲精品福利视频网站| 国内成人免费视频| 欧美日韩精品三区| 欧美一区二区美女| 亚洲精品一二三| 国产成人午夜片在线观看高清观看| 欧美私模裸体表演在线观看| 51精品国自产在线| **欧美大码日韩| 国产呦萝稀缺另类资源| 欧美人牲a欧美精品| **性色生活片久久毛片| 国产一区二区三区四区五区美女| 欧美另类高清zo欧美| 中文字幕亚洲区| 国产一区二区免费视频| 欧美一区二区三区免费视频| 亚洲一区二区三区四区在线观看 | 精品免费一区二区三区| 偷拍与自拍一区| 日本精品一级二级| 中文字幕日韩av资源站| 国产成人在线看| 精品国产免费视频| 日本美女一区二区| 欧美高清性hdvideosex| 亚洲成人午夜电影| 色婷婷一区二区三区四区| 国产精品视频yy9299一区| 国产一区二区三区高清播放| 日韩一卡二卡三卡四卡| 五月天一区二区| 欧美三级日本三级少妇99| 一区二区欧美在线观看| 91色porny在线视频| 国产精品国产三级国产aⅴ原创| 韩国三级中文字幕hd久久精品| 97精品视频在线观看自产线路二| 欧美日韩国产精选| 亚洲一区在线播放| 欧美三级电影网站| 亚洲高清免费视频| 国产精品一线二线三线精华| 精品国产凹凸成av人网站| 国产在线播放一区| 久久久久国产一区二区三区四区| 亚洲国产精品一区二区久久| 在线免费观看不卡av| 久久一留热品黄| 国产一区二区三区观看| 日本一区二区视频在线观看| 日韩国产在线观看一区| 欧美一区二区三区视频免费 | 在线一区二区观看| 亚洲综合免费观看高清完整版在线| 色老头久久综合| 亚洲va天堂va国产va久| 在线综合视频播放| 美女一区二区在线观看| 91老师片黄在线观看| 一区二区三区**美女毛片| 欧美日韩精品福利| 奇米影视在线99精品| 在线视频中文字幕一区二区| 亚洲一区二区三区影院| 欧美一区中文字幕| 国产精品一区二区三区四区| 国产精品激情偷乱一区二区∴| 色久优优欧美色久优优| 日韩电影在线观看电影| 久久新电视剧免费观看| 成人久久18免费网站麻豆| 亚洲精品视频一区| 日韩亚洲欧美成人一区| 国产xxx精品视频大全| www国产成人| 9i在线看片成人免费| 一区二区国产视频| 日韩免费性生活视频播放| 国产成人午夜精品5599| 一区二区在线观看免费视频播放| 欧美日韩在线免费视频| 精品亚洲成a人| 日韩理论片网站| 99综合电影在线视频| 亚洲国产一区二区三区| 久久综合五月天婷婷伊人| voyeur盗摄精品| 日韩成人免费电影| 日本一区二区三区四区| 欧美日本在线一区| 国产精品白丝av| 亚洲不卡一区二区三区| 国产日产亚洲精品系列| 色婷婷国产精品| 国产精品主播直播| 无吗不卡中文字幕| 国产精品第四页| 日韩一区二区三区高清免费看看| 99这里只有久久精品视频| 免费成人你懂的| 一区二区三区中文免费| 日韩欧美国产综合一区| 日韩电影在线观看电影| 国产精品久久久久久久久图文区| 欧美日韩aaaaaa| 不卡av在线免费观看| 奇米色一区二区| 亚洲综合一区二区三区| 久久久久久免费| 欧美精品在线观看一区二区| 99re视频精品| 国产乱码精品一区二区三区av | 国产午夜三级一区二区三| 欧美日韩一区二区在线观看视频 | 久久久久久久久免费| 欧美色精品在线视频| 99国产精品国产精品久久| 国产一区二区不卡老阿姨| 日本女人一区二区三区| 亚洲国产精品影院| 亚洲精品视频自拍| 国产精品久久久久aaaa樱花| 精品国产3级a| 日韩欧美国产精品一区| 欧美图片一区二区三区| 色先锋aa成人| 99视频国产精品| 国产91在线观看| 国产精品亚洲午夜一区二区三区| 日韩极品在线观看| 亚洲高清视频中文字幕| 亚洲在线中文字幕| 亚洲欧美国产三级| 中文字幕国产一区| 国产精品美女一区二区在线观看| www久久精品| 久久这里只精品最新地址| 欧美不卡一区二区三区四区| 91精品国产欧美日韩| 日韩一区二区中文字幕| 欧美三级在线播放| 欧美性生活大片视频|