File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes HttpServlet jee 6 api doubt regarding doPost ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "HttpServlet jee 6 api doubt regarding doPost ?" Watch "HttpServlet jee 6 api doubt regarding doPost ?" New topic
Author

HttpServlet jee 6 api doubt regarding doPost ?

gurpeet singh
Ranch Hand

Joined: Apr 04, 2012
Posts: 924
    
    1

the jee 6 api for HttpServlet's doPost method given at http://docs.oracle.com/javaee/6/api/javax/servlet/http/HttpServlet.html says

When overriding this method, read the request data, write the response headers, get the response's writer or output stream object, and finally, write the response data. It's best to include content type and encoding. When using a PrintWriter object to return the response, set the content type before accessing the PrintWriter object.


shouldn't the bold part be set the response headers ? or does it mean something else in some context ?

regards


Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61451
    
  67

"set" would probably be a better word, but it means essentially the same thing.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
gurpeet singh
Ranch Hand

Joined: Apr 04, 2012
Posts: 924
    
    1

Thanks Bear
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: HttpServlet jee 6 api doubt regarding doPost ?