aspose 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 Java 8 in Action this week in the Java 8 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: 923
    
    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



OCPJP 6(100 %) OCEWCD 6(91 %) OCPJBCD(93%)
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60071
    
  65

"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: 923
    
    1

Thanks Bear
 
jQuery in Action, 2nd edition
 
subject: HttpServlet jee 6 api doubt regarding doPost ?
 
Similar Threads
Passing around java object
Confused with flush() behavior
Getting link attachment
DELETE http request in HttpURLConnection....
Doubts on buffers, committing response (with RequestDespatcher, sendError)