<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>NEW TRENDS IN WEB TECHNOLOGY by Casteyó &#187; JSP</title>
	<atom:link href="http://casteyo.wordpress.com/category/jsp/feed/" rel="self" type="application/rss+xml" />
	<link>http://casteyo.wordpress.com</link>
	<description>Tutorials &#38; articles about Web 2.0, CSS, J2EE, .NET.... --&#62; web applications</description>
	<lastBuildDate>Mon, 02 Jul 2007 14:49:02 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='casteyo.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/7f89f2095ed33582ae0de42291b71f4e?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>NEW TRENDS IN WEB TECHNOLOGY by Casteyó &#187; JSP</title>
		<link>http://casteyo.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://casteyo.wordpress.com/osd.xml" title="NEW TRENDS IN WEB TECHNOLOGY by Casteyó" />
		<item>
		<title>Advices for JSP &#8211; Java Server Pages</title>
		<link>http://casteyo.wordpress.com/2007/06/29/jsp-java-server-pages/</link>
		<comments>http://casteyo.wordpress.com/2007/06/29/jsp-java-server-pages/#comments</comments>
		<pubDate>Fri, 29 Jun 2007 17:43:14 +0000</pubDate>
		<dc:creator>casteyo</dc:creator>
				<category><![CDATA[JSP]]></category>

		<guid isPermaLink="false">http://casteyo.wordpress.com/2007/06/29/jsp-java-server-pages/</guid>
		<description><![CDATA[First of all, I should explain what is the JSP technology and how JSP pages work.The JSP technology is an open, freely available specification developed by Sun Microsystems as an alternative to Microsoft&#8217;s Active Server Pages (ASP) technology, and a key component of the Java 2 Enterprise Edition (J2EE) specification. Many of the commercially available [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=casteyo.wordpress.com&blog=1198899&post=34&subd=casteyo&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>First of all, I should explain what is the JSP technology and how JSP pages work.The JSP technology is an open, freely available specification developed by Sun Microsystems as an alternative to Microsoft&#8217;s Active Server Pages (ASP) technology, and a key component of the Java 2 Enterprise Edition (J2EE) specification. Many of the commercially available application servers support JSP technology.</p>
<p><img src="http://geneura.ugr.es/~jmerelo/JSP/modelo1.gif" height="277" width="491" /><br />
<span id="more-34"></span></p>
<p><strong>How Do JSP Pages Work?</strong></p>
<p>A JSP page is basically a web page with traditional HTML and bits of Java code. The file extension of a JSP page is .jsp rather than .html or .htm, which tells the server that this page requires special handling that will be accomplished by a server extension or a plug-in.</p>
<p>When a JSP page is called, it will be compiled (by the JSP engine) into a Java servlet. At this point the servlet is handled by the servlet engine, just like any other servlet. The servlet engine then loads the servlet class (using a class loader) and executes it to create dynamic HTML to be sent to the browser, as shown in next figure. The servlet creates any necessary object, and writes any object as a string to an output stream to the browser.</p>
<p><img src="http://java.sun.com/developer/technicalArticles/javaserverpages/servlets_jsp/fig1.gif" alt="request/response flow calling a jsp page" height="247" width="430" /></p>
<p>The next time the page is requested, the JSP engine executes the already-loaded servlet unless the JSP page has changed, in which case it is automatically recompiled into a servlet and executed.</p>
<p>In order to do good practices you should follow these advices:</p>
<ul>
<li>Don&#8217;t overuse Java code in HTML pages</li>
<li>Don&#8217;t mix business logic with presentation</li>
<li>Use custom tags</li>
<li>Do not reinvent the wheel</li>
<li>Use the JSTL Expression Language</li>
<li>Use filters if necessary</li>
<li>Use a portable security model</li>
<li>Use a database for persistent information</li>
<li>Cache content</li>
<li>Use connection pooling</li>
<li>Cache results of database queries</li>
<li>Adopt the new JSP XML syntax if necessary</li>
</ul>
<p><strong>Example:</strong></p>
<blockquote>
<pre>
&lt;%@ page language="java" contentType="text/html" %&gt;
&lt;html&gt;
 &lt;body&gt;
    &lt;jsp:useBean id="clock" class="java.util.Date" /&gt;
    The current time at the server is:
    &lt;ul&gt;
      &lt;li&gt;Date: &lt;jsp:getProperty name="clock" property="date" /&gt;
      &lt;li&gt;Month: &lt;jsp:getProperty name="clock" property="month" /&gt;
      &lt;li&gt;Year: &lt;jsp:getProperty name="clock" property="year" /&gt;
      &lt;li&gt;Hours: &lt;jsp:getProperty name="clock" property="hours" /&gt;
     &lt;li&gt;Minutes: &lt;jsp:getProperty name="clock" property="minutes" /&gt;
    &lt;/ul&gt;
  &lt;/body&gt;
&lt;/html&gt;</pre>
</blockquote>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/casteyo.wordpress.com/34/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/casteyo.wordpress.com/34/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/casteyo.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/casteyo.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/casteyo.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/casteyo.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/casteyo.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/casteyo.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/casteyo.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/casteyo.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/casteyo.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/casteyo.wordpress.com/34/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=casteyo.wordpress.com&blog=1198899&post=34&subd=casteyo&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://casteyo.wordpress.com/2007/06/29/jsp-java-server-pages/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/58a9aafbc905333734fe204644acebf0?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">casteyo</media:title>
		</media:content>

		<media:content url="http://geneura.ugr.es/~jmerelo/JSP/modelo1.gif" medium="image" />

		<media:content url="http://java.sun.com/developer/technicalArticles/javaserverpages/servlets_jsp/fig1.gif" medium="image">
			<media:title type="html">request/response flow calling a jsp page</media:title>
		</media:content>
	</item>
	</channel>
</rss>