A top software consulting is looking for Java developers. There are multiple open positions like Java Developers, Senior Java Developers, Technical Leads and Architects. Candidates who have strong knowledge in Java and in one or more of the following skills can apply:
Struts
Spring
Hibernate
Web services
JSP
EJB
Application servers like Weblogic or Websphere or JBoss.
Databases like Oracle or DB2.
Design tools like Rational Software Architect or Enterprise Architect.
Good knowledge in design patterns.
Version control systems like Clearcase or Subversion.
Company Information
The company is one of the top 4 software consulting companies in US with over 56,000 employees and offices in 87 cities. The company provides very good pay package and benefits. For those who are on H1, the company will transfer H1.
Note: I am an employee of the company and your profile will be submitted as an internal referral.
JavaServer Pages (JSP) technology provides a simplified, fast way to create web pages that display dynamically-generated content. The JSP specification, developed through an industry-wide initiative led by Sun Microsystems, defines the interaction between the server and the JSP page, and describes the format and syntax of the page.
A JSP page is a text document that contains two types of text: static data, which can be expressed in any text-based format (such as HTML,WML,XML,etc), and JSP elements, which construct dynamic content.JSP is a technology that lets you mix static content with dynamically-generated content.
JSP pages are compiled into servlets, so theoretically you could write servlets to support your web-based applications. However, JSP technology was designed to simplify the process of creating pages by separating web presentation from web content. In many applications, the response sent to the client is a combination of template data and dynamically-generated data. In this situation, it is much easier to work with JSP pages than to do everything with servlets.
The following sequence of events happens on arrival of jsp request: a. Browser requests a page with .jsp file extension in webserver. b. Webserver reads the request. c. Using jsp compiler,webserver converts the jsp into a servlet class that implement the javax.servletjsp.jsp page interface.the jsp file compiles only when the page is first requested or when the jsp file has been changed. d. The generated jsp page servlet class is invoked to handle the browser request. e. The response is sent to the client by the generated servlet.
The following are the advantages of using JSP: a. JSP pages easily combine static templates, including HTML or XML fragments, with code that generates dynamic content. b. JSP pages are compiled dynamically into servlets when requested, so page authors can easily make updates to presentation code. JSP pages can also be precompiled if desired. c. JSP tags for invoking JavaBeans components manage these components completely, shielding the page author from the complexity of application logic. d. Developers can offer customized JSP tag libraries that page authors access using an XML-like syntax. e. Web authors can change and edit the fixed template portions of pages without affecting the application logic. Similarly, developers can make logic changes at the component level without editing the individual pages that use the logic.
Pages built using JSP technology are typically implemented using a translation phase that is performed once, the first time the page is called. The page is compiled into a Java Servlet class and remains in server memory, so subsequent calls to the page have very fast response times.
Directives are instructions that are processed by the JSP engine when the page is compiled to a servlet. Directives are used to set page-level instructions, insert data from external files, and specify custom tag libraries. Directives are defined between < %@ and % >. < %@ page language=="java" imports=="java.util.*" % > < %@ include file=="banner.html" % >
The following are the different types of directives: a. include directive : used to include a file and merges the content of the file with the current page b. page directive : used to define page specific attributes like scripting language, error page, buffer, thread safety, etc c. taglib : used to declare a custom tag library which is used in the page.
JSP actions are executed when a JSP page is requested. Action are inserted in the jsp page using XML syntax to control the behavior of the servlet engine. Using action, we can dynamically insert a file, reuse bean components, forward the user to another page, or generate HTML for the Java plugin. Some of the available actions are as follows: <jsp:include> - include a file at the time the page is requested. <jsp:useBean> - find or instantiate a JavaBean. <jsp:setProperty> - set the property of a JavaBean. <jsp:getProperty> - insert the property of a JavaBean into the output. <jsp:forward> - forward the requester to a new page. <jsp:plugin> - generate browser-specific code that makes an OBJECT or EMBED tag for the Java plugin.
Scriptlets are blocks of programming language code (usually java) embedded within a JSP page. Scriptlet code is inserted into the servlet generated from the page. Scriptlet code is defined between <% and %>
Declarations are similar to variable declarations in Java.Variables are defined for subsequent use in expressions or scriptlets. Declarations are defined between <%! and %>. < %! int i=0; %>
Instance variables should be declared inside the declaration part. The variables declared with JSP declaration element will be shared by all requests to the jsp page. < %@ page language=="java" contentType="text/html"% > < %! int i=0; %>
Expressions are variables or constants that are inserted into the data returned by the web server. Expressions are defined between <% = and % > < %= scorer.getScore() %>
Implicit objects are those objects which are avaiable by default. These objects are instances of classesdefined by the JSP specification. These objects could be used within the jsp page without being declared. The following are the implicit jsp objects: 1. application 2. page 3. request 4. response 5. session 6. exception 7. out 8. config 9. pageContext
The JSP specification includes standard tags for bean use and manipulation. The <jsp:useBean> tag creates an instance of a specific JavaBean class. If the instance already exists, it is retrieved. Otherwise, a new instance of the bean is created. The <jsp:setProperty> and <jsp:getProperty> tags let you manipulate properties of a specific bean.
Both are used to insert files into a JSP page. <%@include:> is a directive which statically inserts the file at the time the JSP page is translated into a servlet. <jsp:include> is an action which dynamically inserts the file at the time the page is requested.
Both requestDispatcher.forward() and response.sendRedirect() is used to redirect to new url.
forward is an internal redirection of user request within the web container to a new URL without the knowledge of the user(browser). The request object and the http headers remain intact.
sendRedirect is normally an external redirection of user request outside the web container. sendRedirect sends response header back to the browser with the new URL. The browser send the request to the new URL with fresh http headers. sendRedirect is slower than forward because it involves extra server call.
Yes, the JSP specification does support creation of XML documents. For simple XML generation, the XML tags may be included as static template portions of the JSP page. Dynamic generation of XML tags occurs through bean components or custom tags that generate XML output.
JSP is a community driven specification whereas ASP is a similar proprietary technology from Microsoft. In JSP, the dynamic part is written in Java, not Visual Basic or other MS-specific language. JSP is portable to other operating systems and non-Microsoft Web servers whereas it is not possible with ASP
JavaScript can be used to generate dynamic content on the client browser. But it can handle only handles situations where the dynamic information is based on the client's environment. It will not able to harness server side information directly.
Set the appropriate HTTP header attributes to prevent the dynamic content output by the JSP page from being cached by the browser. Execute the following scriptlet at the beginning of JSP pages to prevent them from being caches at the browser.
<% response.setHeader(“Cache-Control",�no-store�); //HTTP 1.1 response.setHeader(“Pragma�,�no-cache�); //HTTP 1.0 response.setDateHeader (“Expires�, 0); //prevents caching at the proxy server %>