Sagarika Ghatge


Sagarika Ghatge

Sagarika Ghatge (8 January 1982 - ) is an Indian actress.She was born in Kolhapur, Maharashtra, and went to Chatrapati Shahu Vidyalaya in Kolhapur until 8th grade. She completed her 10th and 12th grades at Mayo College Girls School, Ajmer, Rajasthan and her graduation from HR college, Mumbai.

Sagarika has completed Kishore Namit Kapoor's acting training course. She used to play hockey in her college time. She got many offers to act in ad films while she was studying in college but her father strictly refused her to undertake them, till she completed her graduation. She portrayed the role of Preeti Sabharwal, a member of the Indian women's national hockey team, in the 2007 hit film, Chak De India. As a result of her role in Chak De India, Sagarika Ghatge has become a representative for Reebok.

Click here to View more...

Just 4 U







Click here to View more...

request.getParameter() and request.getAttribute()

Ok, getParameter() first:

Code:

<html>

<body>
<form name="testForm" method="post" action="testJSP.jsp">
<input type="text" name="testParam" value="Hello Amit">

<input type="submit">
</form>
</body>

</html>

-------------------------------------------------------------------------------------
Ok so when you click the submit button on this HTML page the form will be posted to testJSP.jsp

<!-- Code for testJSP.jsp -->
<%
String sValue = request.getParameter("testParam");
%>
<html>

<body>
<%= sValue %>
</body>

</html>

------------------------------------------------------------------------------------------

request.getParameter("testParam") will get the value from the posted form (named testForm) of the input box named testParam which is "Hello Vaibhav". It will then print it out, so you should see "Hello Vaibhav" on the screen. So request.getParameter() will retrieve a value that the client has submitted. You will get the value on the server side.

----------------------------------------------------------------------------------------------
Now for request.getAttribute(), this is all done server side. YOU add the attribute to the request and YOU submit the request to another resource, the client does not know about this. So all the code handling this would typically be in servlets.


// Your servlet code

public class SomeServlet extends HttpServlet {
protected void doGet(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
processRequest(request, response);
}


protected void doPost(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
processRequest(request, response);
}

protected void processRequest(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {

RequestDispatcher rd = request
.getRequestDispatcher("http://www.website.com/yourResource");

Object object = new Object();

request.setAttribute("ObjectName", object);
rd.forward(request, response);
}

Now when you call rd.forward() the request will be forwarded to the resource specified ie: in this case "http://www.website.com/yourResource"

Now in this case yourResource is a Servlet, here is the code

public class YourResourceServlet extends HttpServlet {
protected void doGet(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {

processRequest(request, response);
}


protected void doPost(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {

processRequest(request, response);
}


protected void processRequest(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {

// Retrieve the object stored in the request.

Object myDispatchedObject =
request.getAttribute("ObjectName");

}
}
}

main


Click here to View more...

Best Site for Servlet

Click Here to Open the site Click here to View more...

Inter-Servlet Communication (API v2.1 above)

This section shows how to

  • call another Servlet (or any other kind of active resource) to process a request

A Servlet can make a request to an active resource on the web server just like a client can (by requesting a URL). The Servlet API supports a more direct way of accessing server resources from within a Servlet which is running in the server than opening a socket connection back to the server. A Servlet can either hand off a request to a different resource or include the response which is created by that resource in its own response. It is also possible to supply user-defined data when calling an active resource which provides for an elegant way of doing inter-Servlet communication.



Example.

We're building an online shop with an ItemServlet which takes an argument item=number and returns a paragraph of HTML text with a description of the item which is retrieved from a database.

A second Servlet, the PresentationServlet, takes the same argument and creates a complete HTML page which includes the output of the ItemServlet. If the item argument is missing, the request is delegated to an ErrorServlet which returns a formatted error message.

public class PresentationServlet extends HttpServlet
{
private static class ItemNotFoundException extends Exception
{
ItemNotFoundException() { super("Item not found"); }
}

protected void doGet(HttpServletRequest req,
HttpServletResponse res)
throws ServletException, IOException
{
String item = req.getParameter("item");
if(item == null)
{
req.setAttibute("exception", new ItemNotFoundException());
getServletContext()
.getRequestDispatcher("/servlet/ErrorServlet")
.forward(req, res);
}
else
{
res.setContentType("text/html");
PrintWriter out = res.getWriter();
out.print("<HTML><HEAD><TITLE>Item " + item + "</TITLE>"+
"</HEAD><BODY>Item " + item + ":<P>");
getServletContext()
.getRequestDispatcher("/servlet/ItemServlet?item="+item)
.include(req, res);
out.print("</BODY></HTML>");
}
}
}


In the doGet method we first check for the existence of the item argument. If it is present (second branch of the if statement) the Servlet is responding with an HTML document in the usual way. In the middle of the document the response body of the ItemServlet is included by asking the ItemServlet's RequestDispatcher (whis is obtained through the ServletContext) to perform that operation.

If no item attribute was specified, the request is delegated to the ErrorServlet in a similar way. Note that this time we are using the RequestDispatcher's forward method (instead of include). This method can be called only once and only if neither getOutputStream nor getWriter has been called, but it allows the included Servlet to set headers and the response code (which is required to create a proper HTTP error response message).

The ItemServlet gets its item argument from the query string. That way it can also be accessed directly via an HTTP request, but argument values have to be represented as url-encoded strings (which is no problem in this case). The ErrorServlet takes an exception argument of type java.lang.Exception which is provided as a request attribute. The ErrorServlet uses the ServletRequest method getAttribute to read the attribute.

Note that a server which supports load balancing could run the Servlets on different JVMs. All custom request attributes should be serializable to allow them to be moved from one JVM to another.

3.3 Accessing Passive Server Resources [API 2.1]

This section shows how to

  • access a resource in the server's document tree

Passive server resources (e.g. static HTML pages which are stored in local files) are not accessed with RequestDispatcher objects. The ServletContext method getResource(String path) returns a URL object for a resource specified by a local URI (e.g. "/" for the server's document root) which can be used to examine the resource.

If you only want to read the resource's body you can directly ask the ServletContext for an InputStream with the getResourceAsStream(String path) method.

In Servlets which have to use version 1.0 or 2.0 of the Servlet API you can use the ServletContext method getRealPath(String path) to find a path in the local file system to a resource. This method is less general than the one described above because it doesn't allow you to access resources which are not stored in local files.

Accessing Servlet Resources

This section shows how to

  • access resources which belong to a Servlet

A Servlet may need to access additional resources like configuration files whose locations should not need to be specified in init parameters. Those resources can be accessed with the methods getResource(String name) and getResourceAsStream(String name) of the java.lang.Class object which represents the Servlet's class.

Example. The following code gets an InputStream for a configuration file named myservlet.cfg which resides in the same directory as the class in which the code is executed:

InputStream confIn =
getClass().getResourceAsStream("myservlet.cfg");

Note that the Servlet engine's Servlet class loader must implement the getResource and getResourceAsStream methods in order for this to work. This may not be the case with all Servlet engines.

Sharing Data Between Servlets [API 2.1]

This section shows how to

  • share data between Servlets

Version 2.1 of the Servlet API offers a new way of sharing named objects between all the Servlets in a Servlet context (and also other contexts, as you'll see below) by binding the objects to the ServletContext object which is shared by several Servlets.

The ServletContext class has several methods for accessing the shared objects:

  • public void setAttribute(String name, Object object) adds a new object or replaces an old object by the specified name. The attribute name should follow the same naming convention as a package name (e.g. a Servlet com.foo.fooservlet.FooServlet could have an attribute com.foo.fooservlet.bar).

    Just like a custom ServletRequest attribute, an object which is stored as a ServletContext attribute should also be serializable to allow attributes to be shared by Servlets which are running in different JVMs on different machines in a load-balancing server environment.

  • public Object getAttribute(String name) returns the named object or null if the attribute does not exist.

    In addition to the user-defined attributes there may also be predefined attributes which are specific to the Servlet engine and provide additional information about a Servlet(Context)'s environment.

  • public Enumeration getAttributeNames() returns an Enumeration of the names of all available attributes.

  • public void removeAttribute(String name) removes the attribute with the specified name if it exists.

The separation of Servlets into Servlet contexts depends on the Servlet engine. The ServletContext object of a Servlet with a known local URI can be retrieved with the method public ServletContext getContext(String uripath) of the Servlet's own ServletContext. This method returns null if there is no Servlet for the specified path or if this Servlet is not allowed to get the ServletContext for the specified path due to security restrictions.


Click here to View more...

Inter-Servlet Communication (v1.0 and 2.0 only)

This section shows how to

  • call a method of another Servlet

The inter-Servlet communication method which is described in this section can only be used with Servlet engines which implement version 1.0 or 2.0 of the Servlet API. It will not work with Servlet engines which comply strictly to version 2.1. The new way of doing inter-Servlet communication which was introduced in the 2.1 API is not done by the following method


Servlets are not alone in a Web Server. They have access to other Servlets in the same Servlet Context (usually a Servlet directory), represented by an instance of javax.servlet.ServletContext. The ServletContext is available through the ServletConfig object's getServletContext method.

A Servlet can get a list of all other Servlets in the Servlet Context by calling getServletNames on the ServletContext object. A Servlet for a known name (probably obtained through getServletNames) is returned by getServlet. Note that this method can throw a ServletException because it may need to load and initialize the requested Servlet if this was not already done.

After obtaining the reference to another Servlet that Servlet's methods can be called. Methods which are not declared in javax.servlet.Servlet but in a subclass thereof can be called by casting the returned object to the required class type.

Note that in Java the identity of a class is not only defined by the class name but also by the ClassLoader by which it was loaded. Web servers usually load each Servlet with a different class loader. This is necessary to reload Servlets on the fly because single classes cannot be replaced in the running JVM. Only a ClassLoader object with all loaded classes can be replaced.

This means that classes which are loaded by a Servlet class loader cannot be used for inter-Servlet communication. A class literal FooServlet (as used in a type cast like "FooServlet foo = (FooServlet)context.getServlet("FooServlet")") which is used in class BarServlet is different from the class literal FooServlet as used in FooServlet itself.

A way to overcome this problem is using a superclass or an interface which is loaded by the system loader and thus shared by all Servlets. In a Web Server which is written in Java those classes are usually located in the class path (as defined by the CLASSPATH environment variable).

Example. Servlet FooServlet wants to call the method public void bar() of Servlet BarServlet. Both Servlets should be reloadable so the Servlet classes cannot be loaded by the system loader. Instead we define an interface BarInterface which defines the callable method and is loaded by the system loader. BarServlet implements this interface. The Servlets are placed into the Servlet directory and the interface into a directory in the class path.

 1:  public class FooServlet extends HttpServlet
2: {
3: protected void doGet(HttpServletRequest req,
4: HttpServletResponse res)
5: throws ServletException, IOException
6: {
7: ...
8: ServletContext context = getServletConfig().getServletContext();
9: BarInterface bar = (BarInterface)context.getServlet("BarServlet");
10: bar.bar();
11: ..
12: }
13:
14: ...
15: }

 1:  public interface BarInterface
2: {
3: public void bar();
4: }

 1:  public class BarServlet extends HttpServlet implements BarInterface
2: {
3: public void bar()
4: {
5: System.err.println(""bar() called"");
6: }
7:
8: ...
9: }



Click here to View more...

CCD vs. CMOS Sensors - Cameras

The technologies and the markets that use them continue to mature, but the comparison is still a lot like apples vs. oranges: they can both be good for you. DALSA offers both.

CCD (charge coupled device) and CMOS (complementary metal oxide semiconductor) image sensors are two different technologies for capturing images digitally. Each has unique strengths and weaknesses giving advantages in different applications. Neither is categorically superior to the other, although vendors selling only one technology have usually claimed otherwise. In the last five years much has changed with both technologies, and many projections regarding the demise or ascendence of either have been proved false. The current situation and outlook for both technologies is vibrant, but a new framework exists for considering the relative strengths and opportunities of CCD and CMOS imagers.

Both types of imagers convert light into electric charge and process it into electronic signals. In a CCD sensor, every pixel's charge is transferred through a very limited number of output nodes (often just one) to be converted to voltage, buffered, and sent off-chip as an analog signal. All of the pixel can be devoted to light capture, and the output's uniformity (a key factor in image quality) is high. In a CMOS sensor, each pixel has its own charge-to-voltage conversion, and the sensor often also includes amplifiers, noise-correction, and digitization circuits, so that the chip outputs digital bits. These other functions increase the design complexity and reduce the area available for light capture. With each pixel doing its own conversion, uniformity is lower. But the chip can be built to require less off-chip circuitry for basic operation. For more details on device architecture and operation, see our original "CCD vs. CMOS: Facts and Fiction" article and its 2005 update, "CMOS vs. CCD: Maturing Technologies, Maturing Markets."

CCDs and CMOS imagers were both invented in the late 1960s and 1970s (DALSA founder and CEO Dr. Savvas Chamberlain was a pioneer in developing both technologies). CCD became dominant, primarily because they gave far superior images with the fabrication technology available. CMOS image sensors required more uniformity and smaller features than silicon wafer foundries could deliver at the time. Not until the 1990s did lithography develop to the point that designers could begin making a case for CMOS imagers again. Renewed interest in CMOS was based on expectations of lowered power consumption, camera-on-a-chip integration, and lowered fabrication costs from the reuse of mainstream logic and memory device fabrication. While all of these benefits are possible in theory, achieving them in practice while simultaneously delivering high image quality has taken far more time, money, and process adaptation than original projections suggested (see "CMOS Development's Winding Path" below).




Both CCDs and CMOS imagers can offer excellent imaging performance when designed properly. CCDs have traditionally provided the performance benchmarks in the photographic, scientific, and industrial applications that demand the highest image quality (as measured in quantum efficiency and noise) at the expense of system size. CMOS imagers offer more integration (more functions on the chip), lower power dissipation (at the chip level), and the possibility of smaller system size, but they have often required tradeoffs between image quality and device cost. Today there is no clear line dividing the types of applications each can serve. CMOS designers have devoted intense effort to achieving high image quality, while CCD designers have lowered their power requirements and pixel sizes. As a result, you can find CCDs in low-cost low-power cellphone cameras and CMOS sensors in high-performance professional and industrial cameras, directly contradicting the early stereotypes. It is worth noting that the producers succeeding with "crossovers" have almost always been established players with years of deep experience in both technologies.

Costs are similar at the chip level. Early CMOS proponents claimed CMOS imagers would be much cheaper because they could be produced on the same high-volume wafer processing lines as mainstream logic or memory chips. This has not been the case. The accommodations required for good imaging perfomance have required CMOS designers to iteratively develop specialized, optimized, lower-volume mixed-signal fabrication processes--very much like those used for CCDs. Proving out these processes at successively smaller lithography nodes (0.35um, 0.25um, 0.18um...) has been slow and expensive; those with a captive foundry have an advantage because they can better maintain the attention of the process engineers.

CMOS cameras may require fewer components and less power, but they still generally require companion chips to optimize image quality, increasing cost and reducing the advantage they gain from lower power consumption. CCD devices are less complex than CMOS, so they cost less to design. CCD fabrication processes also tend to be more mature and optimized; in general, it will cost less (in both design and fabrication) to yield a CCD than a CMOS imager for a specific high-performance application. However, wafer size can be a dominating influence on device cost; the larger the wafer, the more devices it can yield, and the lower the cost per device. 200mm is fairly common for third-party CMOS foundries while third-party CCD foundries tend to offer 150mm. Captive foundries use 150mm, 200mm, and 300mm production for both CCD and CMOS.

The larger issue around pricing is sustainability. Since many CMOS start-ups pursued high-volume, commodity applications from a small base of business, they priced below costs to win business. For some, the risk paid off and their volumes provided enough margin for viability. But others had to raise their prices, while still others went out of business entirely. High-risk startups can be interesting to venture capitalists, but imager customers require long-term stability and support.

While cost advantages have been difficult to realize and on-chip integration has been slow to arrive, speed is one area where CMOS imagers can demonstrate considerable strength because of the relative ease of parallel output structures. This gives them great potential in industrial applications.

CCDs and CMOS will remain complementary. The choice continues to depend on the application and the vendor more than the technology. DALSA's approach is "technology-neutral": we are one of the few vendors able to offer real solutions with both CCDs and CMOS.

Feature and Performance Comparison

Feature CCD CMOS
Signal out of pixel Electron packet Voltage
Signal out of chip Voltage (analog) Bits (digital)
Signal out of camera Bits (digital) Bits (digital)
Fill factor High Moderate
Amplifier mismatch N/A Moderate
System Noise Low Moderate
System Complexity High Low
Sensor Complexity Low High
Camera components Sensor + multiple support chips + lens Sensor + lens possible, but additional support chips common
Relative R&D cost Lower Higher
Relative system cost Depends on Application Depends on Application
Performance CCD CMOS
Responsivity Moderate Slightly better
Dynamic Range High Moderate
Uniformity High Low to Moderate
Uniform Shuttering Fast, common Poor
Uniformity High Low to Moderate
Speed Moderate to High Higher
Windowing Limited Extensive
Antiblooming High to none High
Biasing and Clocking Multiple, higher voltage Single, low-voltage



CMOS Development's Winding Path

Initial Prediction for CMOS Twist Outcome
Equivalence to CCD in imaging performance Required much greater process adaptation and deeper submicron lithography than initially thought High performance available in CMOS, but with higher development cost than CCD
On-chip circuit integration Longer development cycles, increased cost, tradeoffs with noise, flexibility during operation Greater integration in CMOS, but companion chips still required for both CMOS and CCD
Reduced power consumption Steady improvement in CCDs Advantage for CMOS, but margin diminished
Reduced imaging subsystem size Optics, companion chips and packaging are often the dominant factors in imaging subsystem size CCDs and CMOS comparable
Economies of scale from using mainstream logic and memory foundries Extensive process development and optimization required CMOS imagers use legacy production lines with highly adapted processes akin to CCD fabrication



Click here to View more...

Jana gana mana - Just 4 U

Lets join hands and pay a tribute to our country with legendary artists - Lata Mangeshkar, Asha Bhosle, S Pandit Bhimsen Joshi, Pandit Jasraj, Hariharan, bhupen Hazarika, Jagjit Singh, Kavita Krishnamurthy, S.P.Balasubramaniam, A.R.Rehman and many more crooning the National Anthem in celebration of India’s 60th year of Independence.

Here’s a treat for your eyes as well as the ears! A Must Watch Video!


You can enjoy all the songs from this great new album ‘Jana Gana Mana’ by A. R. Rehman here:
Jana Gana Mana - Voices Of India

A R Rahman has brought together several maestros of the music industry to lend their voices to his latest album, Jana Gana Mana, his composition of India’s National Anthem. The album contains 35 different renditions of the original composition and features several stalwarts of Indian classical and popular music:

Pandit Bhimsen Joshi, Pandit Hari Prasad Chaurasia, Pandit Vishwa Mohan Bhatt, Lata Mangeshkar and S.P Balasubramanium are among the maestros to have performed for the album.

Cheers,

@miT...




Click here to View more...

Happy Independence Day to all

https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhuWSh5_l-oQnLhhfp1KwVmuRZTXP7f3vU7Gf12CBSGYcmbJn5AwsJOUZFkRIJ679riUkyRBNp7UjVg-pCcO81JZV54P398RbofWIt4NbS3Ms0ixsQrHsV3_EDcAgaVM6tqCAKKIljHZvA/s400/happy-independence-day-2008.jpg

Click here to View more...

Beautiful Indian paintings

indian paintings

indian paintings




indian paintings

indian paintings



indian paintings

indian paintings

indian paintings

indian paintings

indian paintings

indian paintings

indian paintings

indian paintings

indian paintings

indian paintings

indian paintings

indian paintings

indian paintings

indian paintings

indian paintings

indian paintings

indian paintings

indian paintings

indian paintings

indian paintings

indian paintings

indian paintings

indian paintings

indian paintings

indian paintings

indian paintings

indian paintings

indian paintings

indian paintings

indian paintings

indian paintings

indian paintings

indian paintings

indian paintings

indian paintings

indian paintings

indian paintings

indian paintings

indian paintings

indian paintings

indian paintings

indian paintings

indian paintings

indian paintings

indian paintings

indian paintings

indian paintings

indian paintings

indian paintings

indian paintings

indian paintings

indian paintings


Click here to View more...