This essay developed out of conversations I've had with several other programmers about why Java smelled suspicious. It's not a critique of Java!
Sycorax - complete tutorials
Programming Tutorials
" Java provides the industry - software companies and customer alike , an opportunity to create a true open computing environment where software is portable,
and customers benefit from increase competition. "
Java and the Future
December 1, 2008-LEJB 3.1: EJB New and Improved!
The EJB 3.0 specification was a huge improvement from what you were used to in the early versions of EJB. Available as an early draft, EJB 3.1 has many more features and is even easier to use.
December 1, 2008-Should Java Assert that Network I/O Can't Occur on the UI Thread?
Doing network I/O on the user interface (UI) thread is bad. Most developers know that and can tell you why; unfortunately, it's still done.
Register now to recieve special alert and latest technology news!
JSP Syntax Elements
There are three types of JSP elements you can use: directive, action, and scripting.
Directive elementsThe directive elements specify information about the page itself that remains the same between requests--for example, if session tracking is required or not, buffering requirements, and the name of a page that should be used to report errors, if any. Details About Directive .
Action elements -
Action elements typically perform some action based on information that is required at the exact time the JSP page is requested by a browser. An action can, for instance, access parameters sent with the request to do a database lookup. It can also dynamically generate HTML, such as a table filled with information retrieved from an external system.
The JSP specification defines a few standard action elements, listed in Table 3-2.
Table 3-2: Standard action elements
Action element
Description
1)<jsp:useBean>
Makes a JavaBeans component available in a page. <jsp:useBean id="name" class="package.class" /> This usually means "instantiate an object of the class specified by class, and bind it to a variable with the name specified by id." However, as we'll see shortly, you can specify a scope attribute that makes the bean associated with more than just the current page.
id="name"
scope="page|request|session|application"
class="package.class"
type="package.class"
beanName="package.class"
2)<jsp:getProperty>
Gets a property value from a JavaBeans component and adds it to the response. Retrieve and output bean properties. <jsp:getProperty name="itemBean" property="numItems" />
Legal attributes are
name="beanName"
property="propertyName|*"
param="parameterName"
value="val"
3)<jsp:setProperty>
Sets a JavaBeans component property value. Set bean properties, either explicitly or by designating that value comes from a request parameter. <jsp:setProperty name="primeTable" property="numDigits" />
3)<jsp:include>
Includes the response from a servlet or JSP page during the request processing phase. A file on the local system to be included when the JSP page is translated into a servlet.
<jsp:forward>
Forwards the processing of a request to servlet or JSP page
<jsp:forward page="/utils/errorReporter.jsp" />
<jsp:param>
Adds a parameter value to a request handed off to another servlet or JSP page using <jsp:include> or <jsp:forward>
<jsp:plugin>
Generates HTML that contains the appropriate browser-dependent elements (OBJECT or EMBED) needed to execute an applet with the Java Plug-in software
Scripting elements, shown in Table 3-3, allow you to add small pieces of code (typically Java code) in a JSP page, such as an if statement to generate different HTML depending on a certain condition. Like actions, they are also executed when the page is requested. You should use scripting elements with extreme care: if you embed too much code in your JSP pages, you will end up with the same kind of maintenance problems as with servlets embedding HTML.
Table 3-3: Scripting elements
Element
Description
<% ... %>
Scriptlet, used to embed scripting code. Code is inserted in service method.
<%= ... %>
Expression, used to embed scripting code expressions when the result shall be added to the response. Also used as request-time action attribute values. Expression is evaluated and placed in output. The Java expression is evaluated, converted to a string, and inserted in the page. This evaluation is performed at run-time (when the page is requested)
<%! ... %>
Declaration, used to declare instance variables and methods in the JSP page implementation class. Code is inserted in body of servlet class, outside of service method.
<%-- comment --%>
Comment; ignored when JSP page is translated into servlet.
JavaBeans components
JSP elements, such as action and scripting elements, are often used to work with JavaBeans. Put succinctly, a JavaBeans component is a Java class that complies with certain coding conventions. JavaBeans components are typically used as containers for information that describes application entities, such as a customer or an order.
<< UNDERSTANDING JSP PAGE DIRECTIVE ATTRIBUTES || UNDERSTANDING THE TRANSLATION PROCESS >>

