Advance Java Interview Questions | Eklavya Online

Advance Java Interview Questions

Why to use Servlet

To develop a web application we need to handle multiple request and give the particular page, Servlet can handle multiple requests concurrently, and can synchronize requests

Difference between ServletContext and ServletConfig

ServletConfig:  One ServletConfig Object is created per servlet It can be used to access ServletContext Parameters are configured in DD(deployment description) ServletContext One ServletContext will be created per web application. Can be used to access web app parameter. Can be used to get server Info.  

How to improve Servlet Performance

Cache static data using jspInit() method. Release static data in jspDestroy() method. To concatenate string use, StringBuffer. Do not use println() method. Do not use PrintWriter to send binary data. Use ServletOutputStream. Always flush data in sections. Use getLastModified() method to handle browser and server cache. Use application server cache. Use session in following order: …

How to improve Servlet Performance Read More »

What are the pros and cons of server side versus client side templating

Server Side Templating Pros: More search engine friendly. Entire response message can be cached. Can work without JavaScript Cons: Harder to mix and match different server side technologies. For example, retrieve data from both Java and Ruby based services Harder to send content for multiple devices. E.g. browser, mobile devices, etc. Client Side Templating Pros: …

What are the pros and cons of server side versus client side templating Read More »

Why are JSP pages the preferred API for creating a web-based client program

Because no plug-ins or security policy files are needed on the client systems(applet does). Also, JSP pages enable cleaner and more module application design because they provide a way to separate applications programming from web page design. This means personnel involved in web page design do not need to understand Java programming language syntax to …

Why are JSP pages the preferred API for creating a web-based client program Read More »