First Department, has profound optimization of a small but as an example of the specification also pretty interesting. Servlet 2.4 specification to respond in these types of cases should be effective, including: in response setContentLength method content has been clearly stated, and the content has been written into the response. This is only your code like this can make to respond to re-orientation:
鈼?response.setHeader ("Host", "localhost");
鈼?response.setHeader ("Pragma", "no-cache");
鈼?response.setHeader ("Content-Length", "0");
鈼?response.setHeader ("Location", http://www.apache.org ");
Servlet technology ignore the title of the first specific area, because the content to meet the 0 byte length of the response will be effective immediately. But before it, had to respond to failure of the! Servlet containers are usually refused to implement such behavior, and Servlet 2.5 version added "length must be greater than 0" principle.
Code examples:
Servlet 2.4 specification to be called request.getReader () method called before request.setCharacterEncoding () method. But if you ignore this principle in its wake to the call request.setCharacterEncoding () method, then what would be the consequences, this specification does not say where. The sake of simplicity, to eliminate this situation now!
Cross-context sessions (between sessions in different contexts directory):
Recently, a session on Cross-context rules have been clearly addressed. When Servlets assigned from one context to another context of the request, this rule played a role?? Call in the objective process, including what the session. This version makes the emergence of a context where the portlets directory's home page can be several commands within the context of the other directories in the portlets work.
Servlet 2.5 version it clear that the resources of a context directory can access other contexts directory session (session), regardless of where the request started. This means that portlets can scope out the home page to run in their own areas, and this standard will be applied to incompatible Serlvet container. Look:
Since Servlet 2.5 version to keep some of the old nature, the concept had several major postponed to the next stage. They include:
鈼?new input / output (NIO) support: to make access more conducive to Servlets for NIO client communications.
鈼?filter wrap-under, or wrap-over semantics: sometimes filters packing requests, and / or response object to modify the act or method of opening of the new method. When to this package and the server requests and responses on the package when combined together, how they should be packaged together?
鈼?Servlets for popular documents: the index should serve as welcome as a function of the file? Prior to this, the answer is yes. But the specification did not specify how to use this function, especially in the absence of the index case.
鈼?for popular file distribution rules: how to distribute welcome file, it does not fully explain the details, but left some open gaps to deal with incompatibilities.
鈼?Select the default page after login: If users access their bookmarks Servlet landing page, then after a successful landing page should be turned to where? This problem has not been made clear.
鈼?user's theme log: the right to register through the website after the landing not through traditional means there is no way to trust the user to Servlet.
相关链接:
Used To Create Automatic Play Music Listening Pros CDPremier XML Or CSS ToolsE-cology In The Pan Micro Series 46Compare Active XSTORAGE Pager ToolsUsing a password reset Disk recover lost XP passwordsUC: a master of a MSFree mp3 to m4a converterUseful time of THE classFIVE-STROKE input method is not just polePs3 formatRFID Into The Competition For The Critical PeriodOSPF Posts: Frame Relay OSPF-radio HOSTMr. Chen Did Not Rule Out Approaching Completion Of The Annexation The Board Sina SinaAudio Video Tools evaluationFree mov to wmv converterogm on PS3