Question: I am new to java servlets. I studied some code about servlet but I really want to know more basic things and how it works. I just wonder what type of material/content can be sent from java servlet to a browser. Like http request or something? And how does brower know how to deal with this material? In addtion, for java bean. I know it is a java class. But, what is the purpose behind the development of the java bean concept.

Answer: 
**What type of material/content can be sent from java servlet to a browser?**  

A servlet can return any kind of data to the browser (or whatever else made the request). The data is wrapped in a `ServletResponse` object, usually a `HttpServletResponse`.

The response contains both the actual data and also meta data in the form of response headers, although we are now moving into the realm of HTTP, rather than servlets. You know how HTTP works, right? Yo 

**How does brower know how to deal with this material?**  

The response headers typically hint to the browser what type of data the response is, whether it is text, html, XML, etc. This is given by the response header called *Content-Type*. Again this is standard HTTP stuff, not really specific to servlets.

**What is the purpose behind the development of the java bean concept?**  

The java bean standard is a convention used for writing [POJO](http://en.wikipedia.org/wiki/Plain_Old_Java_Object)s. There are many tools that are specifically designed to work with classes written to the java bean standard. In relation to servlets and HTTP, the best example is probably [JSTL](http://en.wikipedia.org/wiki/JSTL), which allows you to access objects in a JSP so long as they follow the bean standard.
> 
> I really want to know more basic things and how it works. I just wonder what type of material/content can be sent from java servlet to a brower. Like http request or something? And how does brower know how to deal with this material? 
> 
> 
> 

Servlet sends HTTPResponse to the browser , and from the content-type header browser determines what type of data it is. is it a pdf, audio file ..

> 
> for java bean. I know it is a java class. But, what is the purpose behind the development of the java bean concep
> 
> 
> 

**See** [What is the point of JavaBean](https://stackoverflow.com/questions/4275897/whats-the-point-of-beans/4275933#4275933)