<filter>
  |             <filter-name>Seam Servlet Filter</filter-name>
  |             <filter-class>
  |                     org.jboss.seam.servlet.SeamServletFilter
  |             </filter-class>
  |     </filter>
  |     <filter-mapping>
  |             <filter-name>Seam Servlet Filter</filter-name>
  |             <url-pattern>*.serv</url-pattern>
  |     </filter-mapping>

<servlet>
  |             <servlet-name>testServlet</servlet-name>
  |             <servlet-class>
  |                     com.eastidea.menglishweb.action.TestServlet
  |             </servlet-class>
  |     </servlet>
  |     <servlet-mapping>
  |             <servlet-name>testServlet</servlet-name>
  |             <url-pattern>/testServlet.serv</url-pattern>
  |     </servlet-mapping>

public void doPost(HttpServletRequest request, HttpServletResponse response)
  |                     throws ServletException, IOException {
  | 
  |             response.setContentType("text/html");
  |             response.setCharacterEncoding("utf-8");
  | 
  |             ServletInputStream servletInputStream = 
request.getInputStream();               File file = new File("d:/out.txt");
  |             int readCount;
  |             byte[] readByte = new byte[1024];
  |             FileOutputStream fileOutputStream;
  |             try {
  |                     fileOutputStream = new FileOutputStream(file);
  |                     readCount = servletInputStream.readLine(readByte, 0,
  |                                     readByte.length);
  | 
  |                     while (readCount != -1) {
  |                             fileOutputStream.write(readByte, 0, readCount);
  |                             readCount = 
servletInputStream.readLine(readByte, 0, 1024);
  |                     }
  |                     fileOutputStream.flush();
  | 
  |             } catch (IOException e) {
  |                     // TODO Auto-generated catch block
  |                     e.printStackTrace();
  |             }}

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4099704#4099704

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4099704
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to