서블릿 3.0 이 비동기화 방식으로 ?? JSR315 번에 제안이 올라갔네요.

2007. 7. 31. 12:39Java

원문: http://ncanis.tistory.com

비동기 식이라. 죽이겠네요.
얼른 되었으문.

Async Servlet 3.0 Proposal for JSR 315

Posted by: Joseph Ottinger on 7? 23, 2007 DIGG

Greg Wilkins has submitted a proposal to address the asynchronous concerns of JSR315 for the Servlet 3.0 specification process.

The proposal is available here and this is an introductory blog about it. In the proposal, additional capabilities are required by the container (in handling more mime types by specification), and more methods are available in servlet request and response objects, to manage suspension and resumption of requests (as the use of continuations would imply.) The deployment descriptor for web applications would be altered to indicate how to convert types, and to indicate whether a given servlet was asynchronous or not.

While the proposal is heavily influenced by Jetty Continuations, it tries to avoid some of the more contentious issues of continuations. What do you think of the proposal?


아래는 JSR에서 제공하는 샘플입니다.
진즉에 이렇게 할 것이징.. ㅡ.ㅡ;

<%@ page contentType='text/html; charset=UTF-8' import='java.util.Map,java.io.File' %>
<%
Map content=(Map)request.getContent();
if (content==null)
{
%>
    <h2>UPLOAD content</h2>
    <form method='POST' enctype='multipart/form-data' accept-charset='utf-8' action=".">
      Description: <input type='text' name='TextField' value='comment'/><br/>
      File: <input type='file' name='file' /><br/>
      <input type='submit' name='Action' value='Submit'><br/>
    </form>
<%
}
else
{
    String description = (String)content.get("description");
    File file = (File)content.get("file");
    String path="/store/"+file.getName();
    file.renameTo(new File(request.getRealPath(path)));
%>
    <h2>UPLOADED content</h2>
    Description: <%= description%><br/>
    File: <a href="<%=path%>"><%=file.getName()%></a><br/> 
<%
}
%>

web.xml:

<request-converter>   
  <url-pattern>/upload.jsp</url-pattern>

  <mime-type>multipart/form-data</mime-type>
  <content-class>java.util.Map</content-class>
  <asynchronous/>
  <provided/>
</request-converter>