This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

question from Head First JSP Servlets

 
Hk mingham
Greenhorn
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
in this book ,on page 131,it said "Q: Why do you have to set the content type? Can’t servers figure it out from the extension of the file? A:But we’re talking about what happens inside a servlet where there IS no file! You’re the one who is sending back the response; the Container has no idea what you’re sending."

how strange,he said "the Container has no idea what you’re sending",but,now ,we are building the whole web app,we can handle everything,the container can know the type after we built it,we aren't client,we are developer,why it said the container don't know?
 
Joshi Nirav
Greenhorn
Posts: 14
IntelliJ IDE Spring Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I think in the book the statement was written in the context of the response and response type that would suppose to be written on the output stream an we need to tell the server that " Hey here my content and its type sending to wards our client who will request to our page ." because ultimately developer who will developing that page need to informe to server about the content.content type.

He said that container wont' know because after the execution/interpretation of the page code container will get the content/content type.


Thanks and Regards
Nirav Joshi
 
Hk mingham
Greenhorn
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Joshi Nirav wrote:Hi,
I think in the book the statement was written in the context of the response and response type that would suppose to be written on the output stream an we need to tell the server that " Hey here my content and its type sending to wards our client who will request to our page ." because ultimately developer who will developing that page need to informe to server about the content.content type.

He said that container wont' know because after the execution/interpretation of the page code container will get the content/content type.


Thanks and Regards
Nirav Joshi




Nirav Joshi ,totally thanks for your answer,this is the first time i ask question in javaranch,i glad that i can get the answer in such short time and such great answer.all i should say is thanks Nirav Joshi.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic