<?xml version='1.0' encoding='UTF-8'?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:blogger="http://schemas.google.com/blogger/2008" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-7813956266500130511</atom:id><lastBuildDate>Wed, 09 Oct 2024 10:46:08 +0000</lastBuildDate><category>HTML</category><category>PHP</category><category>Server</category><category>CSS</category><category>java</category><category>mysql</category><category>xml</category><category>Apache</category><category>sql</category><category>xsl</category><category>xslt</category><category>Javascript</category><category>Virtual Host</category><category>classes</category><category>encoding</category><category>feeds</category><category>maven</category><category>seo</category><category>shells</category><category>JavaServer</category><category>Mootools</category><category>analysis</category><category>android</category><category>drupal</category><category>events</category><category>forms</category><category>jquery</category><category>oracle</category><category>photoshop</category><category>postgresql</category><category>regular expressions</category><category>sdk</category><category>servlets</category><category>tomcat</category><title>Littlebitz Long Time Memory</title><description>Software development Blog&#xa;Programming in focus.</description><link>http://littlebitzltm.blogspot.com/</link><managingEditor>noreply@blogger.com (David RR Bloggin)</managingEditor><generator>Blogger</generator><openSearch:totalResults>64</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7813956266500130511.post-3588765334313466494</guid><pubDate>Fri, 23 May 2014 15:47:00 +0000</pubDate><atom:updated>2014-05-23T17:47:39.603+02:00</atom:updated><title>Encode doctrine entities to json symfony 2</title><description>&lt;pre class=&quot;lang-php prettyprint prettyprinted&quot;&gt;&lt;code&gt;&lt;span class=&quot;kwd&quot;&gt;use&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Symfony&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;\Component\Serializer\Serializer&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;lang-php prettyprint prettyprinted&quot;&gt;&lt;code&gt;&lt;span class=&quot;pun&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;use&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Symfony&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;\Component\Serializer\Normalizer\GetSetMethodNormalizer&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;lang-php prettyprint prettyprinted&quot;&gt;&lt;code&gt;&lt;span class=&quot;pun&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;use&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Symfony&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;\Component\Serializer\Encoder\JsonEncoder&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;lang-php prettyprint prettyprinted&quot;&gt;&lt;code&gt;&lt;span class=&quot;pun&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

$serializer &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Serializer&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;GetSetMethodNormalizer&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()),&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; array&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;json&#39;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; 
&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;JsonEncoder&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()));&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;lang-php prettyprint prettyprinted&quot;&gt;&lt;code&gt;&lt;span class=&quot;pun&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
$json &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $serializer&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;serialize&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;$entity&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;json&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
</description><link>http://littlebitzltm.blogspot.com/2014/05/encode-doctrine-entities-to-json.html</link><author>noreply@blogger.com (littlebitz)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7813956266500130511.post-2230605195143481729</guid><pubDate>Sat, 25 Jan 2014 17:29:00 +0000</pubDate><atom:updated>2014-01-25T18:29:22.709+01:00</atom:updated><title>Media Queries para dispositivos standard</title><description>&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span class=&quot;token comment&quot; spellcheck=&quot;true&quot; style=&quot;box-sizing: border-box; color: #777777; font-family: Menlo, Monaco, monospace; font-size: 16px; line-height: 22.399999618530273px; white-space: pre;&quot;&gt;/* Smartphones (portrait and landscape) ----------- */&lt;/span&gt;&lt;span style=&quot;color: #cd6a51; font-family: Menlo, Monaco, monospace; font-size: 16px; line-height: 22.399999618530273px; white-space: pre;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;token selector&quot; style=&quot;box-sizing: border-box; color: #dfc48c; font-family: Menlo, Monaco, monospace; font-size: 16px; line-height: 22.399999618530273px; white-space: pre;&quot;&gt;@media only screen 
and (min-device-width : 320px) 
and (max-device-width : 480px) &lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: white; font-family: Menlo, Monaco, monospace; font-size: 16px; line-height: 22.399999618530273px; white-space: pre;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color: #cd6a51; font-family: Menlo, Monaco, monospace; font-size: 16px; line-height: 22.399999618530273px; white-space: pre;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;token comment&quot; spellcheck=&quot;true&quot; style=&quot;box-sizing: border-box; color: #777777; font-family: Menlo, Monaco, monospace; font-size: 16px; line-height: 22.399999618530273px; white-space: pre;&quot;&gt;/* Styles */&lt;/span&gt;&lt;span style=&quot;color: #cd6a51; font-family: Menlo, Monaco, monospace; font-size: 16px; line-height: 22.399999618530273px; white-space: pre;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: white; font-family: Menlo, Monaco, monospace; font-size: 16px; line-height: 22.399999618530273px; white-space: pre;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color: #cd6a51; font-family: Menlo, Monaco, monospace; font-size: 16px; line-height: 22.399999618530273px; white-space: pre;&quot;&gt;

&lt;/span&gt;&lt;span class=&quot;token comment&quot; spellcheck=&quot;true&quot; style=&quot;box-sizing: border-box; color: #777777; font-family: Menlo, Monaco, monospace; font-size: 16px; line-height: 22.399999618530273px; white-space: pre;&quot;&gt;/* Smartphones (landscape) ----------- */&lt;/span&gt;&lt;span style=&quot;color: #cd6a51; font-family: Menlo, Monaco, monospace; font-size: 16px; line-height: 22.399999618530273px; white-space: pre;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;token selector&quot; style=&quot;box-sizing: border-box; color: #dfc48c; font-family: Menlo, Monaco, monospace; font-size: 16px; line-height: 22.399999618530273px; white-space: pre;&quot;&gt;@media only screen 
and (min-width : 321px) &lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: white; font-family: Menlo, Monaco, monospace; font-size: 16px; line-height: 22.399999618530273px; white-space: pre;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color: #cd6a51; font-family: Menlo, Monaco, monospace; font-size: 16px; line-height: 22.399999618530273px; white-space: pre;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;token comment&quot; spellcheck=&quot;true&quot; style=&quot;box-sizing: border-box; color: #777777; font-family: Menlo, Monaco, monospace; font-size: 16px; line-height: 22.399999618530273px; white-space: pre;&quot;&gt;/* Styles */&lt;/span&gt;&lt;span style=&quot;color: #cd6a51; font-family: Menlo, Monaco, monospace; font-size: 16px; line-height: 22.399999618530273px; white-space: pre;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: white; font-family: Menlo, Monaco, monospace; font-size: 16px; line-height: 22.399999618530273px; white-space: pre;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color: #cd6a51; font-family: Menlo, Monaco, monospace; font-size: 16px; line-height: 22.399999618530273px; white-space: pre;&quot;&gt;

&lt;/span&gt;&lt;span class=&quot;token comment&quot; spellcheck=&quot;true&quot; style=&quot;box-sizing: border-box; color: #777777; font-family: Menlo, Monaco, monospace; font-size: 16px; line-height: 22.399999618530273px; white-space: pre;&quot;&gt;/* Smartphones (portrait) ----------- */&lt;/span&gt;&lt;span style=&quot;color: #cd6a51; font-family: Menlo, Monaco, monospace; font-size: 16px; line-height: 22.399999618530273px; white-space: pre;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;token selector&quot; style=&quot;box-sizing: border-box; color: #dfc48c; font-family: Menlo, Monaco, monospace; font-size: 16px; line-height: 22.399999618530273px; white-space: pre;&quot;&gt;@media only screen 
and (max-width : 320px) &lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: white; font-family: Menlo, Monaco, monospace; font-size: 16px; line-height: 22.399999618530273px; white-space: pre;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color: #cd6a51; font-family: Menlo, Monaco, monospace; font-size: 16px; line-height: 22.399999618530273px; white-space: pre;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;token comment&quot; spellcheck=&quot;true&quot; style=&quot;box-sizing: border-box; color: #777777; font-family: Menlo, Monaco, monospace; font-size: 16px; line-height: 22.399999618530273px; white-space: pre;&quot;&gt;/* Styles */&lt;/span&gt;&lt;span style=&quot;color: #cd6a51; font-family: Menlo, Monaco, monospace; font-size: 16px; line-height: 22.399999618530273px; white-space: pre;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: white; font-family: Menlo, Monaco, monospace; font-size: 16px; line-height: 22.399999618530273px; white-space: pre;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color: #cd6a51; font-family: Menlo, Monaco, monospace; font-size: 16px; line-height: 22.399999618530273px; white-space: pre;&quot;&gt;

&lt;/span&gt;&lt;span class=&quot;token comment&quot; spellcheck=&quot;true&quot; style=&quot;box-sizing: border-box; color: #777777; font-family: Menlo, Monaco, monospace; font-size: 16px; line-height: 22.399999618530273px; white-space: pre;&quot;&gt;/* iPads (portrait and landscape) ----------- */&lt;/span&gt;&lt;span style=&quot;color: #cd6a51; font-family: Menlo, Monaco, monospace; font-size: 16px; line-height: 22.399999618530273px; white-space: pre;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;token selector&quot; style=&quot;box-sizing: border-box; color: #dfc48c; font-family: Menlo, Monaco, monospace; font-size: 16px; line-height: 22.399999618530273px; white-space: pre;&quot;&gt;@media only screen 
and (min-device-width : 768px) 
and (max-device-width : 1024px) &lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: white; font-family: Menlo, Monaco, monospace; font-size: 16px; line-height: 22.399999618530273px; white-space: pre;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color: #cd6a51; font-family: Menlo, Monaco, monospace; font-size: 16px; line-height: 22.399999618530273px; white-space: pre;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;token comment&quot; spellcheck=&quot;true&quot; style=&quot;box-sizing: border-box; color: #777777; font-family: Menlo, Monaco, monospace; font-size: 16px; line-height: 22.399999618530273px; white-space: pre;&quot;&gt;/* Styles */&lt;/span&gt;&lt;span style=&quot;color: #cd6a51; font-family: Menlo, Monaco, monospace; font-size: 16px; line-height: 22.399999618530273px; white-space: pre;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: white; font-family: Menlo, Monaco, monospace; font-size: 16px; line-height: 22.399999618530273px; white-space: pre;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color: #cd6a51; font-family: Menlo, Monaco, monospace; font-size: 16px; line-height: 22.399999618530273px; white-space: pre;&quot;&gt;

&lt;/span&gt;&lt;span class=&quot;token comment&quot; spellcheck=&quot;true&quot; style=&quot;box-sizing: border-box; color: #777777; font-family: Menlo, Monaco, monospace; font-size: 16px; line-height: 22.399999618530273px; white-space: pre;&quot;&gt;/* iPads (landscape) ----------- */&lt;/span&gt;&lt;span style=&quot;color: #cd6a51; font-family: Menlo, Monaco, monospace; font-size: 16px; line-height: 22.399999618530273px; white-space: pre;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;token selector&quot; style=&quot;box-sizing: border-box; color: #dfc48c; font-family: Menlo, Monaco, monospace; font-size: 16px; line-height: 22.399999618530273px; white-space: pre;&quot;&gt;@media only screen 
and (min-device-width : 768px) 
and (max-device-width : 1024px) 
and (orientation : landscape) &lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: white; font-family: Menlo, Monaco, monospace; font-size: 16px; line-height: 22.399999618530273px; white-space: pre;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color: #cd6a51; font-family: Menlo, Monaco, monospace; font-size: 16px; line-height: 22.399999618530273px; white-space: pre;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;token comment&quot; spellcheck=&quot;true&quot; style=&quot;box-sizing: border-box; color: #777777; font-family: Menlo, Monaco, monospace; font-size: 16px; line-height: 22.399999618530273px; white-space: pre;&quot;&gt;/* Styles */&lt;/span&gt;&lt;span style=&quot;color: #cd6a51; font-family: Menlo, Monaco, monospace; font-size: 16px; line-height: 22.399999618530273px; white-space: pre;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: white; font-family: Menlo, Monaco, monospace; font-size: 16px; line-height: 22.399999618530273px; white-space: pre;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color: #cd6a51; font-family: Menlo, Monaco, monospace; font-size: 16px; line-height: 22.399999618530273px; white-space: pre;&quot;&gt;

&lt;/span&gt;&lt;span class=&quot;token comment&quot; spellcheck=&quot;true&quot; style=&quot;box-sizing: border-box; color: #777777; font-family: Menlo, Monaco, monospace; font-size: 16px; line-height: 22.399999618530273px; white-space: pre;&quot;&gt;/* iPads (portrait) ----------- */&lt;/span&gt;&lt;span style=&quot;color: #cd6a51; font-family: Menlo, Monaco, monospace; font-size: 16px; line-height: 22.399999618530273px; white-space: pre;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;token selector&quot; style=&quot;box-sizing: border-box; color: #dfc48c; font-family: Menlo, Monaco, monospace; font-size: 16px; line-height: 22.399999618530273px; white-space: pre;&quot;&gt;@media only screen 
and (min-device-width : 768px) 
and (max-device-width : 1024px) 
and (orientation : portrait) &lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: white; font-family: Menlo, Monaco, monospace; font-size: 16px; line-height: 22.399999618530273px; white-space: pre;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color: #cd6a51; font-family: Menlo, Monaco, monospace; font-size: 16px; line-height: 22.399999618530273px; white-space: pre;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;token comment&quot; spellcheck=&quot;true&quot; style=&quot;box-sizing: border-box; color: #777777; font-family: Menlo, Monaco, monospace; font-size: 16px; line-height: 22.399999618530273px; white-space: pre;&quot;&gt;/* Styles */&lt;/span&gt;&lt;span style=&quot;color: #cd6a51; font-family: Menlo, Monaco, monospace; font-size: 16px; line-height: 22.399999618530273px; white-space: pre;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: white; font-family: Menlo, Monaco, monospace; font-size: 16px; line-height: 22.399999618530273px; white-space: pre;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color: #cd6a51; font-family: Menlo, Monaco, monospace; font-size: 16px; line-height: 22.399999618530273px; white-space: pre;&quot;&gt;

&lt;/span&gt;&lt;span class=&quot;token comment&quot; spellcheck=&quot;true&quot; style=&quot;box-sizing: border-box; color: #777777; font-family: Menlo, Monaco, monospace; font-size: 16px; line-height: 22.399999618530273px; white-space: pre;&quot;&gt;/* Desktops and laptops ----------- */&lt;/span&gt;&lt;span style=&quot;color: #cd6a51; font-family: Menlo, Monaco, monospace; font-size: 16px; line-height: 22.399999618530273px; white-space: pre;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;token selector&quot; style=&quot;box-sizing: border-box; color: #dfc48c; font-family: Menlo, Monaco, monospace; font-size: 16px; line-height: 22.399999618530273px; white-space: pre;&quot;&gt;@media only screen 
and (min-width : 1224px) &lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: white; font-family: Menlo, Monaco, monospace; font-size: 16px; line-height: 22.399999618530273px; white-space: pre;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color: #cd6a51; font-family: Menlo, Monaco, monospace; font-size: 16px; line-height: 22.399999618530273px; white-space: pre;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;token comment&quot; spellcheck=&quot;true&quot; style=&quot;box-sizing: border-box; color: #777777; font-family: Menlo, Monaco, monospace; font-size: 16px; line-height: 22.399999618530273px; white-space: pre;&quot;&gt;/* Styles */&lt;/span&gt;&lt;span style=&quot;color: #cd6a51; font-family: Menlo, Monaco, monospace; font-size: 16px; line-height: 22.399999618530273px; white-space: pre;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: white; font-family: Menlo, Monaco, monospace; font-size: 16px; line-height: 22.399999618530273px; white-space: pre;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color: #cd6a51; font-family: Menlo, Monaco, monospace; font-size: 16px; line-height: 22.399999618530273px; white-space: pre;&quot;&gt;

&lt;/span&gt;&lt;span class=&quot;token comment&quot; spellcheck=&quot;true&quot; style=&quot;box-sizing: border-box; color: #777777; font-family: Menlo, Monaco, monospace; font-size: 16px; line-height: 22.399999618530273px; white-space: pre;&quot;&gt;/* Large screens ----------- */&lt;/span&gt;&lt;span style=&quot;color: #cd6a51; font-family: Menlo, Monaco, monospace; font-size: 16px; line-height: 22.399999618530273px; white-space: pre;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;token selector&quot; style=&quot;box-sizing: border-box; color: #dfc48c; font-family: Menlo, Monaco, monospace; font-size: 16px; line-height: 22.399999618530273px; white-space: pre;&quot;&gt;@media only screen 
and (min-width : 1824px) &lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: white; font-family: Menlo, Monaco, monospace; font-size: 16px; line-height: 22.399999618530273px; white-space: pre;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color: #cd6a51; font-family: Menlo, Monaco, monospace; font-size: 16px; line-height: 22.399999618530273px; white-space: pre;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;token comment&quot; spellcheck=&quot;true&quot; style=&quot;box-sizing: border-box; color: #777777; font-family: Menlo, Monaco, monospace; font-size: 16px; line-height: 22.399999618530273px; white-space: pre;&quot;&gt;/* Styles */&lt;/span&gt;&lt;span style=&quot;color: #cd6a51; font-family: Menlo, Monaco, monospace; font-size: 16px; line-height: 22.399999618530273px; white-space: pre;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: white; font-family: Menlo, Monaco, monospace; font-size: 16px; line-height: 22.399999618530273px; white-space: pre;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color: #cd6a51; font-family: Menlo, Monaco, monospace; font-size: 16px; line-height: 22.399999618530273px; white-space: pre;&quot;&gt;

&lt;/span&gt;&lt;span class=&quot;token comment&quot; spellcheck=&quot;true&quot; style=&quot;box-sizing: border-box; color: #777777; font-family: Menlo, Monaco, monospace; font-size: 16px; line-height: 22.399999618530273px; white-space: pre;&quot;&gt;/* iPhone 4 ----------- */&lt;/span&gt;&lt;span style=&quot;color: #cd6a51; font-family: Menlo, Monaco, monospace; font-size: 16px; line-height: 22.399999618530273px; white-space: pre;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;token selector&quot; style=&quot;box-sizing: border-box; color: #dfc48c; font-family: Menlo, Monaco, monospace; font-size: 16px; line-height: 22.399999618530273px; white-space: pre;&quot;&gt;@media
only screen and (-webkit-min-device-pixel-ratio : 1.5),
only screen and (min-device-pixel-ratio : 1.5) &lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: white; font-family: Menlo, Monaco, monospace; font-size: 16px; line-height: 22.399999618530273px; white-space: pre;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color: #cd6a51; font-family: Menlo, Monaco, monospace; font-size: 16px; line-height: 22.399999618530273px; white-space: pre;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;token comment&quot; spellcheck=&quot;true&quot; style=&quot;box-sizing: border-box; color: #777777; font-family: Menlo, Monaco, monospace; font-size: 16px; line-height: 22.399999618530273px; white-space: pre;&quot;&gt;/* Styles */&lt;/span&gt;&lt;span style=&quot;color: #cd6a51; font-family: Menlo, Monaco, monospace; font-size: 16px; line-height: 22.399999618530273px; white-space: pre;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;token punctuation&quot; style=&quot;box-sizing: border-box; color: white; font-family: Menlo, Monaco, monospace; font-size: 16px; line-height: 22.399999618530273px; white-space: pre;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;</description><link>http://littlebitzltm.blogspot.com/2014/01/media-queries-para-dispositivos-standard.html</link><author>noreply@blogger.com (littlebitz)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7813956266500130511.post-334311980135123240</guid><pubDate>Sat, 21 Sep 2013 14:21:00 +0000</pubDate><atom:updated>2013-09-21T16:21:57.557+02:00</atom:updated><title>Creating a Mobile-First Responsive Web Design - HTML5 Rocks</title><description>&lt;a href=&quot;http://www.html5rocks.com/en/mobile/responsivedesign/?redirect_from_locale=es&quot;&gt;Creating a Mobile-First Responsive Web Design - HTML5 Rocks&lt;/a&gt;</description><link>http://littlebitzltm.blogspot.com/2013/09/creating-mobile-first-responsive-web.html</link><author>noreply@blogger.com (littlebitz)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7813956266500130511.post-3150610837331700841</guid><pubDate>Mon, 29 Jul 2013 13:41:00 +0000</pubDate><atom:updated>2013-07-29T15:41:18.126+02:00</atom:updated><title>Journey From DHTML To Ember.js/Angular.js</title><description>&lt;a href=&quot;http://ruoyusun.com/2013/04/06/journey-from-dhtml-to-ember-js-angular-js.html&quot;&gt;Journey From DHTML To Ember.js/Angular.js&lt;/a&gt;</description><link>http://littlebitzltm.blogspot.com/2013/07/journey-from-dhtml-to-emberjsangularjs.html</link><author>noreply@blogger.com (littlebitz)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7813956266500130511.post-983571529164493044</guid><pubDate>Mon, 29 Jul 2013 13:23:00 +0000</pubDate><atom:updated>2013-07-29T15:23:37.857+02:00</atom:updated><title>PHP isset() vs empty() vs is_null() - Virendra&#39;s TechTalk</title><description>&lt;a href=&quot;http://techtalk.virendrachandak.com/php-isset-vs-empty-vs-is_null/&quot;&gt;PHP isset() vs empty() vs is_null() - Virendra&#39;s TechTalk&lt;/a&gt;</description><link>http://littlebitzltm.blogspot.com/2013/07/php-isset-vs-empty-vs-isnull-virendras.html</link><author>noreply@blogger.com (littlebitz)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7813956266500130511.post-2707571278448062724</guid><pubDate>Fri, 22 Feb 2013 12:18:00 +0000</pubDate><atom:updated>2013-02-22T13:18:41.868+01:00</atom:updated><title>gradient: All the CSS3 properties explained | css3files.com</title><description>&lt;a href=&quot;http://www.css3files.com/gradient/&quot;&gt;gradient: All the CSS3 properties explained | css3files.com&lt;/a&gt;</description><link>http://littlebitzltm.blogspot.com/2013/02/gradient-all-css3-properties-explained.html</link><author>noreply@blogger.com (littlebitz)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7813956266500130511.post-7573478266977816407</guid><pubDate>Mon, 18 Feb 2013 12:38:00 +0000</pubDate><atom:updated>2013-02-18T13:38:09.389+01:00</atom:updated><title>Web Analytics Technical Implementation Best Practices. (JavaScript Tags) - Occam&#39;s Razor by Avinash Kaushik</title><description>&lt;a href=&quot;http://www.kaushik.net/avinash/web-analytics-technical-implementation-best-practices-javascript-tags/&quot;&gt;Web Analytics Technical Implementation Best Practices. (JavaScript Tags) - Occam&#39;s Razor by Avinash Kaushik&lt;/a&gt;</description><link>http://littlebitzltm.blogspot.com/2013/02/web-analytics-technical-implementation.html</link><author>noreply@blogger.com (littlebitz)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7813956266500130511.post-1525897878326202912</guid><pubDate>Sun, 03 Feb 2013 09:53:00 +0000</pubDate><atom:updated>2013-02-03T10:53:13.960+01:00</atom:updated><title>The Top 10 Javascript MVC Frameworks Reviewed - CodeBrief</title><description>&lt;a href=&quot;http://codebrief.com/2012/01/the-top-10-javascript-mvc-frameworks-reviewed/&quot;&gt;The Top 10 Javascript MVC Frameworks Reviewed - CodeBrief&lt;/a&gt;</description><link>http://littlebitzltm.blogspot.com/2013/02/the-top-10-javascript-mvc-frameworks.html</link><author>noreply@blogger.com (littlebitz)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7813956266500130511.post-6053285217324086187</guid><pubDate>Wed, 16 Jan 2013 15:04:00 +0000</pubDate><atom:updated>2013-01-16T16:04:38.421+01:00</atom:updated><title>Simulating mouse clicks in JavaScript</title><description>&lt;br /&gt;
&lt;div class=&quot;contenttitle&quot; style=&quot;background-color: #efefef; color: #333333; float: left; font-family: Verdana, Helvetica, sans-serif; font-size: 11px; margin: 0px; padding: 0px 0px 0px 10px; width: 385px;&quot;&gt;
&lt;h1 style=&quot;font-family: &#39;Times New Roman&#39;, Verdana, Arial, sans-serif; font-size: 22px; font-weight: normal; margin: 0px; padding: 0px;&quot;&gt;
&lt;a href=&quot;http://lifescaler.com/2008/04/simulating-mouse-clicks-in-javascript/&quot; rel=&quot;bookmark&quot; style=&quot;color: #333333; text-decoration: initial;&quot;&gt;Simulating mouse clicks in JavaScript&lt;/a&gt;&lt;/h1&gt;
&lt;/div&gt;
&lt;div style=&quot;background-color: #efefef; color: #333333; font-family: Verdana, Helvetica, sans-serif; font-size: 11px; line-height: 20px; padding: 0px 0px 15px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #efefef; color: #333333; font-family: Verdana, Helvetica, sans-serif; font-size: 11px; line-height: 20px; padding: 0px 0px 15px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #efefef; color: #333333; font-family: Verdana, Helvetica, sans-serif; font-size: 11px; line-height: 20px; padding: 0px 0px 15px;&quot;&gt;
There might&amp;nbsp;be times when you would like to simulate a mouse click on an DOM Node and don’t know how (for instance, submitting a form when in multi-frame environment).&lt;/div&gt;
&lt;div style=&quot;background-color: #efefef; color: #333333; font-family: Verdana, Helvetica, sans-serif; font-size: 11px; line-height: 20px; padding: 0px 0px 15px;&quot;&gt;
Furthermore, it would be nice if the functionality could extend the DOM, so as to be able to use it combined with other pre-existing features.&lt;br /&gt;Here’s the script bellow, just added and use it as you please (Ex. document.getElementById(”my_element”).click();)&lt;/div&gt;
&lt;pre class=&quot;javascript&quot; style=&quot;background-color: #efefef; color: #333333; font-size: 11px;&quot;&gt;HTMLElement.prototype.click = function() {
var evt = this.ownerDocument.createEvent(&#39;MouseEvents&#39;);
evt.initMouseEvent(&#39;click&#39;, true, true, this.ownerDocument.defaultView, 1, 0, 0, 0, 0, false, false, false, false, 0, null);
this.dispatchEvent(evt);
}
}&lt;/pre&gt;
&lt;div style=&quot;background-color: #efefef; color: #333333; float: right; font-family: Verdana, Helvetica, sans-serif; font-size: 11px; margin: 5px;&quot;&gt;
&lt;ins style=&quot;border: none; display: inline-table; height: 125px; margin: 0px; padding: 0px; position: relative; visibility: visible; width: 125px;&quot;&gt;&lt;ins id=&quot;aswift_0_anchor&quot; style=&quot;border: none; display: block; height: 125px; margin: 0px; padding: 0px; position: relative; visibility: visible; width: 125px;&quot;&gt;&lt;iframe allowtransparency=&quot;true&quot; frameborder=&quot;0&quot; height=&quot;125&quot; hspace=&quot;0&quot; id=&quot;aswift_0&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot; name=&quot;aswift_0&quot; scrolling=&quot;no&quot; style=&quot;left: 0px; position: absolute; top: 0px;&quot; vspace=&quot;0&quot; width=&quot;125&quot;&gt;&lt;/iframe&gt;&lt;/ins&gt;&lt;/ins&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #efefef; color: #333333; font-family: Verdana, Helvetica, sans-serif; font-size: 11px; line-height: 20px; padding: 0px 0px 15px;&quot;&gt;
&lt;span id=&quot;more-11&quot;&gt;&lt;/span&gt;&lt;br /&gt;The code above is for Firefox only. For IE, just call document.getElementById(”my_element”).click() - it works by default, out of the box.&lt;br /&gt;Quick code explanation:&lt;/div&gt;
&lt;ol style=&quot;background-color: #efefef; color: #333333; font-family: Verdana, Helvetica, sans-serif; font-size: 11px; margin: 0px 0px 0px 20px; padding: 0px 0px 10px;&quot;&gt;
&lt;li style=&quot;margin: 0px 0px 0px 20px; padding: 0px 0px 5px;&quot;&gt;Extend/create the click function for the HTMLElement&lt;/li&gt;
&lt;li style=&quot;margin: 0px 0px 0px 20px; padding: 0px 0px 5px;&quot;&gt;Create e new Mouse Event. The ownerDocument property returns the root element (document object) for a node. The createEvent arguments can be: “UIEvents”, “MouseEvents”, “MutationEvents”, and “HTMLEvents”.&lt;/li&gt;
&lt;li style=&quot;margin: 0px 0px 0px 20px; padding: 0px 0px 5px;&quot;&gt;Ok, here you would normally have an initEvent, instead of initMouseEvent. The initEvent can take as parameters the name of the event, a boolean specifying whether or not the event can bubble (there are two phases, capture and bubble) and a boolean specifying whether or not the event’s default action can be prevented. The initMouseEvent can hold some other parameters (beside the ones from above), which you can check out here:&amp;nbsp;&lt;a href=&quot;http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-Event-initMouseEvent&quot; style=&quot;color: #507aa5; text-decoration: initial;&quot; title=&quot;initMouseEvent&quot;&gt;initMouseEvent&lt;/a&gt;.&lt;/li&gt;
&lt;li style=&quot;margin: 0px 0px 0px 20px; padding: 0px 0px 5px;&quot;&gt;Dispatches the event into the implementations event model.&lt;/li&gt;
&lt;/ol&gt;
&lt;div style=&quot;background-color: #efefef; color: #333333; font-family: Verdana, Helvetica, sans-serif; font-size: 11px; line-height: 20px; padding: 0px 0px 15px;&quot;&gt;
For a nice guide of firing events (cross-browser wise), you can checkout&lt;a href=&quot;http://jehiah.cz/archive/firing-javascript-events-properly&quot; style=&quot;color: #507aa5; text-decoration: initial;&quot; title=&quot;Firing javascript events properly&quot;&gt;firing javascript events properly&lt;/a&gt;, where there are some nice examples to think of.&lt;br /&gt;Just to give a short receipt from Jehiah’s post:&lt;/div&gt;
&lt;pre class=&quot;javascript&quot; style=&quot;background-color: #efefef; color: #333333; font-size: 11px;&quot;&gt;function fireEvent(element,event){
if (document.createEventObject){
// dispatch for IE
var evt = document.createEventObject();
return element.fireEvent(&#39;on&#39;+event,evt)
}
else{
// dispatch for firefox + others
var evt = document.createEvent(&quot;HTMLEvents&quot;);
evt.initEvent(event, true, true ); // event type,bubbling,cancelable
return !element.dispatchEvent(evt);
}&lt;/pre&gt;
</description><link>http://littlebitzltm.blogspot.com/2013/01/simulating-mouse-clicks-in-javascript.html</link><author>noreply@blogger.com (littlebitz)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7813956266500130511.post-7552455342385199432</guid><pubDate>Tue, 13 Nov 2012 17:05:00 +0000</pubDate><atom:updated>2012-11-13T18:05:04.795+01:00</atom:updated><title>Jquery Listar eventos de un objeto por consola</title><description>&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var clickEvents = $(&#39;#selectores&#39;).data(&quot;events&quot;).click;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; jQuery.each(clickEvents, function(key, value) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; console.log(value);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; });&lt;br /&gt;
</description><link>http://littlebitzltm.blogspot.com/2012/11/jquery-listar-eventos-de-un-objeto-por.html</link><author>noreply@blogger.com (littlebitz)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7813956266500130511.post-8523259608521440376</guid><pubDate>Tue, 30 Oct 2012 16:56:00 +0000</pubDate><atom:updated>2012-10-30T17:56:59.742+01:00</atom:updated><title>How To Install Magento Locally On Windows XP | Website Design, Content Management System And SEO | Blog</title><description>&lt;a href=&quot;http://www.jvfconsulting.com/blog/117/How_To_Install_Magento_Locally_On_Windows_XP.html&quot;&gt;How To Install Magento Locally On Windows XP | Website Design, Content Management System And SEO | Blog&lt;/a&gt;</description><link>http://littlebitzltm.blogspot.com/2012/10/how-to-install-magento-locally-on.html</link><author>noreply@blogger.com (littlebitz)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7813956266500130511.post-2242149931758805544</guid><pubDate>Mon, 29 Oct 2012 10:32:00 +0000</pubDate><atom:updated>2012-10-29T11:32:19.661+01:00</atom:updated><title>Patrones de diseño en PHP: DAO Pattern </title><description>El Objeto de Acceso a Datos es un patrón ampliamente utilizado.&lt;br /&gt;
&lt;br /&gt;
Un problema recurrente en el desarrollo de software es el acceso a recursos de datos. En el ámbito del desarrollo Web, las aplicaciones tienden a recoger datos de algún motor de persistencia, por ejemplo, una base de datos.&lt;br /&gt;
&lt;br /&gt;
Esta tarea de recoger y almacenar datos, se sitúa intuitivamente en los controladores de nuestros objetos dentro del modelo de datos. Distribuyendo la información a cada objeto cuando este lo precise.&lt;br /&gt;
Tareas comunes a todos los objetos del modelo, y que ligan fuertemente la parte Web de la aplicación con el acceso a la base de datos.&lt;br /&gt;
&lt;br /&gt;
La idea de diseñar una capa intermedia entre la capa frontal y la base de datos, que provea de una interfaz de acceso a la base de datos, solucionará el problema de acoplamiento entre las dos capas, y además permitirá reutilizar el código común, evitando duplicidades, mejorando su extensibilidad y mantenimiento.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ref.&amp;nbsp;&lt;a href=&quot;http://ushainformatique.com/blog/tag/dao-pattern-in-php/&quot;&gt;DAO Pattern in PHP » World of Web&lt;/a&gt;</description><link>http://littlebitzltm.blogspot.com/2012/10/patrones-de-diseno-en-php-dao-pattern.html</link><author>noreply@blogger.com (littlebitz)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7813956266500130511.post-3563007488971941713</guid><pubDate>Mon, 03 Sep 2012 08:09:00 +0000</pubDate><atom:updated>2012-09-03T10:09:58.870+02:00</atom:updated><title>EclipseZone - Keeping Eclipse running clean ...</title><description>&lt;a href=&quot;http://www.eclipsezone.com/eclipse/forums/t61566.html&quot;&gt;EclipseZone - Keeping Eclipse running clean ...&lt;/a&gt;</description><link>http://littlebitzltm.blogspot.com/2012/09/eclipsezone-keeping-eclipse-running.html</link><author>noreply@blogger.com (littlebitz)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7813956266500130511.post-3505496358114587234</guid><pubDate>Tue, 28 Aug 2012 19:37:00 +0000</pubDate><atom:updated>2012-10-04T17:40:26.278+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">CSS</category><category domain="http://www.blogger.com/atom/ns#">HTML</category><title>3 Column CSS Layout: Fixed Width And Centered - Vanseo Design</title><description>&lt;a href=&quot;http://www.vanseodesign.com/css/3-column-layout-code/&quot;&gt;3 Column CSS Layout: Fixed Width And Centered - Vanseo Design&lt;/a&gt;</description><link>http://littlebitzltm.blogspot.com/2012/08/3-column-css-layout-fixed-width-and.html</link><author>noreply@blogger.com (littlebitz)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7813956266500130511.post-1788694030876879499</guid><pubDate>Thu, 05 Jul 2012 09:42:00 +0000</pubDate><atom:updated>2012-07-05T11:43:00.532+02:00</atom:updated><title>A dark corner of PHP: class casting » Jasny · web development</title><description>Sometimes you want things that simply look impossible in PHP. A few years ago I was using the &lt;a href=&quot;http://pear.php.net/package/DB&quot;&gt;DB library from PEAR&lt;/a&gt;.  I wanted to add some functionality to the DB_Result class, however  since the result object is created in the DB class and the class used  for that isn’t configurable, I was kind of stuck there.&lt;br /&gt;
I solved this problem by writing a class extending the DB_Result  class. The class had which used reflection to pull all the info out of  the DB_Result class and created a new DB_Result_Ext object. In the end I  decided that I didn’t like DB class at all (nor MDB2 for that mather),  so I threw away this dirty code, however I always felt that there had to  be a better way in solving these kind of issues.&lt;br /&gt;
The new solution for this problem I’m about to show, is really a dark  corner of PHP and perhaps even dirtier than the other dirty solution.  However the method can get you out of a jam when this situation arises.&lt;br /&gt;
&lt;br /&gt;
PHP has a function serialize, which can create a hash from any type  of variable, scalars, array, but objects as well. Using the unserialize  function, PHP can recreate the variable from the serialized hashed. If  we look at how an object is serialized, we see only the properties and  the class name are stored. Serializing an object of the ‘mother’ class,  with a protected variables ‘$myvar’, would give the following hash:&lt;br /&gt;
&lt;pre&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;O:6:&quot;mother&quot;:1:{s:8:&quot;�*�myvar&quot;;i:5;}&lt;/pre&gt;&lt;pre&gt;&amp;nbsp;&lt;/pre&gt;We see an ‘O’ for object, the string length of the class name, the  quoted class name and the properties. What would happen if we would  change the class name and unserialize?&lt;br /&gt;
&lt;span id=&quot;more-71&quot;&gt;&lt;/span&gt;&lt;br /&gt;
Let’s have a look at the following example:&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background-color: #dddddd; color: #999999;&quot;&gt;&lt;pre&gt;&lt;div class=&quot;line&quot; id=&quot;LC1&quot;&gt;&lt;span class=&quot;cp&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;line&quot; id=&quot;LC2&quot;&gt;&lt;/div&gt;&lt;div class=&quot;line&quot; id=&quot;LC3&quot;&gt;&lt;span class=&quot;sd&quot;&gt;/**&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;line&quot; id=&quot;LC4&quot;&gt;&lt;span class=&quot;sd&quot;&gt; * Parent class&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;line&quot; id=&quot;LC5&quot;&gt;&lt;span class=&quot;sd&quot;&gt; */&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;line&quot; id=&quot;LC6&quot;&gt;&lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;mother&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;line&quot; id=&quot;LC7&quot;&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;line&quot; id=&quot;LC8&quot;&gt;&lt;span class=&quot;k&quot;&gt;protected&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$myvar&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;line&quot; id=&quot;LC9&quot;&gt;&lt;/div&gt;&lt;div class=&quot;line&quot; id=&quot;LC10&quot;&gt;&lt;span class=&quot;k&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;__construct&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$value&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;line&quot; id=&quot;LC11&quot;&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;line&quot; id=&quot;LC12&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$this&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;myvar&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$value&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;line&quot; id=&quot;LC13&quot;&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;line&quot; id=&quot;LC14&quot;&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;line&quot; id=&quot;LC15&quot;&gt;&lt;/div&gt;&lt;div class=&quot;line&quot; id=&quot;LC16&quot;&gt;&lt;span class=&quot;sd&quot;&gt;/**&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;line&quot; id=&quot;LC17&quot;&gt;&lt;span class=&quot;sd&quot;&gt; * Child class&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;line&quot; id=&quot;LC18&quot;&gt;&lt;span class=&quot;sd&quot;&gt; */&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;line&quot; id=&quot;LC19&quot;&gt;&lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;grandmother&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;mother&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;line&quot; id=&quot;LC20&quot;&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;line&quot; id=&quot;LC21&quot;&gt;&lt;span class=&quot;k&quot;&gt;protected&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$bval&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;line&quot; id=&quot;LC22&quot;&gt;&lt;/div&gt;&lt;div class=&quot;line&quot; id=&quot;LC23&quot;&gt;&lt;span class=&quot;k&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;__construct&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$value&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;line&quot; id=&quot;LC24&quot;&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;line&quot; id=&quot;LC25&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$this&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;bval&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$value&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;line&quot; id=&quot;LC26&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$this&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;myvar&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$value&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;/&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;line&quot; id=&quot;LC27&quot;&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;line&quot; id=&quot;LC28&quot;&gt;&lt;/div&gt;&lt;div class=&quot;line&quot; id=&quot;LC29&quot;&gt;&lt;span class=&quot;k&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;__wakeup&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;line&quot; id=&quot;LC30&quot;&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;line&quot; id=&quot;LC31&quot;&gt;&lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;isset&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$this&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;myvar&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;throw&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Exception&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Illegal unserialize: The original object did not contain a myvar property.&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;line&quot; id=&quot;LC32&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$this&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;bval&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$this&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;myvar&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;line&quot; id=&quot;LC33&quot;&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;line&quot; id=&quot;LC34&quot;&gt;&lt;/div&gt;&lt;div class=&quot;line&quot; id=&quot;LC35&quot;&gt;&lt;span class=&quot;k&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;getVal&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;line&quot; id=&quot;LC36&quot;&gt;&lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$this&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;bval&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;line&quot; id=&quot;LC37&quot;&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;line&quot; id=&quot;LC38&quot;&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;line&quot; id=&quot;LC39&quot;&gt;&lt;/div&gt;&lt;div class=&quot;line&quot; id=&quot;LC40&quot;&gt;&lt;span class=&quot;sd&quot;&gt;/**&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;line&quot; id=&quot;LC41&quot;&gt;&lt;span class=&quot;sd&quot;&gt; * Cast an object to another class, keeping the properties, but changing the methods&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;line&quot; id=&quot;LC42&quot;&gt;&lt;span class=&quot;sd&quot;&gt; *&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;line&quot; id=&quot;LC43&quot;&gt;&lt;span class=&quot;sd&quot;&gt; * @param string $class  Class name&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;line&quot; id=&quot;LC44&quot;&gt;&lt;span class=&quot;sd&quot;&gt; * @param object $object&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;line&quot; id=&quot;LC45&quot;&gt;&lt;span class=&quot;sd&quot;&gt; * @return object&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;line&quot; id=&quot;LC46&quot;&gt;&lt;span class=&quot;sd&quot;&gt; */&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;line&quot; id=&quot;LC47&quot;&gt;&lt;span class=&quot;k&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;casttoclass&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$class&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$object&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;line&quot; id=&quot;LC48&quot;&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;line&quot; id=&quot;LC49&quot;&gt;&lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;unserialize&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;preg_replace&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&#39;/^O:\d+:&quot;[^&quot;]++&quot;/&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;O:&#39;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;strlen&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$class&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;:&quot;&#39;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$class&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#39;&quot;&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;serialize&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$object&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)));&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;line&quot; id=&quot;LC50&quot;&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;line&quot; id=&quot;LC51&quot;&gt;&lt;/div&gt;&lt;div class=&quot;line&quot; id=&quot;LC52&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$a&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;mother&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;line&quot; id=&quot;LC53&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$z&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;casttoclass&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&#39;grandmother&#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$a&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;line&quot; id=&quot;LC54&quot;&gt;&lt;/div&gt;&lt;div class=&quot;line&quot; id=&quot;LC55&quot;&gt;&lt;span class=&quot;k&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$z&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;getVal&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class=&quot;gist&quot; id=&quot;gist-2223675&quot;&gt;&lt;div class=&quot;gist-file&quot;&gt;&lt;div class=&quot;gist-data gist-syntax&quot;&gt;&lt;div class=&quot;gist-highlight&quot;&gt;&lt;pre&gt;&lt;div class=&quot;line&quot; id=&quot;LC56&quot;&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;gist-meta&quot;&gt;&lt;a href=&quot;https://gist.github.com/raw/2223675/ea804d711a87eba14da35c8cfab9c86b4d3e1d5b/class_casting.php&quot; style=&quot;float: right;&quot;&gt;view raw&lt;/a&gt;             &lt;a href=&quot;https://gist.github.com/2223675#file_class_casting.php&quot; style=&quot;color: #666666; float: right; margin-right: 10px;&quot;&gt;class_casting.php&lt;/a&gt;             &lt;a href=&quot;https://gist.github.com/2223675&quot;&gt;This Gist&lt;/a&gt; brought to you by &lt;a href=&quot;http://github.com/&quot;&gt;GitHub&lt;/a&gt;.           &lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;
We have a class ‘mother’ and a class ‘grandmother’ extending  ‘mother’. We create a ‘mother’ object and now we want to cast it to a  ‘grandmother’. In the casttoclass() function, we serialize the object,  use a preg_replace to change the class name and than unserialize the  hash. This creates a ‘grandmother’ object, with a property ‘$myvar’ set  to 5, however the ‘$bval’ property is not set. To solve this we can use  the magic method __wakeup(). After the conversion, we can use $z  normally as any other ‘grandmother’.</description><author>noreply@blogger.com (littlebitz)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7813956266500130511.post-7139771677541583249</guid><pubDate>Thu, 22 Mar 2012 12:20:00 +0000</pubDate><atom:updated>2012-10-04T17:36:12.002+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">mysql</category><category domain="http://www.blogger.com/atom/ns#">sql</category><title>Regular Expressions: REGEXP_LIKE</title><description>&lt;a href=&quot;http://www.sqlsnippets.com/en/topic-11741.html&quot;&gt;Regular Expressions: REGEXP_LIKE&lt;/a&gt;</description><link>http://littlebitzltm.blogspot.com/2012/03/regular-expressions-regexplike.html</link><author>noreply@blogger.com (littlebitz)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7813956266500130511.post-3354697061540471912</guid><pubDate>Thu, 22 Mar 2012 12:18:00 +0000</pubDate><atom:updated>2012-10-04T17:36:38.202+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">postgresql</category><category domain="http://www.blogger.com/atom/ns#">sql</category><title>PostgreSQL Regexp Operator and Functions</title><description>&lt;a href=&quot;http://www.regexbuddy.com/postgresql.html&quot;&gt;PostgreSQL Regexp Operator and Functions&lt;/a&gt;</description><link>http://littlebitzltm.blogspot.com/2012/03/postgresql-regexp-operator-and.html</link><author>noreply@blogger.com (littlebitz)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7813956266500130511.post-7556591621627133028</guid><pubDate>Sun, 11 Mar 2012 14:00:00 +0000</pubDate><atom:updated>2012-03-11T15:00:53.362+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">HTML</category><title>HTML select tag</title><description>&lt;a href=&quot;http://www.w3schools.com/tags/tag_select.asp&quot;&gt;HTML select tag&lt;/a&gt;</description><link>http://littlebitzltm.blogspot.com/2012/03/html-select-tag.html</link><author>noreply@blogger.com (littlebitz)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7813956266500130511.post-7189206912736582413</guid><pubDate>Mon, 20 Feb 2012 10:13:00 +0000</pubDate><atom:updated>2012-10-04T17:40:36.721+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">PHP</category><title>Evitar que un script en PHP se ejecute desde navegador</title><description>if (!empty($_SERVER[&#39;HTTP_USER_AGENT&#39;])) die();</description><link>http://littlebitzltm.blogspot.com/2012/02/evitar-que-un-script-en-php-se-ejecute.html</link><author>noreply@blogger.com (littlebitz)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7813956266500130511.post-7861146617792425025</guid><pubDate>Wed, 18 Jan 2012 15:38:00 +0000</pubDate><atom:updated>2012-10-04T17:41:13.930+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">oracle</category><category domain="http://www.blogger.com/atom/ns#">PHP</category><category domain="http://www.blogger.com/atom/ns#">sql</category><title>PHP y ORACLE</title><description>Ahora mismo estoy poniendo un producción un servidor en mi centro de 
trabajo, en el que además de tener que dar servicio para la base de 
datos &lt;a href=&quot;http://es.wikipedia.org/wiki/PostgreSQL&quot; target=&quot;_blank&quot;&gt;PostgreSQL &lt;/a&gt;(explique hace poco &lt;a href=&quot;http://www.linuxhispano.net/2011/02/15/permitir-conexiones-entrantes-a-un-servidor-postgresql/&quot; target=&quot;_blank&quot;&gt;cómo permitir conexiones entrantes&lt;/a&gt; a esta BBDD), debe hacer conexiones externas a una base de datos &lt;a href=&quot;http://es.wikipedia.org/wiki/Oracle&quot; target=&quot;_blank&quot;&gt;Oracle&lt;/a&gt;.&lt;br /&gt;
&lt;b&gt;Estas conexiones las hará un script en PHP&lt;/b&gt; por lo que además, deberemos instalar &lt;a href=&quot;http://www.oracle.com/technetwork/database/features/oci/index.html&quot; target=&quot;_blank&quot;&gt;OCI (Oracle Call Interface)&lt;/a&gt; para &lt;a href=&quot;http://php.net/manual/es/book.oci8.php&quot; target=&quot;_blank&quot;&gt;PHP&lt;/a&gt;. Suponemos que está ya instalado el servidor web Apache 2 y los componentes básicos de PHP.&lt;br /&gt;
&lt;a href=&quot;http://www.linuxhispano.net/wp-content/uploads/2011/03/oracle1.jpg&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;aligncenter size-full wp-image-5558&quot; height=&quot;110&quot; src=&quot;http://www.linuxhispano.net/wp-content/uploads/2011/03/oracle1.jpg&quot; title=&quot;oracle&quot; width=&quot;432&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;Instalación de Oracle instantclient&lt;/b&gt;&lt;br /&gt;
&lt;b&gt; &lt;/b&gt;Antes de instalar el &lt;i&gt;instantclient&lt;/i&gt; como tal, debemos instalar la librería &lt;i&gt;libaio&lt;/i&gt;, necesaria para&lt;b&gt; gestionar entradas/salidas asíncronas al &lt;a href=&quot;http://www.linuxhispano.net/2010/05/18/kernel/&quot; title=&quot;kernel&quot;&gt;kernel&lt;/a&gt;&lt;/b&gt;. La instrucción será (utilizo “#” en el &lt;i&gt;prompt &lt;/i&gt;para indicar como superusuario, “$” en caso contrario):&lt;br /&gt;
&lt;blockquote&gt;
# yum install libaio1&lt;/blockquote&gt;
O si usamos una distribución que use APT:&lt;br /&gt;
&lt;blockquote&gt;
# apt-get install libaio1&lt;/blockquote&gt;
Lo siguiente será acceder &lt;a href=&quot;http://www.oracle.com/technetwork/indexes/downloads/index.html&quot; target=&quot;_blank&quot;&gt;al portal de descargas de Oracle&lt;/a&gt; y descargar los componentes necesarios para el &lt;i&gt;instantclient&lt;/i&gt;:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Basic&lt;/li&gt;
&lt;li&gt;Devel&lt;/li&gt;
&lt;li&gt;SQLPlus&lt;/li&gt;
&lt;/ul&gt;
Elegimos la última versión, nuestra arquitectura &amp;nbsp;y descargamos &lt;b&gt;los paquetes RPM&lt;/b&gt;. La instalación será inmediata si tenemos una distribución basada en Red Hat:&lt;br /&gt;
&lt;blockquote&gt;
# yum install paquete.rpm&lt;/blockquote&gt;
En caso contrario, deberemos instalar &lt;a href=&quot;http://es.wikipedia.org/wiki/Alien_%28aplicaci%C3%B3n%29&quot; target=&quot;_blank&quot;&gt;alien &lt;/a&gt;previamente para que convierta los paquetes &lt;a href=&quot;http://es.wikipedia.org/wiki/RPM_Package_Manager&quot; target=&quot;_blank&quot;&gt;RPM &lt;/a&gt;en paquetes &lt;a href=&quot;http://es.wikipedia.org/wiki/Deb&quot; target=&quot;_blank&quot;&gt;DEB&lt;/a&gt;:&lt;br /&gt;
&lt;blockquote&gt;
# apt-get install alien&lt;br /&gt;
# alien paquete.rpm&lt;br /&gt;
# dpkg -i paquete.deb&lt;/blockquote&gt;
Ahora ya nos tocar configurar el famoso fichero &lt;a href=&quot;http://www.orafaq.com/wiki/Tnsnames.ora&quot; target=&quot;_blank&quot;&gt;Tnsnames.ora&lt;/a&gt;. Este fichero variará de una &lt;a href=&quot;http://www.linuxhispano.net/etiqueta/configuracion/&quot; title=&quot;configuración&quot;&gt;configuración&lt;/a&gt; a otra por lo que sólo vamos a comentar dónde situarlo. Su ruta debe ser:&amp;nbsp;&lt;i&gt;/etc/oracle/tnsnames.ora&lt;/i&gt;, en caso de no existir, deberemos crearla.&lt;br /&gt;
Para
 terminar, deberemos crear unas variables de entorno. Para ello 
accedemos al fichero /root/.bashrc como superusuario e incluimos las 
siguientes líneas:&lt;br /&gt;
&lt;blockquote&gt;
export TNS_ADMIN=/etc/oracleexport 
SQLPATH=/usr/lib/oracle/11.1.0.1/client/binexport 
LD_LIBRARY_PATH=/usr/lib/oracle/11.1.0.1/client/lib:$LD_LIBRARY_PATHexport
 PATH=$PATH:$SQLPATH&lt;/blockquote&gt;
En algunas &lt;a href=&quot;http://www.linuxhispano.net/etiqueta/distribuciones/&quot; title=&quot;distribuciones&quot;&gt;distribuciones&lt;/a&gt;, también podréis hacer ese cambio en otro fichero:&lt;i&gt; /etc/environment&lt;/i&gt;.&lt;br /&gt;
&lt;a href=&quot;http://www.linuxhispano.net/wp-content/uploads/2011/03/pear.gif&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;aligncenter size-full wp-image-5559&quot; height=&quot;180&quot; src=&quot;http://www.linuxhispano.net/wp-content/uploads/2011/03/pear.gif&quot; title=&quot;pear&quot; width=&quot;360&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;Instalación de OCI en PHP&lt;/b&gt;&lt;br /&gt;
Ahora
 nos toca la parte de PHP, es decir, instalar los componentes necesarios
 para poder hacer llamadas a Oracle desde PHP usando el &lt;i&gt;instantclient &lt;/i&gt;que acabamos de instalar (con lo fácil que es hacer esto mismo con &lt;a href=&quot;http://es.wikipedia.org/wiki/Mysql&quot; target=&quot;_blank&quot;&gt;MySQL &lt;/a&gt;o PostgreSQL…, las cosas del software cerrado).&lt;br /&gt;
Suponemos que tenemos instalado &lt;a href=&quot;http://es.wikipedia.org/wiki/Servidor_HTTP_Apache&quot; target=&quot;_blank&quot;&gt;Apache2 &lt;/a&gt;y PHP, pero aún así instalaremos dos paquetes más:&lt;br /&gt;
&lt;blockquote&gt;
# yum install php-pear php5-dev&lt;br /&gt;
# apt-get install php-pear php5-dev&lt;/blockquote&gt;
&lt;a href=&quot;http://pear.php.net/&quot; target=&quot;_blank&quot;&gt;PHP-PEAR&lt;/a&gt;
 es según definen sus siglas:&amp;nbsp;PHP Extension and Application Repository, 
es decir, un repositorio de extensiones y aplicaciones para PHP que &lt;b&gt;nos permite instalar sin problemas ciertos componentes de PHP&lt;/b&gt; que no podemos instalar a través de nuestro gestor de paquetes habitual (me recuerda a &lt;a href=&quot;http://www.cpan.org/&quot; target=&quot;_blank&quot;&gt;CPAN con Perl&lt;/a&gt;, pero esa es otra historia para otra entrada).&lt;br /&gt;
&lt;a href=&quot;http://www.linuxhispano.net/wp-content/uploads/2011/03/php.png&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;aligncenter size-full wp-image-5560&quot; height=&quot;255&quot; src=&quot;http://www.linuxhispano.net/wp-content/uploads/2011/03/php.png&quot; title=&quot;php&quot; width=&quot;397&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
Ya estamos en disposición de ejecutarlo para instalar OCI:&lt;br /&gt;
&lt;blockquote&gt;
pecl install oci8&lt;/blockquote&gt;
En la terminal nos aparecerá algo así como:&lt;br /&gt;
&lt;blockquote&gt;
1-1, ‘all’, ‘abort’, or Enter to continue:&lt;/blockquote&gt;
Pulsamos “1″ luego ENTER y escribimos las siguientes opciones (debemos saber &lt;b&gt;el PATH exacto de nuestras librerías Oracle&lt;/b&gt;, cambiará en función de la versión):&lt;br /&gt;
&lt;blockquote&gt;
shared,instantclient,/usr/lib/oracle/mi_version/client/lib/&lt;/blockquote&gt;
PHP-PEAR descargará, configurará, compilará e instalará el módulo. Finalmente, tenemos que añadir a nuestro fichero &lt;i&gt;php.ini &lt;/i&gt;una línea para que cargue la librería dinámica de OCI y puedan hacerse llamadas desde los ficheros PHP.&lt;br /&gt;
La ruta del fichero será:&amp;nbsp;&lt;i&gt;/etc/php5/apache2/php.ini &lt;/i&gt;y la línea a agregar junto a las demás extensiones la siguiente:&lt;br /&gt;
&lt;blockquote&gt;
extension=oci8.so&lt;/blockquote&gt;
&lt;b&gt;Reiniciamos el servidor web&lt;/b&gt; y listo:&lt;br /&gt;
&lt;blockquote&gt;
services httpd restart&lt;/blockquote&gt;
O:&lt;br /&gt;
&lt;blockquote&gt;
/etc/init.d/apache2 reload&lt;/blockquote&gt;
</description><link>http://littlebitzltm.blogspot.com/2012/01/php-y-oracle.html</link><author>noreply@blogger.com (littlebitz)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7813956266500130511.post-5505274306118935967</guid><pubDate>Mon, 21 Nov 2011 11:05:00 +0000</pubDate><atom:updated>2012-10-04T17:41:26.701+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Apache</category><category domain="http://www.blogger.com/atom/ns#">Server</category><title>Proxy Apache Mod</title><description>&lt;br /&gt;
&lt;div style=&quot;background-color: white; color: #535252; font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: 13px; margin-bottom: 0.25em;&quot;&gt;
&lt;a class=&quot;title&quot; href=&quot;http://www.askapache.com/web-hosting/reverse-proxy-apache.html&quot; style=&quot;color: #005fa9; font-size: 1.4em; text-decoration: none;&quot; title=&quot;Running a Reverse Proxy in Apache&quot;&gt;Running a Reverse Proxy in Apache&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #535252; font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: 13px; margin-left: 2em;&quot;&gt;
&lt;a href=&quot;http://draft.blogger.com/blogger.g?blogID=7813956266500130511&quot; id=&quot;toc&quot; title=&quot;Htaccess - Table of Contents&quot;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;div id=&quot;toch2&quot;&gt;
Contents&lt;/div&gt;
&lt;ol class=&quot;TOC&quot; style=&quot;margin-bottom: 1.5em; margin-left: 2em;&quot;&gt;
&lt;li style=&quot;line-height: 1.35em; margin-bottom: 0.02em; margin-top: 0.02em;&quot;&gt;&lt;a href=&quot;http://www.askapache.com/web-hosting/reverse-proxy-apache.html#Web_Proxies&quot; style=&quot;color: #005fa9; text-decoration: none;&quot;&gt;Web Proxies&lt;/a&gt;&lt;/li&gt;
&lt;li style=&quot;line-height: 1.35em; margin-bottom: 0.02em; margin-top: 0.02em;&quot;&gt;&lt;a href=&quot;http://www.askapache.com/web-hosting/reverse-proxy-apache.html#Reverse_Proxies&quot; style=&quot;color: #005fa9; text-decoration: none;&quot;&gt;Reverse Proxies&lt;/a&gt;&lt;/li&gt;
&lt;li style=&quot;line-height: 1.35em; margin-bottom: 0.02em; margin-top: 0.02em;&quot;&gt;&lt;a href=&quot;http://www.askapache.com/web-hosting/reverse-proxy-apache.html#Proxying_Apache&quot; style=&quot;color: #005fa9; text-decoration: none;&quot;&gt;Proxying with Apache&lt;/a&gt;&lt;ol style=&quot;margin-bottom: 0px; margin-left: 2em; margin-top: 0px;&quot;&gt;
&lt;li style=&quot;line-height: 1.35em; margin-bottom: 0.02em; margin-top: 0.02em;&quot;&gt;&lt;a href=&quot;http://www.askapache.com/web-hosting/reverse-proxy-apache.html#Apache_Proxy_Modules&quot; style=&quot;color: #005fa9; text-decoration: none;&quot;&gt;The Apache Proxy Modules&lt;/a&gt;&lt;/li&gt;
&lt;li style=&quot;line-height: 1.35em; margin-bottom: 0.02em; margin-top: 0.02em;&quot;&gt;&lt;a href=&quot;http://www.askapache.com/web-hosting/reverse-proxy-apache.html#Building_Apache_Proxying&quot; style=&quot;color: #005fa9; text-decoration: none;&quot;&gt;Building Apache for Proxying&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li style=&quot;line-height: 1.35em; margin-bottom: 0.02em; margin-top: 0.02em;&quot;&gt;&lt;a href=&quot;http://www.askapache.com/web-hosting/reverse-proxy-apache.html#Reverse_Proxy_Scenario&quot; style=&quot;color: #005fa9; text-decoration: none;&quot;&gt;A Reverse Proxy Scenario&lt;/a&gt;&lt;ol style=&quot;margin-bottom: 0px; margin-left: 2em; margin-top: 0px;&quot;&gt;
&lt;li style=&quot;line-height: 1.35em; margin-bottom: 0.02em; margin-top: 0.02em;&quot;&gt;&lt;a href=&quot;http://www.askapache.com/web-hosting/reverse-proxy-apache.html#Configuring_Proxy&quot; style=&quot;color: #005fa9; text-decoration: none;&quot;&gt;Configuring the Proxy&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li style=&quot;line-height: 1.35em; margin-bottom: 0.02em; margin-top: 0.02em;&quot;&gt;&lt;a href=&quot;http://www.askapache.com/web-hosting/reverse-proxy-apache.html#Fixing_HTML_Links&quot; style=&quot;color: #005fa9; text-decoration: none;&quot;&gt;Fixing HTML Links&lt;/a&gt;&lt;ol style=&quot;margin-bottom: 0px; margin-left: 2em; margin-top: 0px;&quot;&gt;
&lt;li style=&quot;line-height: 1.35em; margin-bottom: 0.02em; margin-top: 0.02em;&quot;&gt;&lt;a href=&quot;http://www.askapache.com/web-hosting/reverse-proxy-apache.html#How_it_works&quot; style=&quot;color: #005fa9; text-decoration: none;&quot;&gt;How it works&lt;/a&gt;&lt;/li&gt;
&lt;li style=&quot;line-height: 1.35em; margin-bottom: 0.02em; margin-top: 0.02em;&quot;&gt;&lt;a href=&quot;http://www.askapache.com/web-hosting/reverse-proxy-apache.html#Debugging_Proxy_Configuration&quot; style=&quot;color: #005fa9; text-decoration: none;&quot;&gt;Debugging your Proxy Configuration&lt;/a&gt;&lt;/li&gt;
&lt;li style=&quot;line-height: 1.35em; margin-bottom: 0.02em; margin-top: 0.02em;&quot;&gt;&lt;a href=&quot;http://www.askapache.com/web-hosting/reverse-proxy-apache.html#Extended_URL_Mapping&quot; style=&quot;color: #005fa9; text-decoration: none;&quot;&gt;Extended URL Mapping&lt;/a&gt;&lt;/li&gt;
&lt;li style=&quot;line-height: 1.35em; margin-bottom: 0.02em; margin-top: 0.02em;&quot;&gt;&lt;a href=&quot;http://www.askapache.com/web-hosting/reverse-proxy-apache.html#Dealing_multimedia_content&quot; style=&quot;color: #005fa9; text-decoration: none;&quot;&gt;Dealing with multimedia content&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li style=&quot;line-height: 1.35em; margin-bottom: 0.02em; margin-top: 0.02em;&quot;&gt;&lt;a href=&quot;http://www.askapache.com/web-hosting/reverse-proxy-apache.html#Complete_Configuration&quot; style=&quot;color: #005fa9; text-decoration: none;&quot;&gt;The Complete Configuration&lt;/a&gt;&lt;/li&gt;
&lt;li style=&quot;line-height: 1.35em; margin-bottom: 0.02em; margin-top: 0.02em;&quot;&gt;&lt;a href=&quot;http://www.askapache.com/web-hosting/reverse-proxy-apache.html#Further_topics&quot; style=&quot;color: #005fa9; text-decoration: none;&quot;&gt;Further topics&lt;/a&gt;&lt;ol style=&quot;margin-bottom: 0px; margin-left: 2em; margin-top: 0px;&quot;&gt;
&lt;li style=&quot;line-height: 1.35em; margin-bottom: 0.02em; margin-top: 0.02em;&quot;&gt;&lt;a href=&quot;http://www.askapache.com/web-hosting/reverse-proxy-apache.html#Caching&quot; style=&quot;color: #005fa9; text-decoration: none;&quot;&gt;Caching&lt;/a&gt;&lt;/li&gt;
&lt;li style=&quot;line-height: 1.35em; margin-bottom: 0.02em; margin-top: 0.02em;&quot;&gt;&lt;a href=&quot;http://www.askapache.com/web-hosting/reverse-proxy-apache.html#Content_Transformation&quot; style=&quot;color: #005fa9; text-decoration: none;&quot;&gt;Content Transformation&lt;/a&gt;&lt;/li&gt;
&lt;li style=&quot;line-height: 1.35em; margin-bottom: 0.02em; margin-top: 0.02em;&quot;&gt;&lt;a href=&quot;http://www.askapache.com/web-hosting/reverse-proxy-apache.html#Filtering_Security&quot; style=&quot;color: #005fa9; text-decoration: none;&quot;&gt;Filtering and Security&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li style=&quot;line-height: 1.35em; margin-bottom: 0.02em; margin-top: 0.02em;&quot;&gt;&lt;a href=&quot;http://www.askapache.com/web-hosting/reverse-proxy-apache.html#Questions_and_Answers&quot; style=&quot;color: #005fa9; text-decoration: none;&quot;&gt;Questions and Answers&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #535252; font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: 13px;&quot;&gt;
In 2003, Nick Kew released a new module that complements Apache&#39;s mod_proxy and is essential for reverse-proxying. Since then he gets regular questions and requests for help on proxying with Apache. In this article he attempts to give a comprehensive overview of the proxying and mod_proxy_html&lt;/div&gt;
&lt;hr style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; clear: both; color: white; font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: 13px; height: 2em; visibility: hidden;&quot; /&gt;
&lt;div style=&quot;background-color: white; color: #535252; font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: 13px;&quot;&gt;
This article was originally published at ApacheWeek in January 2004, and moved to ApacheTutor with minor updates in October 2006.&lt;/div&gt;
&lt;h2 style=&quot;background-color: white; color: #535252; font-family: Tahoma, Verdana, Helvetica, sans-serif;&quot;&gt;
&lt;a href=&quot;http://draft.blogger.com/blogger.g?blogID=7813956266500130511&quot; id=&quot;Web_Proxies&quot;&gt;Web Proxies&lt;/a&gt;&amp;nbsp;&lt;a href=&quot;http://www.askapache.com/web-hosting/reverse-proxy-apache.html#toc&quot; style=&quot;color: #005fa9; text-decoration: none;&quot;&gt;^&lt;/a&gt;&lt;/h2&gt;
&lt;div style=&quot;background-color: white; color: #535252; font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: 13px;&quot;&gt;
A proxy server is a gateway for users to the Web at large. Users configure the proxy in their browser settings, and all HTTP requests are routed via the proxy. Proxies are typically operated by ISPs and network administrators, and serve several purposes: for example,&lt;/div&gt;
&lt;ul style=&quot;background-color: white; color: #535252; font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: 13px; margin-bottom: 1.5em; margin-left: 2em;&quot;&gt;
&lt;li style=&quot;line-height: 1.35em; margin-bottom: 0.02em; margin-top: 0.02em;&quot;&gt;to speed access to the Web by caching pages fetched, so that popular pages don&#39;t have to be re-fetched for every user who views them.&lt;/li&gt;
&lt;li style=&quot;line-height: 1.35em; margin-bottom: 0.02em; margin-top: 0.02em;&quot;&gt;to enable controlled access to the web for users behind a firewall.&lt;/li&gt;
&lt;li style=&quot;line-height: 1.35em; margin-bottom: 0.02em; margin-top: 0.02em;&quot;&gt;to filter or transform web content.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 style=&quot;background-color: white; color: #535252; font-family: Tahoma, Verdana, Helvetica, sans-serif;&quot;&gt;
&lt;a href=&quot;http://draft.blogger.com/blogger.g?blogID=7813956266500130511&quot; id=&quot;Reverse_Proxies&quot;&gt;Reverse Proxies&lt;/a&gt;&amp;nbsp;&lt;a href=&quot;http://www.askapache.com/web-hosting/reverse-proxy-apache.html#toc&quot; style=&quot;color: #005fa9; text-decoration: none;&quot;&gt;^&lt;/a&gt;&lt;/h2&gt;
&lt;div style=&quot;background-color: white; color: #535252; font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: 13px;&quot;&gt;
A reverse proxy is a gateway for servers, and enables one web server to provide content from another transparently. As with a standard proxy, a reverse proxy may serve to improve performance of the web by caching; this is a simple way to mirror a website. But the most common reason to run a reverse proxy is to enable controlled access from the Web at large to servers behind a firewall.&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #535252; font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: 13px;&quot;&gt;
The proxied server may be a webserver itself, or it may be an application server using a different protocol, or an application server with just rudimentary HTTP that needs to be shielded from the web at large. Since 2004, reverse proxying has been the preferred method of deploying JAVA/Tomcat applications on the Web, replacing the old mod_jk (itself a special-purpose reverse proxy module).&lt;/div&gt;
&lt;h2 style=&quot;background-color: white; color: #535252; font-family: Tahoma, Verdana, Helvetica, sans-serif;&quot;&gt;
&lt;a href=&quot;http://draft.blogger.com/blogger.g?blogID=7813956266500130511&quot; id=&quot;Proxying_Apache&quot;&gt;Proxying with Apache&lt;/a&gt;&amp;nbsp;&lt;a href=&quot;http://www.askapache.com/web-hosting/reverse-proxy-apache.html#toc&quot; style=&quot;color: #005fa9; text-decoration: none;&quot;&gt;^&lt;/a&gt;&lt;/h2&gt;
&lt;div style=&quot;background-color: white; color: #535252; font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: 13px;&quot;&gt;
The standard Apache module mod_proxy supports both types of proxy operation. Under Apache 1.x, mod_proxy only supported HTTP/1.0, but from Apache 2.0, it supports HTTP/1.1. This distinction is particularly important in a proxy, because one of the most significant changes between the two protocol versions is that HTTP/1.1 introduces rich new cache control mechanisms.&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #535252; font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: 13px;&quot;&gt;
This article deals with running a reverse proxy with Apache 2. Users of earlier versions of Apache are encouraged to upgrade and take advantage of the altogether richer architecture and improved application support. At the time of writing, the reason most commonly cited for not upgrading is difficulties running PHP on Apache 2. I cannot speak from personal experience, but several well-informed sources tell me the difficulty lies with non-thread-safe code in PHP, and that it works well with Apache 2 if it is built with the non-threaded Prefork MPM.&lt;/div&gt;
&lt;h3 style=&quot;background-color: white; color: #535252; font-family: Tahoma, Verdana, Helvetica, sans-serif;&quot;&gt;
&lt;a href=&quot;http://draft.blogger.com/blogger.g?blogID=7813956266500130511&quot; id=&quot;Apache_Proxy_Modules&quot;&gt;The Apache Proxy Modules&lt;/a&gt;&amp;nbsp;&lt;a href=&quot;http://www.askapache.com/web-hosting/reverse-proxy-apache.html#toc&quot; style=&quot;color: #005fa9; text-decoration: none;&quot;&gt;^&lt;/a&gt;&lt;/h3&gt;
&lt;div style=&quot;background-color: white; color: #535252; font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: 13px;&quot;&gt;
So far, we have spoken loosely of mod_proxy. However, it&#39;s a little more complicated than that. In keeping with Apache&#39;s modular architecture, mod_proxy is itself modular, and a typical proxy server will need to enable several modules. Those relevant to proxying and this article include:&lt;/div&gt;
&lt;ul style=&quot;background-color: white; color: #535252; font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: 13px; margin-bottom: 1.5em; margin-left: 2em;&quot;&gt;
&lt;li style=&quot;line-height: 1.35em; margin-bottom: 0.02em; margin-top: 0.02em;&quot;&gt;mod_proxy: The core module deals with proxy infrastructure and configuration and managing a proxy request.&lt;/li&gt;
&lt;li style=&quot;line-height: 1.35em; margin-bottom: 0.02em; margin-top: 0.02em;&quot;&gt;mod_proxy_http: This handles fetching documents with HTTP and HTTPS.&lt;/li&gt;
&lt;li style=&quot;line-height: 1.35em; margin-bottom: 0.02em; margin-top: 0.02em;&quot;&gt;mod_proxy_ftp: This handles fetching documents with FTP.&lt;/li&gt;
&lt;li style=&quot;line-height: 1.35em; margin-bottom: 0.02em; margin-top: 0.02em;&quot;&gt;mod_proxy_connect: This handles the CONNECT method for secure (SSL) tunneling.&lt;/li&gt;
&lt;li style=&quot;line-height: 1.35em; margin-bottom: 0.02em; margin-top: 0.02em;&quot;&gt;mod_proxy_ajp: This handles the AJP protocol for Tomcat and similar backend servers.&lt;/li&gt;
&lt;li style=&quot;line-height: 1.35em; margin-bottom: 0.02em; margin-top: 0.02em;&quot;&gt;mod_proxy_balancer implements clustering and load-balancing over multiple backends.&lt;/li&gt;
&lt;li style=&quot;line-height: 1.35em; margin-bottom: 0.02em; margin-top: 0.02em;&quot;&gt;mod_cache, mod_disk_cache, mod_mem_cache: These deal with managing a document cache. To enable caching requires mod_cache and one or both of disk_cache and mem_cache.&lt;/li&gt;
&lt;li style=&quot;line-height: 1.35em; margin-bottom: 0.02em; margin-top: 0.02em;&quot;&gt;mod_proxy_html: This rewrites HTML links into a proxy&#39;s address space.&lt;/li&gt;
&lt;li style=&quot;line-height: 1.35em; margin-bottom: 0.02em; margin-top: 0.02em;&quot;&gt;mod_headers: This modifies HTTP request and response headers.&lt;/li&gt;
&lt;li style=&quot;line-height: 1.35em; margin-bottom: 0.02em; margin-top: 0.02em;&quot;&gt;mod_deflate: Negotiates compression with clients and backends.&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;background-color: white; color: #535252; font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: 13px;&quot;&gt;
Having mentioned the modules, I&#39;m going to ignore caching for the remainder of this article. You may want to add it if you are concerned about the load on your network or origin servers, but the details are outside the scope of this article. I&#39;m also going to ignore all non-HTTP protocols, and load balancing.&lt;/div&gt;
&lt;h3 style=&quot;background-color: white; color: #535252; font-family: Tahoma, Verdana, Helvetica, sans-serif;&quot;&gt;
&lt;a href=&quot;http://draft.blogger.com/blogger.g?blogID=7813956266500130511&quot; id=&quot;Building_Apache_Proxying&quot;&gt;Building Apache for Proxying&lt;/a&gt;&amp;nbsp;&lt;a href=&quot;http://www.askapache.com/web-hosting/reverse-proxy-apache.html#toc&quot; style=&quot;color: #005fa9; text-decoration: none;&quot;&gt;^&lt;/a&gt;&lt;/h3&gt;
&lt;div style=&quot;background-color: white; color: #535252; font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: 13px;&quot;&gt;
With the exception of mod_proxy_html, the above are all included in the core Apache distribution. They can easily be enabled in the Apache build process. For example:&lt;/div&gt;
&lt;pre style=&quot;background-attachment: scroll; background-clip: initial; background-color: white; background-image: none; background-origin: initial; background-position: 0px 0px; background-repeat: repeat repeat; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(170, 170, 170); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(170, 170, 170); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(170, 170, 170); border-top-style: solid; border-top-width: 1px; font-family: Terminus, Consolas, Profont, &#39;Andale Mono&#39;, Monaco, Inconsolata, Inconsolata-g, Unifont, Lime, &#39;ClearlyU PUA&#39;, Clean, &#39;DejaVu Sans&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Lucida Console&#39;, &#39;Bitstream Vera Sans Mono&#39;, Freemono, &#39;Liberation Mono&#39;, Dina, Anka, &#39;Droid Sans Mono&#39;, &#39;Anonymous Pro&#39;, &#39;Proggy fonts&#39;, &#39;Envy Code R&#39;, Gamow, Courier, &#39;Courier New&#39;, Terminal, monospace; font-size: 13px; margin-bottom: 2em; margin-right: auto; margin-top: 1em; max-width: 97%; min-width: 50%; overflow-x: auto; overflow-y: auto; padding-bottom: 0.5em; padding-left: 1em; padding-right: 0.1em; padding-top: 0.5em; white-space: pre-wrap;&quot;&gt;$ ./configure --enable-so --enable-mods-shared=&quot;proxy \
proxy_http proxy_ftp proxy_connect headers&quot;
$ make
# make install
&lt;/pre&gt;
&lt;div style=&quot;background-color: white; color: #535252; font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: 13px;&quot;&gt;
Of course, you may want other build options too, and you could just as well build the modules as static.&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #535252; font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: 13px;&quot;&gt;
If you are adding proxying to an existing installation, you should use apxs instead:&lt;/div&gt;
&lt;pre class=&quot;odd&quot; style=&quot;background-attachment: scroll; background-clip: initial; background-color: white; background-image: none; background-origin: initial; background-position: 0px 0px; background-repeat: repeat repeat; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(170, 170, 170); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(170, 170, 170); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(170, 170, 170); border-top-style: solid; border-top-width: 1px; font-family: Terminus, Consolas, Profont, &#39;Andale Mono&#39;, Monaco, Inconsolata, Inconsolata-g, Unifont, Lime, &#39;ClearlyU PUA&#39;, Clean, &#39;DejaVu Sans&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Lucida Console&#39;, &#39;Bitstream Vera Sans Mono&#39;, Freemono, &#39;Liberation Mono&#39;, Dina, Anka, &#39;Droid Sans Mono&#39;, &#39;Anonymous Pro&#39;, &#39;Proggy fonts&#39;, &#39;Envy Code R&#39;, Gamow, Courier, &#39;Courier New&#39;, Terminal, monospace; font-size: 13px; margin-bottom: 2em; margin-right: auto; margin-top: 1em; max-width: 97%; min-width: 50%; overflow-x: auto; overflow-y: auto; padding-bottom: 0.5em; padding-left: 1em; padding-right: 0.1em; padding-top: 0.5em; white-space: pre-wrap;&quot;&gt;# apxs -c -i [module-name].c
noting that mod_proxy itself is in two source files
(mod_proxy.c and proxy_util.c).
&lt;/pre&gt;
&lt;div style=&quot;background-color: white; color: #535252; font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: 13px;&quot;&gt;
This leaves mod_proxy_html, which is not included in the core distribution. mod_proxy_html is a third-party module, and requires a third-party library libxml2. At the time of writing, libxml2 is installed as standard or packaged for most operating systems. If you don&#39;t have it, you can download it from xmlsoft.org and install it yourself. For the purposes of this article, we&#39;ll assume libxml2 is installed as /usr/lib/libxml2.so, with headers in /usr/include/libxml2/libxml/.&lt;/div&gt;
&lt;ol style=&quot;background-color: white; color: #535252; font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: 13px; margin-bottom: 1.5em; margin-left: 2em;&quot;&gt;
&lt;li style=&quot;line-height: 1.35em; margin-bottom: 0.02em; margin-top: 0.02em;&quot;&gt;Check libxml2 is installed. If you have a version older than 2.5.10, then upgrade - there&#39;s a bug in earlier versions that can, in some particular cases, severely affect performance.&lt;/li&gt;
&lt;li style=&quot;line-height: 1.35em; margin-bottom: 0.02em; margin-top: 0.02em;&quot;&gt;Download mod_proxy_html.c from http://apache.webthing.com/&lt;/li&gt;
&lt;li style=&quot;line-height: 1.35em; margin-bottom: 0.02em; margin-top: 0.02em;&quot;&gt;Build mod_proxy_html with apxs:&lt;/li&gt;
&lt;/ol&gt;
&lt;pre style=&quot;background-attachment: scroll; background-clip: initial; background-color: white; background-image: none; background-origin: initial; background-position: 0px 0px; background-repeat: repeat repeat; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(170, 170, 170); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(170, 170, 170); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(170, 170, 170); border-top-style: solid; border-top-width: 1px; font-family: Terminus, Consolas, Profont, &#39;Andale Mono&#39;, Monaco, Inconsolata, Inconsolata-g, Unifont, Lime, &#39;ClearlyU PUA&#39;, Clean, &#39;DejaVu Sans&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Lucida Console&#39;, &#39;Bitstream Vera Sans Mono&#39;, Freemono, &#39;Liberation Mono&#39;, Dina, Anka, &#39;Droid Sans Mono&#39;, &#39;Anonymous Pro&#39;, &#39;Proggy fonts&#39;, &#39;Envy Code R&#39;, Gamow, Courier, &#39;Courier New&#39;, Terminal, monospace; font-size: 13px; margin-bottom: 2em; margin-right: auto; margin-top: 1em; max-width: 97%; min-width: 50%; overflow-x: auto; overflow-y: auto; padding-bottom: 0.5em; padding-left: 1em; padding-right: 0.1em; padding-top: 0.5em; white-space: pre-wrap;&quot;&gt;# apxs -c -I/usr/include/libxml2 -i mod_proxy_html.c
&lt;/pre&gt;
&lt;h2 style=&quot;background-color: white; color: #535252; font-family: Tahoma, Verdana, Helvetica, sans-serif;&quot;&gt;
&lt;a href=&quot;http://draft.blogger.com/blogger.g?blogID=7813956266500130511&quot; id=&quot;Reverse_Proxy_Scenario&quot;&gt;A Reverse Proxy Scenario&lt;/a&gt;&amp;nbsp;&lt;a href=&quot;http://www.askapache.com/web-hosting/reverse-proxy-apache.html#toc&quot; style=&quot;color: #005fa9; text-decoration: none;&quot;&gt;^&lt;/a&gt;&lt;/h2&gt;
&lt;div style=&quot;background-color: white; color: #535252; font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: 13px;&quot;&gt;
Company example.com has a website at www.example.com, which has a public IP address and DNS entry, and can be accessed from anywhere on the Internet.&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #535252; font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: 13px;&quot;&gt;
The company also has a couple of application servers which have private IP addresses and unregistered DNS entries, and are inside the firewall. The application servers are visible within the network - including the webserver, as &quot;internal1.example.com&quot; and &quot;internal2.example.com&quot;, But because they have no public DNS entries, anyone looking at internal1.example.com from outside the company network will get a &quot;no such host&quot; error.&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #535252; font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: 13px;&quot;&gt;
A decision is taken to enable Web access to the application servers. But they should not be exposed to the Internet directly, instead they should be integrated with the webserver, so that http://www.example.com/app1/any-path-here is mapped internally to http://internal1.example.com/any-path-here and http://www.example.com/app2/other-path-here is mapped internally to http://internal2.example.com/other-path-here. This is a typical reverse-proxy situation.&lt;/div&gt;
&lt;h3 style=&quot;background-color: white; color: #535252; font-family: Tahoma, Verdana, Helvetica, sans-serif;&quot;&gt;
&lt;a href=&quot;http://draft.blogger.com/blogger.g?blogID=7813956266500130511&quot; id=&quot;Configuring_Proxy&quot;&gt;Configuring the Proxy&lt;/a&gt;&amp;nbsp;&lt;a href=&quot;http://www.askapache.com/web-hosting/reverse-proxy-apache.html#toc&quot; style=&quot;color: #005fa9; text-decoration: none;&quot;&gt;^&lt;/a&gt;&lt;/h3&gt;
&lt;div style=&quot;background-color: white; color: #535252; font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: 13px;&quot;&gt;
As with any modules, the first thing to do is to load them in httpd.conf (this is not necessary if we build them statically into Apache).&lt;/div&gt;
&lt;pre class=&quot;odd&quot; style=&quot;background-attachment: scroll; background-clip: initial; background-color: white; background-image: none; background-origin: initial; background-position: 0px 0px; background-repeat: repeat repeat; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(170, 170, 170); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(170, 170, 170); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(170, 170, 170); border-top-style: solid; border-top-width: 1px; font-family: Terminus, Consolas, Profont, &#39;Andale Mono&#39;, Monaco, Inconsolata, Inconsolata-g, Unifont, Lime, &#39;ClearlyU PUA&#39;, Clean, &#39;DejaVu Sans&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Lucida Console&#39;, &#39;Bitstream Vera Sans Mono&#39;, Freemono, &#39;Liberation Mono&#39;, Dina, Anka, &#39;Droid Sans Mono&#39;, &#39;Anonymous Pro&#39;, &#39;Proggy fonts&#39;, &#39;Envy Code R&#39;, Gamow, Courier, &#39;Courier New&#39;, Terminal, monospace; font-size: 13px; margin-bottom: 2em; margin-right: auto; margin-top: 1em; max-width: 97%; min-width: 50%; overflow-x: auto; overflow-y: auto; padding-bottom: 0.5em; padding-left: 1em; padding-right: 0.1em; padding-top: 0.5em; white-space: pre-wrap;&quot;&gt;LoadModule  proxy_module         modules/mod_proxy.so
LoadModule  proxy_http_module    modules/mod_proxy_http.so
#LoadModule proxy_ftp_module     modules/mod_proxy_ftp.so
#LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadModule  headers_module       modules/mod_headers.so
LoadModule  deflate_module       modules/mod_deflate.so
LoadFile    /usr/lib/libxml2.so
LoadModule  proxy_html_module    modules/mod_proxy_html.so
&lt;/pre&gt;
&lt;div style=&quot;background-color: white; color: #535252; font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: 13px;&quot;&gt;
For windows users this is slightly different: you&#39;ll need to load libxml2.dll rather than libxml2.so, and you&#39;ll probably need to load iconv.dll and xlib.dll as prerequisites to libxml2 (you can download them from zlatkovic.com, the same site that maintains windows binaries of libxml2). The LoadFile directive is the same.&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #535252; font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: 13px;&quot;&gt;
Of course, you may not need all the modules. Two that are not required in our typical scenario are shown commented out above.&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #535252; font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: 13px;&quot;&gt;
Having loaded the modules, we can now configure the Proxy. But before doing so, we have an important security warning:&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #535252; font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: 13px;&quot;&gt;
Do Not set &quot;ProxyRequests On&quot;. Setting ProxyRequests On turns your server into an Open Proxy. There are &#39;bots scanning the Web for open proxies. When they find you, they&#39;ll start using you to route around blocks and filters to access questionable or illegal material. At worst, they might be able to route email spam through your proxy. Your legitimate traffic will be swamped, and you&#39;ll find your server getting blocked by things like family filters.&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #535252; font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: 13px;&quot;&gt;
Of course, you may also want to run a forward proxy with appropriate security measures, but that lies outside the scope of this article. The author runs both forward and reverse proxies on the same server (but under different Virtual Hosts).&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #535252; font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: 13px;&quot;&gt;
The fundamental configuration directive to set up a reverse proxy is ProxyPass. We use it to set up proxy rules for each of the application servers:&lt;/div&gt;
&lt;pre style=&quot;background-attachment: scroll; background-clip: initial; background-color: white; background-image: none; background-origin: initial; background-position: 0px 0px; background-repeat: repeat repeat; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(170, 170, 170); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(170, 170, 170); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(170, 170, 170); border-top-style: solid; border-top-width: 1px; font-family: Terminus, Consolas, Profont, &#39;Andale Mono&#39;, Monaco, Inconsolata, Inconsolata-g, Unifont, Lime, &#39;ClearlyU PUA&#39;, Clean, &#39;DejaVu Sans&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Lucida Console&#39;, &#39;Bitstream Vera Sans Mono&#39;, Freemono, &#39;Liberation Mono&#39;, Dina, Anka, &#39;Droid Sans Mono&#39;, &#39;Anonymous Pro&#39;, &#39;Proggy fonts&#39;, &#39;Envy Code R&#39;, Gamow, Courier, &#39;Courier New&#39;, Terminal, monospace; font-size: 13px; margin-bottom: 2em; margin-right: auto; margin-top: 1em; max-width: 97%; min-width: 50%; overflow-x: auto; overflow-y: auto; padding-bottom: 0.5em; padding-left: 1em; padding-right: 0.1em; padding-top: 0.5em; white-space: pre-wrap;&quot;&gt;ProxyPass       /app1/  http://internal1.example.com/
ProxyPass       /app2/  http://internal2.example.com/
&lt;/pre&gt;
&lt;div style=&quot;background-color: white; color: #535252; font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: 13px;&quot;&gt;
Now as soon as Apache re-reads the configuration (the recommended way to do this is with &quot;apachectl graceful&quot;), proxy requests will work, so http://www.example.com/app1/some-path maps to http://internal1.example.com/some-path as required.&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #535252; font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: 13px;&quot;&gt;
However, this is not the whole story. ProxyPass just sends traffic straight through. So when the application servers generate references to themselves (or to other internal addresses), they will be passed straight through to the outside world, where they won&#39;t work.&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #535252; font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: 13px;&quot;&gt;
For example, an HTTP redirection often takes place when a user (or author) forgets a trailing slash in a URL. So the response to a request for http://www.example.com/app1/foo proxies to http://internal.example.com/foo which generates a response:&lt;/div&gt;
&lt;pre class=&quot;odd&quot; style=&quot;background-attachment: scroll; background-clip: initial; background-color: white; background-image: none; background-origin: initial; background-position: 0px 0px; background-repeat: repeat repeat; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(170, 170, 170); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(170, 170, 170); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(170, 170, 170); border-top-style: solid; border-top-width: 1px; font-family: Terminus, Consolas, Profont, &#39;Andale Mono&#39;, Monaco, Inconsolata, Inconsolata-g, Unifont, Lime, &#39;ClearlyU PUA&#39;, Clean, &#39;DejaVu Sans&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Lucida Console&#39;, &#39;Bitstream Vera Sans Mono&#39;, Freemono, &#39;Liberation Mono&#39;, Dina, Anka, &#39;Droid Sans Mono&#39;, &#39;Anonymous Pro&#39;, &#39;Proggy fonts&#39;, &#39;Envy Code R&#39;, Gamow, Courier, &#39;Courier New&#39;, Terminal, monospace; font-size: 13px; margin-bottom: 2em; margin-right: auto; margin-top: 1em; max-width: 97%; min-width: 50%; overflow-x: auto; overflow-y: auto; padding-bottom: 0.5em; padding-left: 1em; padding-right: 0.1em; padding-top: 0.5em; white-space: pre-wrap;&quot;&gt;HTTP/1.1 302 Found
Location: http://internal.example.com/foo/
(etc)
&lt;/pre&gt;
&lt;div style=&quot;background-color: white; color: #535252; font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: 13px;&quot;&gt;
But from the outside world, the net effect of this is a &quot;No such host&quot; error. The proxy needs to re-map the Location header to its own address space and return a valid URL&lt;/div&gt;
&lt;pre style=&quot;background-attachment: scroll; background-clip: initial; background-color: white; background-image: none; background-origin: initial; background-position: 0px 0px; background-repeat: repeat repeat; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(170, 170, 170); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(170, 170, 170); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(170, 170, 170); border-top-style: solid; border-top-width: 1px; font-family: Terminus, Consolas, Profont, &#39;Andale Mono&#39;, Monaco, Inconsolata, Inconsolata-g, Unifont, Lime, &#39;ClearlyU PUA&#39;, Clean, &#39;DejaVu Sans&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Lucida Console&#39;, &#39;Bitstream Vera Sans Mono&#39;, Freemono, &#39;Liberation Mono&#39;, Dina, Anka, &#39;Droid Sans Mono&#39;, &#39;Anonymous Pro&#39;, &#39;Proggy fonts&#39;, &#39;Envy Code R&#39;, Gamow, Courier, &#39;Courier New&#39;, Terminal, monospace; font-size: 13px; margin-bottom: 2em; margin-right: auto; margin-top: 1em; max-width: 97%; min-width: 50%; overflow-x: auto; overflow-y: auto; padding-bottom: 0.5em; padding-left: 1em; padding-right: 0.1em; padding-top: 0.5em; white-space: pre-wrap;&quot;&gt;HTTP/1.1 302 Found
Location: http://www.example.com/app1/foo/
&lt;/pre&gt;
&lt;div style=&quot;background-color: white; color: #535252; font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: 13px;&quot;&gt;
The command to enable such rewrites in the HTTP Headers is ProxyPassReverse. The Apache documentation suggests the form:&lt;/div&gt;
&lt;pre class=&quot;odd&quot; style=&quot;background-attachment: scroll; background-clip: initial; background-color: white; background-image: none; background-origin: initial; background-position: 0px 0px; background-repeat: repeat repeat; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(170, 170, 170); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(170, 170, 170); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(170, 170, 170); border-top-style: solid; border-top-width: 1px; font-family: Terminus, Consolas, Profont, &#39;Andale Mono&#39;, Monaco, Inconsolata, Inconsolata-g, Unifont, Lime, &#39;ClearlyU PUA&#39;, Clean, &#39;DejaVu Sans&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Lucida Console&#39;, &#39;Bitstream Vera Sans Mono&#39;, Freemono, &#39;Liberation Mono&#39;, Dina, Anka, &#39;Droid Sans Mono&#39;, &#39;Anonymous Pro&#39;, &#39;Proggy fonts&#39;, &#39;Envy Code R&#39;, Gamow, Courier, &#39;Courier New&#39;, Terminal, monospace; font-size: 13px; margin-bottom: 2em; margin-right: auto; margin-top: 1em; max-width: 97%; min-width: 50%; overflow-x: auto; overflow-y: auto; padding-bottom: 0.5em; padding-left: 1em; padding-right: 0.1em; padding-top: 0.5em; white-space: pre-wrap;&quot;&gt;&amp;nbsp;
ProxyPassReverse /app1/ http://internal1.example.com/
ProxyPassReverse /app2/ http://internal2.example.com/
&lt;/pre&gt;
&lt;div style=&quot;background-color: white; color: #535252; font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: 13px;&quot;&gt;
However, there is a slightly more complex alternative form that I recommend as more robust:&lt;/div&gt;
&lt;pre style=&quot;background-attachment: scroll; background-clip: initial; background-color: white; background-image: none; background-origin: initial; background-position: 0px 0px; background-repeat: repeat repeat; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(170, 170, 170); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(170, 170, 170); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(170, 170, 170); border-top-style: solid; border-top-width: 1px; font-family: Terminus, Consolas, Profont, &#39;Andale Mono&#39;, Monaco, Inconsolata, Inconsolata-g, Unifont, Lime, &#39;ClearlyU PUA&#39;, Clean, &#39;DejaVu Sans&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Lucida Console&#39;, &#39;Bitstream Vera Sans Mono&#39;, Freemono, &#39;Liberation Mono&#39;, Dina, Anka, &#39;Droid Sans Mono&#39;, &#39;Anonymous Pro&#39;, &#39;Proggy fonts&#39;, &#39;Envy Code R&#39;, Gamow, Courier, &#39;Courier New&#39;, Terminal, monospace; font-size: 13px; margin-bottom: 2em; margin-right: auto; margin-top: 1em; max-width: 97%; min-width: 50%; overflow-x: auto; overflow-y: auto; padding-bottom: 0.5em; padding-left: 1em; padding-right: 0.1em; padding-top: 0.5em; white-space: pre-wrap;&quot;&gt;&lt;location app1=&quot;&quot;&gt;
ProxyPassReverse /
&lt;/location&gt;
&lt;location app2=&quot;&quot;&gt;
ProxyPassReverse /
&lt;/location&gt;
&lt;/pre&gt;
&lt;div style=&quot;background-color: white; color: #535252; font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: 13px;&quot;&gt;
The reason for recommending this is that a problem arises with some application servers. Suppose for example we have a redirect:&lt;/div&gt;
&lt;pre class=&quot;odd&quot; style=&quot;background-attachment: scroll; background-clip: initial; background-color: white; background-image: none; background-origin: initial; background-position: 0px 0px; background-repeat: repeat repeat; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(170, 170, 170); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(170, 170, 170); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(170, 170, 170); border-top-style: solid; border-top-width: 1px; font-family: Terminus, Consolas, Profont, &#39;Andale Mono&#39;, Monaco, Inconsolata, Inconsolata-g, Unifont, Lime, &#39;ClearlyU PUA&#39;, Clean, &#39;DejaVu Sans&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Lucida Console&#39;, &#39;Bitstream Vera Sans Mono&#39;, Freemono, &#39;Liberation Mono&#39;, Dina, Anka, &#39;Droid Sans Mono&#39;, &#39;Anonymous Pro&#39;, &#39;Proggy fonts&#39;, &#39;Envy Code R&#39;, Gamow, Courier, &#39;Courier New&#39;, Terminal, monospace; font-size: 13px; margin-bottom: 2em; margin-right: auto; margin-top: 1em; max-width: 97%; min-width: 50%; overflow-x: auto; overflow-y: auto; padding-bottom: 0.5em; padding-left: 1em; padding-right: 0.1em; padding-top: 0.5em; white-space: pre-wrap;&quot;&gt;HTTP/1.1 302 Found
Location: /some/path/to/file.html
&lt;/pre&gt;
&lt;div style=&quot;background-color: white; color: #535252; font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: 13px;&quot;&gt;
This is a violation of the HTTP protocol and so should never happen: HTTP only permits full URLs in Location headers. However, it is also a source of much confusion, not least because the CGI spec has a similar Location header with different semantics where relative paths are allowed. There are a lot of broken servers out there! In this instance, the first form of ProxyPassReverse will return the incorrect response&lt;/div&gt;
&lt;pre style=&quot;background-attachment: scroll; background-clip: initial; background-color: white; background-image: none; background-origin: initial; background-position: 0px 0px; background-repeat: repeat repeat; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(170, 170, 170); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(170, 170, 170); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(170, 170, 170); border-top-style: solid; border-top-width: 1px; font-family: Terminus, Consolas, Profont, &#39;Andale Mono&#39;, Monaco, Inconsolata, Inconsolata-g, Unifont, Lime, &#39;ClearlyU PUA&#39;, Clean, &#39;DejaVu Sans&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Lucida Console&#39;, &#39;Bitstream Vera Sans Mono&#39;, Freemono, &#39;Liberation Mono&#39;, Dina, Anka, &#39;Droid Sans Mono&#39;, &#39;Anonymous Pro&#39;, &#39;Proggy fonts&#39;, &#39;Envy Code R&#39;, Gamow, Courier, &#39;Courier New&#39;, Terminal, monospace; font-size: 13px; margin-bottom: 2em; margin-right: auto; margin-top: 1em; max-width: 97%; min-width: 50%; overflow-x: auto; overflow-y: auto; padding-bottom: 0.5em; padding-left: 1em; padding-right: 0.1em; padding-top: 0.5em; white-space: pre-wrap;&quot;&gt;HTTP/1.1 302 Found
Location: /some/path/to/file.html
&lt;/pre&gt;
&lt;div style=&quot;background-color: white; color: #535252; font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: 13px;&quot;&gt;
which, even allowing for error-correcting browsers, is outside the Proxy&#39;s address space and won&#39;t work. The second form fixes this to&lt;/div&gt;
&lt;pre class=&quot;odd&quot; style=&quot;background-attachment: scroll; background-clip: initial; background-color: white; background-image: none; background-origin: initial; background-position: 0px 0px; background-repeat: repeat repeat; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(170, 170, 170); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(170, 170, 170); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(170, 170, 170); border-top-style: solid; border-top-width: 1px; font-family: Terminus, Consolas, Profont, &#39;Andale Mono&#39;, Monaco, Inconsolata, Inconsolata-g, Unifont, Lime, &#39;ClearlyU PUA&#39;, Clean, &#39;DejaVu Sans&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Lucida Console&#39;, &#39;Bitstream Vera Sans Mono&#39;, Freemono, &#39;Liberation Mono&#39;, Dina, Anka, &#39;Droid Sans Mono&#39;, &#39;Anonymous Pro&#39;, &#39;Proggy fonts&#39;, &#39;Envy Code R&#39;, Gamow, Courier, &#39;Courier New&#39;, Terminal, monospace; font-size: 13px; margin-bottom: 2em; margin-right: auto; margin-top: 1em; max-width: 97%; min-width: 50%; overflow-x: auto; overflow-y: auto; padding-bottom: 0.5em; padding-left: 1em; padding-right: 0.1em; padding-top: 0.5em; white-space: pre-wrap;&quot;&gt;HTTP/1.1 302 Found
Location: /app2/some/path/to/file.html
&lt;/pre&gt;
&lt;div style=&quot;background-color: white; color: #535252; font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: 13px;&quot;&gt;
which is still broken, but will at least work in error-correcting browsers. Most browsers will deal with this.&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #535252; font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: 13px;&quot;&gt;
If your backend server uses cookies, you may also need the ProxyPassReverseCookiePath and ProxyPassReverseCookieDomain directives. These are similar to ProxyPassReverse, but deal with the different form of cookie headers. These require mod_proxy from Apache 2.2 (recommended), or a patched version of 2.0.&lt;/div&gt;
&lt;h2 style=&quot;background-color: white; color: #535252; font-family: Tahoma, Verdana, Helvetica, sans-serif;&quot;&gt;
&lt;a href=&quot;http://draft.blogger.com/blogger.g?blogID=7813956266500130511&quot; id=&quot;Fixing_HTML_Links&quot;&gt;Fixing HTML Links&lt;/a&gt;&amp;nbsp;&lt;a href=&quot;http://www.askapache.com/web-hosting/reverse-proxy-apache.html#toc&quot; style=&quot;color: #005fa9; text-decoration: none;&quot;&gt;^&lt;/a&gt;&lt;/h2&gt;
&lt;div style=&quot;background-color: white; color: #535252; font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: 13px;&quot;&gt;
As we have seen, ProxyPassReverse remaps URLs in the HTTP headers to ensure they work from outside the company network. There is, however, a separate problem when links appear in HTML pages served. Consider the following cases:&lt;/div&gt;
&lt;ol style=&quot;background-color: white; color: #535252; font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: 13px; margin-bottom: 1.5em; margin-left: 2em;&quot;&gt;
&lt;li style=&quot;line-height: 1.35em; margin-bottom: 0.02em; margin-top: 0.02em;&quot;&gt;This link will be resolved by the browser and will work correctly.&lt;/li&gt;
&lt;li style=&quot;line-height: 1.35em; margin-bottom: 0.02em; margin-top: 0.02em;&quot;&gt;This link will be resolved by the browser to http://www.example.com/otherfile.html, which is incorrect.&lt;/li&gt;
&lt;li style=&quot;line-height: 1.35em; margin-bottom: 0.02em; margin-top: 0.02em;&quot;&gt;This link will resolve to &quot;no such host&quot; for the browser.&lt;/li&gt;
&lt;/ol&gt;
&lt;div style=&quot;background-color: white; color: #535252; font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: 13px;&quot;&gt;
The same problem of course applies to included content such as images, stylesheets, scripts or applets, and other contexts where URLs occur in HTML.&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #535252; font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: 13px;&quot;&gt;
To fix this requires us to parse the HTML and rewrite the links. This is the purpose of mod_proxy_html. It works as an output filter, parsing the HTML and rewriting links as it is served. Two configuration directives are required to set it up:&lt;/div&gt;
&lt;ul style=&quot;background-color: white; color: #535252; font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: 13px; margin-bottom: 1.5em; margin-left: 2em;&quot;&gt;
&lt;li style=&quot;line-height: 1.35em; margin-bottom: 0.02em; margin-top: 0.02em;&quot;&gt;SetOutputFilter proxy-html This simply inserts the filter, to enable ProxyHTMLURLMap&lt;/li&gt;
&lt;li style=&quot;line-height: 1.35em; margin-bottom: 0.02em; margin-top: 0.02em;&quot;&gt;ProxyHTMLURLMap from-pattern to-pattern [flags] In its basic form, this has a similar purpose and semantics to ProxyPassReverse. Additionally, an extended form is available to enable search-and-replace rewriting of URLs within Scripts and Stylesheets.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 style=&quot;background-color: white; color: #535252; font-family: Tahoma, Verdana, Helvetica, sans-serif;&quot;&gt;
&lt;a href=&quot;http://draft.blogger.com/blogger.g?blogID=7813956266500130511&quot; id=&quot;How_it_works&quot;&gt;How it works&lt;/a&gt;&amp;nbsp;&lt;a href=&quot;http://www.askapache.com/web-hosting/reverse-proxy-apache.html#toc&quot; style=&quot;color: #005fa9; text-decoration: none;&quot;&gt;^&lt;/a&gt;&lt;/h3&gt;
&lt;div style=&quot;background-color: white; color: #535252; font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: 13px;&quot;&gt;
mod_proxy_html is based on a SAX parser: specifically the HTMLparser module from libxml2 running in SAX mode (any other parse mode would of course be very much slower, especially for larger documents). It has full knowledge of all URI attributes that can occur in HTML 4 and XHTML 1. Whenever a URL is encountered, it is matched against applicable ProxyHTMLURLMap directives. If it starts with any from-pattern, that will be rewritten to the to-pattern. Rules are applied in the reverse order to their appearance in httpd.conf, and matching stops as soon as a match is found.&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #535252; font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: 13px;&quot;&gt;
Here&#39;s how we set up a reverse proxy for HTML. Firstly, full links to the internal servers should be rewritten regardless of where they arise, so we have:&lt;/div&gt;
&lt;pre style=&quot;background-attachment: scroll; background-clip: initial; background-color: white; background-image: none; background-origin: initial; background-position: 0px 0px; background-repeat: repeat repeat; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(170, 170, 170); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(170, 170, 170); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(170, 170, 170); border-top-style: solid; border-top-width: 1px; font-family: Terminus, Consolas, Profont, &#39;Andale Mono&#39;, Monaco, Inconsolata, Inconsolata-g, Unifont, Lime, &#39;ClearlyU PUA&#39;, Clean, &#39;DejaVu Sans&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Lucida Console&#39;, &#39;Bitstream Vera Sans Mono&#39;, Freemono, &#39;Liberation Mono&#39;, Dina, Anka, &#39;Droid Sans Mono&#39;, &#39;Anonymous Pro&#39;, &#39;Proggy fonts&#39;, &#39;Envy Code R&#39;, Gamow, Courier, &#39;Courier New&#39;, Terminal, monospace; font-size: 13px; margin-bottom: 2em; margin-right: auto; margin-top: 1em; max-width: 97%; min-width: 50%; overflow-x: auto; overflow-y: auto; padding-bottom: 0.5em; padding-left: 1em; padding-right: 0.1em; padding-top: 0.5em; white-space: pre-wrap;&quot;&gt;ProxyHTMLURLMap http://internal1.example.com /app1
ProxyHTMLURLMap http://internal2.example.com /app2
&lt;/pre&gt;
&lt;div style=&quot;background-color: white; color: #535252; font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: 13px;&quot;&gt;
Note that in this instance we omitted the &quot;trailing&quot; slash. Since the matching logic is starts-with, we use the minimal matching pattern. We have now globally fixed case 3 above.&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #535252; font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: 13px;&quot;&gt;
Case 2 above requires a little more care. Because the link doesn&#39;t include the hostname, the rewrite rule must be context-sensitive. As with ProxyPassReverse above, we deal with that using&amp;nbsp;&lt;code style=&quot;font-family: Terminus, Consolas, Profont, &#39;Andale Mono&#39;, Monaco, Inconsolata, Inconsolata-g, Unifont, Lime, &#39;ClearlyU PUA&#39;, Clean, &#39;DejaVu Sans&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Lucida Console&#39;, &#39;Bitstream Vera Sans Mono&#39;, Freemono, &#39;Liberation Mono&#39;, Dina, Anka, &#39;Droid Sans Mono&#39;, &#39;Anonymous Pro&#39;, &#39;Proggy fonts&#39;, &#39;Envy Code R&#39;, Gamow, Courier, &#39;Courier New&#39;, Terminal, monospace; word-spacing: normal;&quot;&gt;&lt;location&gt;&lt;/location&gt;&lt;/code&gt;&lt;/div&gt;
&lt;pre class=&quot;odd&quot; style=&quot;background-attachment: scroll; background-clip: initial; background-color: white; background-image: none; background-origin: initial; background-position: 0px 0px; background-repeat: repeat repeat; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(170, 170, 170); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(170, 170, 170); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(170, 170, 170); border-top-style: solid; border-top-width: 1px; font-family: Terminus, Consolas, Profont, &#39;Andale Mono&#39;, Monaco, Inconsolata, Inconsolata-g, Unifont, Lime, &#39;ClearlyU PUA&#39;, Clean, &#39;DejaVu Sans&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Lucida Console&#39;, &#39;Bitstream Vera Sans Mono&#39;, Freemono, &#39;Liberation Mono&#39;, Dina, Anka, &#39;Droid Sans Mono&#39;, &#39;Anonymous Pro&#39;, &#39;Proggy fonts&#39;, &#39;Envy Code R&#39;, Gamow, Courier, &#39;Courier New&#39;, Terminal, monospace; font-size: 13px; margin-bottom: 2em; margin-right: auto; margin-top: 1em; max-width: 97%; min-width: 50%; overflow-x: auto; overflow-y: auto; padding-bottom: 0.5em; padding-left: 1em; padding-right: 0.1em; padding-top: 0.5em; white-space: pre-wrap;&quot;&gt;&lt;location app1=&quot;&quot;&gt;
ProxyHTMLURLMap / /app1/
&lt;/location&gt;
&lt;location app2=&quot;&quot;&gt;
ProxyHTMLURLMap / /app2/
&lt;/location&gt;
&lt;/pre&gt;
&lt;h3 style=&quot;background-color: white; color: #535252; font-family: Tahoma, Verdana, Helvetica, sans-serif;&quot;&gt;
&lt;a href=&quot;http://draft.blogger.com/blogger.g?blogID=7813956266500130511&quot; id=&quot;Debugging_Proxy_Configuration&quot;&gt;Debugging your Proxy Configuration&lt;/a&gt;&amp;nbsp;&lt;a href=&quot;http://www.askapache.com/web-hosting/reverse-proxy-apache.html#toc&quot; style=&quot;color: #005fa9; text-decoration: none;&quot;&gt;^&lt;/a&gt;&lt;/h3&gt;
&lt;div style=&quot;background-color: white; color: #535252; font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: 13px;&quot;&gt;
The above is a simple case taken from mod_proxy_html version 1. With the more complex URLmapping and rewriting enabled by Version 2, you may need a bit of help setting up a complex ruleset, perhaps involving a series of complex regexps, chained anc blocking rules, etc. To help with setting up and troubleshooting your rulesets, mod_proxy_html 2 provides a &quot;debug&quot; mode, in which all the &#39;interesting&#39; things it does are written to the Apache error log. To analyse and fix your rulesets, set&lt;/div&gt;
&lt;pre style=&quot;background-attachment: scroll; background-clip: initial; background-color: white; background-image: none; background-origin: initial; background-position: 0px 0px; background-repeat: repeat repeat; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(170, 170, 170); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(170, 170, 170); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(170, 170, 170); border-top-style: solid; border-top-width: 1px; font-family: Terminus, Consolas, Profont, &#39;Andale Mono&#39;, Monaco, Inconsolata, Inconsolata-g, Unifont, Lime, &#39;ClearlyU PUA&#39;, Clean, &#39;DejaVu Sans&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Lucida Console&#39;, &#39;Bitstream Vera Sans Mono&#39;, Freemono, &#39;Liberation Mono&#39;, Dina, Anka, &#39;Droid Sans Mono&#39;, &#39;Anonymous Pro&#39;, &#39;Proggy fonts&#39;, &#39;Envy Code R&#39;, Gamow, Courier, &#39;Courier New&#39;, Terminal, monospace; font-size: 13px; margin-bottom: 2em; margin-right: auto; margin-top: 1em; max-width: 97%; min-width: 50%; overflow-x: auto; overflow-y: auto; padding-bottom: 0.5em; padding-left: 1em; padding-right: 0.1em; padding-top: 0.5em; white-space: pre-wrap;&quot;&gt;ProxyHTMLLogVerbose On
LogLevel Info   (or LogLevel Debug)
&lt;/pre&gt;
&lt;div style=&quot;background-color: white; color: #535252; font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: 13px;&quot;&gt;
Now run your testcases through your rulesets, and examine the apache error log for details of exactly how it was processed.&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #535252; font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: 13px;&quot;&gt;
Do not leave ProxyHTMLLogVerbose On for normal use. Although the effect is marginal, it is an overhead.&lt;/div&gt;
&lt;h3 style=&quot;background-color: white; color: #535252; font-family: Tahoma, Verdana, Helvetica, sans-serif;&quot;&gt;
&lt;a href=&quot;http://draft.blogger.com/blogger.g?blogID=7813956266500130511&quot; id=&quot;Extended_URL_Mapping&quot;&gt;Extended URL Mapping&lt;/a&gt;&amp;nbsp;&lt;a href=&quot;http://www.askapache.com/web-hosting/reverse-proxy-apache.html#toc&quot; style=&quot;color: #005fa9; text-decoration: none;&quot;&gt;^&lt;/a&gt;&lt;/h3&gt;
&lt;div style=&quot;background-color: white; color: #535252; font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: 13px;&quot;&gt;
The previous section sets up remapping of HTML URLs, but leaves any URL encountered in a Stylesheet or Script untouched. mod_proxy_html doesn&#39;t parse Javascript or CSS, so dealing with URLs in them requires text-based search-and-replace. This is enabled by the directive ProxyHTMLExtended On.&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #535252; font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: 13px;&quot;&gt;
Because the extended mode is text-based, it can no longer guarantee to match exact URLs. It&#39;s up to you to devise matching rules that can pick out URLs, just as if you were writing an old-fashioned Perl or PHP regexp-based filter (though of course it&#39;s still massively more efficient than performing search-and-replace on an entire document in-memory). To help with this, ProxyHTMLExtended supports both simple text-based and regular expression search-and-replace, according to the flags. You can also use the flags to specify rules separately for HTML links, scripting events, and embedded scripts and stylesheets.&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #535252; font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: 13px;&quot;&gt;
A second key consideration with extended URL mapping is that whereas an HTML link contains exactly one URL, a script or stylesheet may contain many. So instead of stopping after a successful match, the processor will apply all applicable mapping rules. This can be stopped with the L (last) flag.&lt;/div&gt;
&lt;h3 style=&quot;background-color: white; color: #535252; font-family: Tahoma, Verdana, Helvetica, sans-serif;&quot;&gt;
&lt;a href=&quot;http://draft.blogger.com/blogger.g?blogID=7813956266500130511&quot; id=&quot;Dealing_multimedia_content&quot;&gt;Dealing with multimedia content&lt;/a&gt;&amp;nbsp;&lt;a href=&quot;http://www.askapache.com/web-hosting/reverse-proxy-apache.html#toc&quot; style=&quot;color: #005fa9; text-decoration: none;&quot;&gt;^&lt;/a&gt;&lt;/h3&gt;
&lt;div style=&quot;background-color: white; color: #535252; font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: 13px;&quot;&gt;
We just set up a proxy to parse and where necessary correct HTML. But of course, the web isn&#39;t just HTML. Surely feeding non-HTML content through an HTML parser is at best inefficient, if not totally broken?&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #535252; font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: 13px;&quot;&gt;
Yes indeed. mod_proxy_html deals with that by checking the Content-Type header, and removing itself from the processing chain when a document is not HTML (text/html) or XHTML (application/xhtml+xml). This happens in the filter initialisation phase, before any data are processed by the filter.&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #535252; font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: 13px;&quot;&gt;
But that still leaves a problem. Consider compressed HTML:&lt;/div&gt;
&lt;pre class=&quot;odd&quot; style=&quot;background-attachment: scroll; background-clip: initial; background-color: white; background-image: none; background-origin: initial; background-position: 0px 0px; background-repeat: repeat repeat; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(170, 170, 170); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(170, 170, 170); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(170, 170, 170); border-top-style: solid; border-top-width: 1px; font-family: Terminus, Consolas, Profont, &#39;Andale Mono&#39;, Monaco, Inconsolata, Inconsolata-g, Unifont, Lime, &#39;ClearlyU PUA&#39;, Clean, &#39;DejaVu Sans&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Lucida Console&#39;, &#39;Bitstream Vera Sans Mono&#39;, Freemono, &#39;Liberation Mono&#39;, Dina, Anka, &#39;Droid Sans Mono&#39;, &#39;Anonymous Pro&#39;, &#39;Proggy fonts&#39;, &#39;Envy Code R&#39;, Gamow, Courier, &#39;Courier New&#39;, Terminal, monospace; font-size: 13px; margin-bottom: 2em; margin-right: auto; margin-top: 1em; max-width: 97%; min-width: 50%; overflow-x: auto; overflow-y: auto; padding-bottom: 0.5em; padding-left: 1em; padding-right: 0.1em; padding-top: 0.5em; white-space: pre-wrap;&quot;&gt;Content-Type: text/html
Content-Encoding: gzip
&lt;/pre&gt;
&lt;div style=&quot;background-color: white; color: #535252; font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: 13px;&quot;&gt;
Feeding that into an HTML parser is clearly broken!&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #535252; font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: 13px;&quot;&gt;
There are two solutions to this. One is to uncompress the incoming data with mod_deflate. Uncompressing and compressing content radically reduces network traffic, but increases the processor load on the proxy. It is worthwhile if and only if bandwidth between the proxy and the backend is at a premium: this is common on the &#39;net at large, but unlikely to be the case on a company internal network.&lt;/div&gt;
&lt;pre style=&quot;background-attachment: scroll; background-clip: initial; background-color: white; background-image: none; background-origin: initial; background-position: 0px 0px; background-repeat: repeat repeat; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(170, 170, 170); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(170, 170, 170); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(170, 170, 170); border-top-style: solid; border-top-width: 1px; font-family: Terminus, Consolas, Profont, &#39;Andale Mono&#39;, Monaco, Inconsolata, Inconsolata-g, Unifont, Lime, &#39;ClearlyU PUA&#39;, Clean, &#39;DejaVu Sans&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Lucida Console&#39;, &#39;Bitstream Vera Sans Mono&#39;, Freemono, &#39;Liberation Mono&#39;, Dina, Anka, &#39;Droid Sans Mono&#39;, &#39;Anonymous Pro&#39;, &#39;Proggy fonts&#39;, &#39;Envy Code R&#39;, Gamow, Courier, &#39;Courier New&#39;, Terminal, monospace; font-size: 13px; margin-bottom: 2em; margin-right: auto; margin-top: 1em; max-width: 97%; min-width: 50%; overflow-x: auto; overflow-y: auto; padding-bottom: 0.5em; padding-left: 1em; padding-right: 0.1em; padding-top: 0.5em; white-space: pre-wrap;&quot;&gt;SetOutputFilter  INFLATE;proxy-html;DEFLATE
&lt;/pre&gt;
&lt;div style=&quot;background-color: white; color: #535252; font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: 13px;&quot;&gt;
The alternative solution is to refuse to support compression. Stripping any Accept-Encoding request header does the job. So invoking mod_headers, we add a directive&lt;/div&gt;
&lt;pre class=&quot;odd&quot; style=&quot;background-attachment: scroll; background-clip: initial; background-color: white; background-image: none; background-origin: initial; background-position: 0px 0px; background-repeat: repeat repeat; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(170, 170, 170); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(170, 170, 170); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(170, 170, 170); border-top-style: solid; border-top-width: 1px; font-family: Terminus, Consolas, Profont, &#39;Andale Mono&#39;, Monaco, Inconsolata, Inconsolata-g, Unifont, Lime, &#39;ClearlyU PUA&#39;, Clean, &#39;DejaVu Sans&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Lucida Console&#39;, &#39;Bitstream Vera Sans Mono&#39;, Freemono, &#39;Liberation Mono&#39;, Dina, Anka, &#39;Droid Sans Mono&#39;, &#39;Anonymous Pro&#39;, &#39;Proggy fonts&#39;, &#39;Envy Code R&#39;, Gamow, Courier, &#39;Courier New&#39;, Terminal, monospace; font-size: 13px; margin-bottom: 2em; margin-right: auto; margin-top: 1em; max-width: 97%; min-width: 50%; overflow-x: auto; overflow-y: auto; padding-bottom: 0.5em; padding-left: 1em; padding-right: 0.1em; padding-top: 0.5em; white-space: pre-wrap;&quot;&gt;RequestHeader unset Accept-Encoding
&lt;/pre&gt;
&lt;div style=&quot;background-color: white; color: #535252; font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: 13px;&quot;&gt;
This should only apply to the Proxy, so we put it inside our&amp;nbsp;&lt;code style=&quot;font-family: Terminus, Consolas, Profont, &#39;Andale Mono&#39;, Monaco, Inconsolata, Inconsolata-g, Unifont, Lime, &#39;ClearlyU PUA&#39;, Clean, &#39;DejaVu Sans&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Lucida Console&#39;, &#39;Bitstream Vera Sans Mono&#39;, Freemono, &#39;Liberation Mono&#39;, Dina, Anka, &#39;Droid Sans Mono&#39;, &#39;Anonymous Pro&#39;, &#39;Proggy fonts&#39;, &#39;Envy Code R&#39;, Gamow, Courier, &#39;Courier New&#39;, Terminal, monospace; word-spacing: normal;&quot;&gt;&lt;location&gt;&lt;/location&gt;&lt;/code&gt;&amp;nbsp;containers.&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #535252; font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: 13px;&quot;&gt;
A similar situation arises in the case of encrypted (https) content. But in this case, there is no such workaround: if we could decrypt the data to process it then so could any other man-in-the-middle, and the security would be worthless. This can only be circumvented by installing mod_ssl and a certificate on the proxy, so that the actual secure session is between the browser and the proxy, not the origin server.&lt;/div&gt;
&lt;h2 style=&quot;background-color: white; color: #535252; font-family: Tahoma, Verdana, Helvetica, sans-serif;&quot;&gt;
&lt;a href=&quot;http://draft.blogger.com/blogger.g?blogID=7813956266500130511&quot; id=&quot;Complete_Configuration&quot;&gt;The Complete Configuration&lt;/a&gt;&amp;nbsp;&lt;a href=&quot;http://www.askapache.com/web-hosting/reverse-proxy-apache.html#toc&quot; style=&quot;color: #005fa9; text-decoration: none;&quot;&gt;^&lt;/a&gt;&lt;/h2&gt;
&lt;div style=&quot;background-color: white; color: #535252; font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: 13px;&quot;&gt;
We are now in a position to write a complete configuration for our reverse proxy. Here is a bare minimum, that ignores extended urlmapping:&lt;/div&gt;
&lt;pre style=&quot;background-attachment: scroll; background-clip: initial; background-color: white; background-image: none; background-origin: initial; background-position: 0px 0px; background-repeat: repeat repeat; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(170, 170, 170); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(170, 170, 170); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(170, 170, 170); border-top-style: solid; border-top-width: 1px; font-family: Terminus, Consolas, Profont, &#39;Andale Mono&#39;, Monaco, Inconsolata, Inconsolata-g, Unifont, Lime, &#39;ClearlyU PUA&#39;, Clean, &#39;DejaVu Sans&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Lucida Console&#39;, &#39;Bitstream Vera Sans Mono&#39;, Freemono, &#39;Liberation Mono&#39;, Dina, Anka, &#39;Droid Sans Mono&#39;, &#39;Anonymous Pro&#39;, &#39;Proggy fonts&#39;, &#39;Envy Code R&#39;, Gamow, Courier, &#39;Courier New&#39;, Terminal, monospace; font-size: 13px; margin-bottom: 2em; margin-right: auto; margin-top: 1em; max-width: 97%; min-width: 50%; overflow-x: auto; overflow-y: auto; padding-bottom: 0.5em; padding-left: 1em; padding-right: 0.1em; padding-top: 0.5em; white-space: pre-wrap;&quot;&gt;LoadModule proxy_module      modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule headers_module    modules/mod_headers.so
LoadFile   /usr/lib/libxml2.so
LoadModule proxy_html_module modules/mod_proxy_html.so
&amp;nbsp;
ProxyRequests off
ProxyPass /app1/ http://internal1.example.com/
ProxyPass /app2/ http://internal2.example.com/
ProxyHTMLURLMap http://internal1.example.com /app1
ProxyHTMLURLMap http://internal2.example.com /app2
&amp;nbsp;
&lt;location app1=&quot;&quot;&gt;
ProxyPassReverse /
SetOutputFilter  proxy-html
ProxyHTMLURLMap  /      /app1/
ProxyHTMLURLMap  /app1  /app1
RequestHeader    unset  Accept-Encoding
&lt;/location&gt;
&amp;nbsp;
&lt;location app2=&quot;&quot;&gt;
ProxyPassReverse /
SetOutputFilter proxy-html
ProxyHTMLURLMap /       /app2/
ProxyHTMLURLMap /app2   /app2
RequestHeader   unset   Accept-Encoding
&lt;/location&gt;
&lt;/pre&gt;
&lt;div style=&quot;background-color: white; color: #535252; font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: 13px;&quot;&gt;
Of course, there&#39;s more than one way to do it. Our configuration would actually have been simpler if we&#39;d used Virtual Hosts for each application server. But that takes you beyond the realm of Apache configuration and into DNS. If you don&#39;t fully understand that (or if you think &quot;why can&#39;t I see my domain&quot; is a webserver question), then please don&#39;t try using virtual hosts for this.&lt;/div&gt;
&lt;h2 style=&quot;background-color: white; color: #535252; font-family: Tahoma, Verdana, Helvetica, sans-serif;&quot;&gt;
&lt;a href=&quot;http://draft.blogger.com/blogger.g?blogID=7813956266500130511&quot; id=&quot;Further_topics&quot;&gt;Further topics&lt;/a&gt;&amp;nbsp;&lt;a href=&quot;http://www.askapache.com/web-hosting/reverse-proxy-apache.html#toc&quot; style=&quot;color: #005fa9; text-decoration: none;&quot;&gt;^&lt;/a&gt;&lt;/h2&gt;
&lt;h4 style=&quot;background-color: white; color: #535252; font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: 13px;&quot;&gt;
&lt;a href=&quot;http://draft.blogger.com/blogger.g?blogID=7813956266500130511&quot; id=&quot;Caching&quot;&gt;Caching&lt;/a&gt;&amp;nbsp;&lt;a href=&quot;http://www.askapache.com/web-hosting/reverse-proxy-apache.html#toc&quot; style=&quot;color: #005fa9; text-decoration: none;&quot;&gt;^&lt;/a&gt;&lt;/h4&gt;
&lt;div style=&quot;background-color: white; color: #535252; font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: 13px;&quot;&gt;
We haven&#39;t dealt with caching in this article. In a company-intranet situation, the connection from the proxy to the application servers is the local LAN, which is probably fast and has ample capacity. In such cases, caching at the proxy will have little effect, and can probably be omitted.&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #535252; font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: 13px;&quot;&gt;
If we want to cache pages, we can of course do so with mod_cache But that is beyond the scope of this article.&lt;/div&gt;
&lt;h4 style=&quot;background-color: white; color: #535252; font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: 13px;&quot;&gt;
&lt;a href=&quot;http://draft.blogger.com/blogger.g?blogID=7813956266500130511&quot; id=&quot;Content_Transformation&quot;&gt;Content Transformation&lt;/a&gt;&amp;nbsp;&lt;a href=&quot;http://www.askapache.com/web-hosting/reverse-proxy-apache.html#toc&quot; style=&quot;color: #005fa9; text-decoration: none;&quot;&gt;^&lt;/a&gt;&lt;/h4&gt;
&lt;div style=&quot;background-color: white; color: #535252; font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: 13px;&quot;&gt;
Another powerful use for a proxy is to transform the content on-the-fly according to the user&#39;s preferences. This author&#39;s flagship mod_accessibility product (from which mod_proxy_html is a spinoff) serves to transform HTML and XHTML on-demand to enhance usability and accessibility.&lt;/div&gt;
&lt;h4 style=&quot;background-color: white; color: #535252; font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: 13px;&quot;&gt;
&lt;a href=&quot;http://draft.blogger.com/blogger.g?blogID=7813956266500130511&quot; id=&quot;Filtering_Security&quot;&gt;Filtering and Security&lt;/a&gt;&amp;nbsp;&lt;a href=&quot;http://www.askapache.com/web-hosting/reverse-proxy-apache.html#toc&quot; style=&quot;color: #005fa9; text-decoration: none;&quot;&gt;^&lt;/a&gt;&lt;/h4&gt;
&lt;div style=&quot;background-color: white; color: #535252; font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: 13px;&quot;&gt;
A reverse proxy is not the natural place for a &quot;family filter&quot;, but is ideal for defining access controls and imposing security restrictions. We could, for example, configure the proxy to recognise a custom header from an origin server and block content based on it. This delegates control to the application servers.&lt;/div&gt;
&lt;h2 style=&quot;background-color: white; color: #535252; font-family: Tahoma, Verdana, Helvetica, sans-serif;&quot;&gt;
&lt;a href=&quot;http://draft.blogger.com/blogger.g?blogID=7813956266500130511&quot; id=&quot;Questions_and_Answers&quot;&gt;Questions and Answers&lt;/a&gt;&amp;nbsp;&lt;a href=&quot;http://www.askapache.com/web-hosting/reverse-proxy-apache.html#toc&quot; style=&quot;color: #005fa9; text-decoration: none;&quot;&gt;^&lt;/a&gt;&lt;/h2&gt;
&lt;dl style=&quot;background-color: white; color: #535252; font-family: Tahoma, Verdana, Helvetica, sans-serif; font-size: 13px; margin-bottom: 1.5em; margin-left: 0.5em;&quot;&gt;
&lt;dt style=&quot;color: #555555; font-size: 1.1em; font-weight: 700; line-height: 1.35em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0.5em;&quot;&gt;(Q) Where can I get the software?&lt;/dt&gt;
&lt;dd style=&quot;line-height: 1.35em; margin-bottom: 0px; margin-left: 0.5em; margin-right: 0px; margin-top: 0px;&quot;&gt;(A) Most of it from the obvious place, http://httpd.apache.org/ mod_proxy_html is available from http://apache.webthing.com/ libxml2 is available from http://xmlsoft.org/. Windows users should read libxml2.dll for libxml2.so, and can obtain it together with the prerequisites iconv.dll and zlib.dll from Igor Zlatkovic&#39;s site.&lt;/dd&gt;
&lt;dt style=&quot;color: #555555; font-size: 1.1em; font-weight: 700; line-height: 1.35em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0.5em;&quot;&gt;(Q) Can I get a binaries of software ?&lt;/dt&gt;
&lt;dd style=&quot;line-height: 1.35em; margin-bottom: 0px; margin-left: 0.5em; margin-right: 0px; margin-top: 0px;&quot;&gt;(A) If there&#39;s no link at the websites above, ask the provider of your operating system or distribution. The author can compile it on different platforms but does not provide a free compilation service.&lt;/dd&gt;
&lt;dt style=&quot;color: #555555; font-size: 1.1em; font-weight: 700; line-height: 1.35em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0.5em;&quot;&gt;(Q) What is httpd.conf? My apache has different configuration files.&lt;/dt&gt;
&lt;dd style=&quot;line-height: 1.35em; margin-bottom: 0px; margin-left: 0.5em; margin-right: 0px; margin-top: 0px;&quot;&gt;(A) Some distribution packagers mess about with the Apache configuration. If this applies to you, the details should be documented by your distributor, and have nothing to do with Apache itself! Substitute your distributions choice of configuration file for httpd.conf in the above discussion, or create your own proxy.conf file and Include it.&lt;/dd&gt;
&lt;dt style=&quot;color: #555555; font-size: 1.1em; font-weight: 700; line-height: 1.35em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0.5em;&quot;&gt;(Q) You mentioned apxs and apachectl. Where do I find them?&lt;/dt&gt;
&lt;dd style=&quot;line-height: 1.35em; margin-bottom: 0px; margin-left: 0.5em; margin-right: 0px; margin-top: 0px;&quot;&gt;(A) They&#39;re part of a standard Apache installation (except on Windows). If you don&#39;t have them or can&#39;t find them, that&#39;s a problem with your installation. The easiest solution is probably to download a complete Apache from httpd.apache.org.&lt;/dd&gt;
&lt;dt style=&quot;color: #555555; font-size: 1.1em; font-weight: 700; line-height: 1.35em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0.5em;&quot;&gt;(Q) Does mod_proxy_html deal with Javascript links?&lt;/dt&gt;
&lt;dd style=&quot;line-height: 1.35em; margin-bottom: 0px; margin-left: 0.5em; margin-right: 0px; margin-top: 0px;&quot;&gt;(A) From mod_proxy_html 2.0, yes!&lt;/dd&gt;
&lt;dt style=&quot;color: #555555; font-size: 1.1em; font-weight: 700; line-height: 1.35em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0.5em;&quot;&gt;(Q) The proxy appears to change my HTML?&lt;/dt&gt;
&lt;dd style=&quot;line-height: 1.35em; margin-bottom: 0px; margin-left: 0.5em; margin-right: 0px; margin-top: 0px;&quot;&gt;(A) It doesn&#39;t really, but it may appear to. Here are the possible causes:&lt;br /&gt;
&lt;ol style=&quot;margin-bottom: 0px; margin-left: 2em; margin-top: 0px;&quot;&gt;
&lt;li style=&quot;line-height: 1.35em; margin-bottom: 0.02em; margin-top: 0.02em;&quot;&gt;Changing the FPI (the&amp;nbsp;&lt;code style=&quot;font-family: Terminus, Consolas, Profont, &#39;Andale Mono&#39;, Monaco, Inconsolata, Inconsolata-g, Unifont, Lime, &#39;ClearlyU PUA&#39;, Clean, &#39;DejaVu Sans&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Lucida Console&#39;, &#39;Bitstream Vera Sans Mono&#39;, Freemono, &#39;Liberation Mono&#39;, Dina, Anka, &#39;Droid Sans Mono&#39;, &#39;Anonymous Pro&#39;, &#39;Proggy fonts&#39;, &#39;Envy Code R&#39;, Gamow, Courier, &#39;Courier New&#39;, Terminal, monospace; word-spacing: normal;&quot;&gt;&lt;/code&gt;&amp;nbsp;line) may affect some browsers. FIX: set the doctype explicitly if this bothers you.&lt;/li&gt;
&lt;li style=&quot;line-height: 1.35em; margin-bottom: 0.02em; margin-top: 0.02em;&quot;&gt;mod_proxy_html has the side-effect of transforming content to utf-8 (Unicode) encoding. This should not be a problem: utf-8 is well-supported by browsers, and offers comprehensive support for internationalisation. If it appears to cause a problem, that&#39;s almost certainly a bug in the application server, or possibly a misconfigured browser. FIX: filter through mod_charset_lite to your chosen charset.&lt;/li&gt;
&lt;li style=&quot;line-height: 1.35em; margin-bottom: 0.02em; margin-top: 0.02em;&quot;&gt;mod_proxy_html will perform some minor normalisations. If your HTML includes elements that are closed implicitly, it will explicitly close them. In other words:&lt;br /&gt;
&lt;pre class=&quot;odd&quot; style=&quot;background-attachment: scroll; background-clip: initial; background-color: #eaeaf9; background-image: none; background-origin: initial; background-position: 0px 0px; background-repeat: repeat repeat; border-bottom-color: rgb(191, 191, 204); border-bottom-style: dotted; border-bottom-width: 1px; border-left-color: rgb(191, 191, 204); border-left-style: dotted; border-left-width: 1px; border-right-color: rgb(191, 191, 204); border-right-style: dotted; border-right-width: 1px; border-top-color: rgb(191, 191, 204); border-top-style: dotted; border-top-width: 1px; color: black; font-family: Terminus, Consolas, Profont, &#39;Andale Mono&#39;, Monaco, Inconsolata, Inconsolata-g, Unifont, Lime, &#39;ClearlyU PUA&#39;, Clean, &#39;DejaVu Sans&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Lucida Console&#39;, &#39;Bitstream Vera Sans Mono&#39;, Freemono, &#39;Liberation Mono&#39;, Dina, Anka, &#39;Droid Sans Mono&#39;, &#39;Anonymous Pro&#39;, &#39;Proggy fonts&#39;, &#39;Envy Code R&#39;, Gamow, Courier, &#39;Courier New&#39;, Terminal, monospace; margin-bottom: 2em; margin-right: auto; margin-top: 1em; max-width: 97%; min-width: 50%; overflow-x: auto; overflow-y: auto; padding-bottom: 0.5em; padding-left: 1em; padding-right: 0.1em; padding-top: 0.5em; white-space: pre-wrap; word-spacing: normal;&quot;&gt;Hello, World!

&lt;/pre&gt;
will be transformed to&lt;br /&gt;
&lt;pre style=&quot;background-attachment: scroll; background-clip: initial; background-color: #eaeaf9; background-image: none; background-origin: initial; background-position: 0px 0px; background-repeat: repeat repeat; border-bottom-color: rgb(191, 191, 204); border-bottom-style: dotted; border-bottom-width: 1px; border-left-color: rgb(191, 191, 204); border-left-style: dotted; border-left-width: 1px; border-right-color: rgb(191, 191, 204); border-right-style: dotted; border-right-width: 1px; border-top-color: rgb(191, 191, 204); border-top-style: dotted; border-top-width: 1px; color: black; font-family: Terminus, Consolas, Profont, &#39;Andale Mono&#39;, Monaco, Inconsolata, Inconsolata-g, Unifont, Lime, &#39;ClearlyU PUA&#39;, Clean, &#39;DejaVu Sans&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Lucida Console&#39;, &#39;Bitstream Vera Sans Mono&#39;, Freemono, &#39;Liberation Mono&#39;, Dina, Anka, &#39;Droid Sans Mono&#39;, &#39;Anonymous Pro&#39;, &#39;Proggy fonts&#39;, &#39;Envy Code R&#39;, Gamow, Courier, &#39;Courier New&#39;, Terminal, monospace; margin-bottom: 2em; margin-right: auto; margin-top: 1em; max-width: 97%; min-width: 50%; overflow-x: auto; overflow-y: auto; padding-bottom: 0.5em; padding-left: 1em; padding-right: 0.1em; padding-top: 0.5em; white-space: pre-wrap; word-spacing: normal;&quot;&gt;Hello, World!



&lt;/pre&gt;
If this affects the rendition in your browser, it almost certainly means you are using malformed HTML and relying on error-correction in a browser. FIX: validate your HTML! The online Page Valet service will both validate and show your markup normalised by the DTD, while a companion tool AccessValet will show markup normalised by the same parser used in the proxy, and highlight other problems. Both are available at http://valet.webthing.com/&lt;/li&gt;
&lt;/ol&gt;
&lt;/dd&gt;
&lt;dt style=&quot;color: #555555; font-size: 1.1em; font-weight: 700; line-height: 1.35em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0.5em;&quot;&gt;(Q) I need a customised solution.&lt;/dt&gt;
&lt;dd style=&quot;line-height: 1.35em; margin-bottom: 0px; margin-left: 0.5em; margin-right: 0px; margin-top: 0px;&quot;&gt;(A) The author is available for development and consultancy.&lt;/dd&gt;&lt;/dl&gt;
</description><link>http://littlebitzltm.blogspot.com/2011/11/proxy-apache-mod.html</link><author>noreply@blogger.com (littlebitz)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7813956266500130511.post-2002375509799010502</guid><pubDate>Thu, 13 Oct 2011 14:23:00 +0000</pubDate><atom:updated>2012-10-04T17:44:13.559+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">java</category><title>Aplicaciones Web con Java (pÃ¡gina 2) - Monografias.com</title><description>&lt;ol&gt;
&lt;li&gt;&lt;b&gt;&lt;a href=&quot;http://www.monografias.com/trabajos71/aplicaciones-web-java/aplicaciones-web-java.shtml#aplicacioa&quot;&gt;Aplicaciones en     capas&lt;/a&gt;&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;&lt;a href=&quot;http://www.monografias.com/trabajos71/aplicaciones-web-java/aplicaciones-web-java.shtml#laarquitea&quot;&gt;La arquitectura     MVC&lt;/a&gt;&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;br /&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;&lt;a href=&quot;http://www.monografias.com/trabajos71/aplicaciones-web-java/aplicaciones-web-java2.shtml#javaruntia&quot;&gt;Java Runtime     Environment&lt;/a&gt;&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;&lt;a href=&quot;http://www.monografias.com/trabajos71/aplicaciones-web-java/aplicaciones-web-java2.shtml#libreriasa&quot;&gt;Librerías de     Java&lt;/a&gt;&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;&lt;a href=&quot;http://www.monografias.com/trabajos71/aplicaciones-web-java/aplicaciones-web-java2.shtml#lenguajeda&quot;&gt;Lenguaje de     programación Java&lt;/a&gt;&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;&lt;a href=&quot;http://www.monografias.com/trabajos71/aplicaciones-web-java/aplicaciones-web-java2.shtml#marcosdeta&quot;&gt;Marcos de trabajo en     Java&lt;/a&gt;&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;&lt;a href=&quot;http://www.monografias.com/trabajos71/aplicaciones-web-java/aplicaciones-web-java2.shtml#conclusioa&quot;&gt;Conclusiones&lt;/a&gt;&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;&lt;a href=&quot;http://www.monografias.com/trabajos71/aplicaciones-web-java/aplicaciones-web-java2.shtml#bibliograa&quot;&gt;Bibliografía     utilizada&lt;/a&gt;&lt;/b&gt;&lt;/li&gt;
&lt;/ol&gt;
En los últimos años las aplicaciones &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos5/laweb/laweb.shtml&quot; id=&quot;autolink&quot;&gt;web&lt;/a&gt;   han tenido gran auge gracias, en gran parte, a &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/Computacion/Internet/&quot; id=&quot;autolink&quot;&gt;Internet&lt;/a&gt; y la   proliferación de sitios web por toda la &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/Computacion/Redes/&quot; id=&quot;autolink&quot;&gt;red&lt;/a&gt;,   principalmente con el fin de fomentar el &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos16/acto-de-comercio/acto-de-comercio.shtml&quot; id=&quot;autolink&quot;&gt;comercio&lt;/a&gt;   electrónico. Su facilidad de &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos36/administracion-y-gerencia/administracion-y-gerencia.shtml&quot; id=&quot;autolink&quot;&gt;administración&lt;/a&gt;   centralizada las hace ideales tanto para su despliegue en &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/Computacion/Redes/&quot; id=&quot;autolink&quot;&gt;redes&lt;/a&gt;   de amplio alcance como en redes corporativas. La facilidad de uso   de las interfaces web y el hecho de que cada día   más personas están acostumbradas a la   navegación por Internet hace que el &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos901/evolucion-historica-concepciones-tiempo/evolucion-historica-concepciones-tiempo.shtml&quot; id=&quot;autolink&quot;&gt;tiempo&lt;/a&gt; de &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos5/teap/teap.shtml&quot; id=&quot;autolink&quot;&gt;aprendizaje&lt;/a&gt;   se reduzca considerablemente respecto a las tradicionales   aplicaciones de escritorio.&lt;br /&gt;
Por otra parte, más reciente el creciente auge   (en aumento acelerado) de multitud de marcos de &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos34/el-trabajo/el-trabajo.shtml&quot; id=&quot;autolink&quot;&gt;trabajo&lt;/a&gt; de   &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos12/eticaplic/eticaplic.shtml&quot; id=&quot;autolink&quot;&gt;código&lt;/a&gt; abierto o libre hace que su &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos12/desorgan/desorgan.shtml&quot; id=&quot;autolink&quot;&gt;desarrollo&lt;/a&gt; sea sencillo   y que un gran número de desarrolladores tengan experiencia   con ellos. Otro hecho a tener en cuenta es que una vez realizada   una aplicación web para uso interno de &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos11/empre/empre.shtml&quot; id=&quot;autolink&quot;&gt;una empresa&lt;/a&gt;, por   ejemplo en una &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos12/intrants/intrants.shtml&quot; id=&quot;autolink&quot;&gt;intranet&lt;/a&gt;, el poner esa funcionalidad, o incluso   funcionalidades nuevas, a disposición de empleados o el   público general tiene un coste mínimo a la vez que   una potencial proyección mundial.&lt;br /&gt;
&lt;h2&gt;
&lt;a href=&quot;http://draft.blogger.com/blogger.g?blogID=7813956266500130511&quot; name=&quot;aplicacioa&quot;&gt;&lt;b&gt;&lt;i&gt;Aplicaciones en   capas&lt;/i&gt;&lt;/b&gt;&lt;/a&gt;&lt;/h2&gt;
La &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos11/henrym/henrym.shtml&quot; id=&quot;autolink&quot;&gt;estrategia&lt;/a&gt; tradicional de utilizar aplicaciones   compactas causa gran cantidad de &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos15/calidad-serv/calidad-serv.shtml#PLANT&quot; id=&quot;autolink&quot;&gt;problemas&lt;/a&gt; de &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos11/funpro/funpro.shtml&quot; id=&quot;autolink&quot;&gt;integración&lt;/a&gt;   en &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos11/teosis/teosis.shtml&quot; id=&quot;autolink&quot;&gt;sistemas&lt;/a&gt; de aplicaciones complejos como pueden ser los   sistemas de &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos15/sistemas-control/sistemas-control.shtml&quot; id=&quot;autolink&quot;&gt;gestión&lt;/a&gt; de una &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos11/empre/empre.shtml&quot; id=&quot;autolink&quot;&gt;empresa&lt;/a&gt; o los sistemas de   &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos7/sisinf/sisinf.shtml&quot; id=&quot;autolink&quot;&gt;información&lt;/a&gt; integrados consistentes en más de una   aplicación. Estas aplicaciones suelen encontrarse con   importantes problemas de escalabilidad, disponibilidad, &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos/seguinfo/seguinfo.shtml&quot; id=&quot;autolink&quot;&gt;seguridad&lt;/a&gt;   e integración. Para solventar estos problemas se ha   generalizado la división de las aplicaciones en capas que   normalmente serán tres: una capa que servirá para   guardar los &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos11/basda/basda.shtml&quot; id=&quot;autolink&quot;&gt;datos&lt;/a&gt; (&lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos34/base-de-datos/base-de-datos.shtml&quot; id=&quot;autolink&quot;&gt;base de datos&lt;/a&gt;), una capa para centralizar la   &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos15/logica-metodologia/logica-metodologia.shtml&quot; id=&quot;autolink&quot;&gt;lógica&lt;/a&gt; de negocio (&lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos/adolmodin/adolmodin.shtml&quot; id=&quot;autolink&quot;&gt;modelo&lt;/a&gt;) y por último una   interfaz gráfica que facilite al usuario el uso del   &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos11/teosis/teosis.shtml&quot; id=&quot;autolink&quot;&gt;sistema&lt;/a&gt; (presentación).&lt;br /&gt;
&lt;div align=&quot;center&quot;&gt;
&lt;img alt=&quot;Monografias.com&quot; src=&quot;http://www.monografias.com/trabajos71/aplicaciones-web-java/image001.gif&quot; /&gt;&lt;/div&gt;
&lt;div align=&quot;center&quot;&gt;
&lt;i&gt;Figura 1.1. &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos6/arma/arma.shtml&quot; id=&quot;autolink&quot;&gt;Arquitectura&lt;/a&gt; tradicional   en tres capas.&lt;/i&gt;&lt;/div&gt;
Si se establece una separación entre la capa de   interfaz gráfica (&lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos11/sercli/sercli.shtml&quot; id=&quot;autolink&quot;&gt;cliente&lt;/a&gt;), replicada en cada uno de los   entornos de usuario, y la capa del modelo, que quedaría   centralizada en un &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos12/rete/rete.shtml&quot; id=&quot;autolink&quot;&gt;servidor&lt;/a&gt; de aplicaciones, según el   &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos14/flujograma/flujograma.shtml&quot; id=&quot;autolink&quot;&gt;diagrama&lt;/a&gt; que podemos ver en la Figura 1.1, obtenemos una potente   arquitectura que otorga algunas ventajas:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;       Centralización de los aspectos de seguridad y       transaccionalidad, que serían &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos33/responsabilidad/responsabilidad.shtml&quot; id=&quot;autolink&quot;&gt;responsabilidad&lt;/a&gt; del       modelo.&lt;br /&gt;
     &lt;/li&gt;
&lt;li&gt;       No replicación de lógica de negocio en       los &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos11/sercli/sercli.shtml&quot; id=&quot;autolink&quot;&gt;clientes&lt;/a&gt;: esto permite que las modificaciones y mejoras       sean automáticamente aprovechadas por el conjunto de       los usuarios, reduciendo los costes de       &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos15/mantenimiento-industrial/mantenimiento-industrial.shtml&quot; id=&quot;autolink&quot;&gt;mantenimiento&lt;/a&gt;.&lt;br /&gt;
     &lt;/li&gt;
&lt;li&gt;       Mayor sencillez de los clientes.&lt;br /&gt;
     &lt;/li&gt;
&lt;/ul&gt;
Si intentamos aplicar esto a las aplicaciones web,   debido a la obligatoria sencillez del &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/Computacion/Software/&quot; id=&quot;autolink&quot;&gt;software&lt;/a&gt; cliente que   será un navegador web, nos encontramos con una doble   posibilidad:&lt;br /&gt;
Crear un modelo de cuatro capas, separando cliente,   servidor web, modelo y &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos12/alma/alma.shtml&quot; id=&quot;autolink&quot;&gt;almacén&lt;/a&gt; de datos. Esto permite una   mayor extensibilidad en caso de que existan también   clientes no web en el sistema, que trabajarían   directamente contra el servidor del modelo.&lt;br /&gt;
Sin embargo, la gran mayoría de las aplicaciones   web comunes utilizan una arquitectura basada en la de tres capas   extendida a las particularidades de la web.&lt;br /&gt;
&lt;div align=&quot;center&quot;&gt;
&lt;img alt=&quot;Monografias.com&quot; src=&quot;http://www.monografias.com/trabajos71/aplicaciones-web-java/image002.gif&quot; /&gt;&lt;/div&gt;
&lt;div align=&quot;center&quot;&gt;
&lt;i&gt;Figura 1.2. Arquitectura web en tres   capas&lt;/i&gt;&lt;/div&gt;
&lt;h2&gt;
&lt;a href=&quot;http://draft.blogger.com/blogger.g?blogID=7813956266500130511&quot; name=&quot;laarquitea&quot;&gt;&lt;b&gt;&lt;i&gt;La arquitectura   MVC&lt;/i&gt;&lt;/b&gt;&lt;/a&gt;&lt;/h2&gt;
La arquitectura &lt;i&gt;Model-View-Controller&lt;/i&gt;   surgió como patrón arquitectónico para el   desarrollo de interfaces &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos11/estadi/estadi.shtml#METODOS&quot; id=&quot;autolink&quot;&gt;gráficas&lt;/a&gt; de usuario en entornos   Smalltalk. Su &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos10/teca/teca.shtml&quot; id=&quot;autolink&quot;&gt;concepto&lt;/a&gt; se basaba en separar el modelo de datos de   la aplicación de su representación de cara al   usuario y de la &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos901/interaccion-comunicacion-exploracion-teorica-conceptual/interaccion-comunicacion-exploracion-teorica-conceptual.shtml&quot; id=&quot;autolink&quot;&gt;interacción&lt;/a&gt; de éste con la   aplicación, mediante la división de la   aplicación en tres partes fundamentales:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;       El modelo, que contiene la lógica de negocio       de la aplicación&lt;br /&gt;
     &lt;/li&gt;
&lt;li&gt;       La vista, que &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos11/tebas/tebas.shtml&quot; id=&quot;autolink&quot;&gt;muestra&lt;/a&gt; al usuario la       información que éste necesita.&lt;br /&gt;
     &lt;/li&gt;
&lt;li&gt;       El controlador, que recibe e interpreta la       interacción del usuario, actuando sobre modelo y vista       de manera adecuada para provocar cambios de &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos12/elorigest/elorigest.shtml&quot; id=&quot;autolink&quot;&gt;estado&lt;/a&gt; en la       representación interna de los datos, así como       en su visualización.&lt;br /&gt;
     &lt;/li&gt;
&lt;/ul&gt;
Esta arquitectura ha demostrado ser muy apropiada para   las aplicaciones web y especialmente adaptarse bien a las   tecnologías proporcionadas por la plataforma J2EE, de   manera que:&lt;br /&gt;
&lt;br /&gt;
1. El &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos/adolmodin/adolmodin.shtml&quot; id=&quot;autolink&quot;&gt;modelo&lt;/a&gt;, que contiene la &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos15/logica-metodologia/logica-metodologia.shtml&quot; id=&quot;autolink&quot;&gt;lógica&lt;/a&gt; de negocio, sería modelado por un conjunto de clases &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos16/java/java.shtml&quot; id=&quot;autolink&quot;&gt;Java&lt;/a&gt;, existiendo dos claras alternativas de implementación, utilizando objetos java tradicionales llamados POJOs (&lt;i&gt;Plain Old Java Objects&lt;/i&gt;) o bien utilizando EJB (&lt;i&gt;Enterprise JavaBeans&lt;/i&gt;) en &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos11/teosis/teosis.shtml&quot; id=&quot;autolink&quot;&gt;sistemas&lt;/a&gt; con unas mayores necesidades de concurrencia o &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos11/travent/travent.shtml&quot; id=&quot;autolink&quot;&gt;distribución&lt;/a&gt;.&lt;br /&gt;
&lt;div id=&quot;adhispanic&quot;&gt;
&lt;br /&gt;
&lt;li&gt;2. La vista proporcionará una serie de &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos5/laweb/laweb.shtml&quot; id=&quot;autolink&quot;&gt;páginas web&lt;/a&gt; dinámicamente al &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos11/sercli/sercli.shtml&quot; id=&quot;autolink&quot;&gt;cliente&lt;/a&gt;, siendo para él simples páginas &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos7/html/html.shtml&quot; id=&quot;autolink&quot;&gt;HTML&lt;/a&gt;. Existen múltiples marcos de &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos34/el-trabajo/el-trabajo.shtml&quot; id=&quot;autolink&quot;&gt;trabajo&lt;/a&gt; o &lt;i&gt;frameworks &lt;/i&gt;que generan estas páginas &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos5/laweb/laweb.shtml&quot; id=&quot;autolink&quot;&gt;web&lt;/a&gt; a partir de distintos formatos, siendo el más extendido el de páginas JSP (&lt;i&gt;JavaServer Pages&lt;/i&gt;), que mediante un conjunto de tags &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos6/ixml/ixml.shtml#xml&quot; id=&quot;autolink&quot;&gt;XML&lt;/a&gt; proporcionan un interfaz sencillo y adecuado a clases Java y objetos proporcionados por el &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos12/rete/rete.shtml&quot; id=&quot;autolink&quot;&gt;servidor&lt;/a&gt;  de aplicaciones. Esto permite que sean sencillas de desarrollar por  personas con conocimientos de HTML. Entre estos tags tienen mención  especial la librería estándar JSTL (&lt;i&gt;JavaServer Pages Standard Tag Library&lt;/i&gt;) que proporciona una gran funcionalidad y versatilidad.&lt;br /&gt;
 &lt;/li&gt;
&lt;li&gt;3. El controlador en la plataforma J2EE se desarrolla mediante &lt;i&gt;servlets&lt;/i&gt;, que hacen de intermediarios entre la vista y el modelo, más versátiles que los JSP para esta &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos7/mafu/mafu.shtml&quot; id=&quot;autolink&quot;&gt;función&lt;/a&gt; al estar escritos como clases Java normales, evitando mezclar &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos12/eticaplic/eticaplic.shtml&quot; id=&quot;autolink&quot;&gt;código&lt;/a&gt; visual (HTML, XML...) con código Java. Para facilitar la implementación de estos &lt;i&gt;servlets &lt;/i&gt;también existe una serie de marcos de trabajo que proporcionan soporte a los desarrolladores, entre los que cabe destacar &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos28/aplicacion-paso-paso-struts/aplicacion-paso-paso-struts.shtml&quot; id=&quot;autolink&quot;&gt;Struts&lt;/a&gt;, que con una amplia &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos910/comunidades-de-hombres/comunidades-de-hombres.shtml&quot; id=&quot;autolink&quot;&gt;comunidad&lt;/a&gt; de usuarios se ha convertido en el estándar &lt;i&gt;de facto &lt;/i&gt;en este rol.&lt;br /&gt;
 &lt;/li&gt;
&lt;br /&gt;
Con todo lo anterior, el funcionamiento de una aplicación web J2EE  que utilice el patrón arquitectural MVC se puede descomponer en una  serie de pasos:&lt;br /&gt;
&lt;ul style=&quot;list-style-type: none;&quot;&gt;
&lt;li&gt;1. El usuario realiza una &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos35/categoria-accion/categoria-accion.shtml&quot; id=&quot;autolink&quot;&gt;acción&lt;/a&gt; en su navegador, que llega al servidor mediante una petición &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos11/wind/wind2.shtml&quot; id=&quot;autolink&quot;&gt;HTTP&lt;/a&gt; y es recibida por un &lt;i&gt;servlet &lt;/i&gt;(controlador).  Esa petición es interpretada y se transforma en la ejecución de código  java que delegará al modelo la ejecución de una acción de éste.&lt;br /&gt;
 &lt;/li&gt;
&lt;li&gt;2. El modelo recibe las peticiones del controlador, a través  de un interfaz o fachada que encapsulará y ocultará la complejidad del  modelo al controlador. El resultado de esa petición será devuelto al  controlador&lt;br /&gt;
 &lt;/li&gt;
&lt;li&gt;3. El controlador recibe del modelo el resultado, y en  función de éste, selecciona la vista que será mostrada al usuario, y le  proporcionará los &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos11/basda/basda.shtml&quot; id=&quot;autolink&quot;&gt;datos&lt;/a&gt; recibidos del modelo y otros datos necesarios para su transformación a HTML. Una vez hecho esto el &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos14/control/control.shtml&quot; id=&quot;autolink&quot;&gt;control&lt;/a&gt; pasa a la vista para la realización de esa transformación.&lt;br /&gt;
 &lt;/li&gt;
&lt;li&gt;4. En la vista se realiza la transformación tras recibir los  datos del controlador, elaborando la respuesta HTML adecuada para que  el usuario la visualice.&lt;br /&gt;
 &lt;/li&gt;
&lt;/ul&gt;
Esta &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos6/arma/arma.shtml&quot; id=&quot;autolink&quot;&gt;arquitectura&lt;/a&gt; de aplicaciones otorga varias ventajas clave al &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos12/desorgan/desorgan.shtml&quot; id=&quot;autolink&quot;&gt;desarrollo&lt;/a&gt; de aplicaciones web, destacando que:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Al separar de manera clara la lógica de negocio (modelo) de la  vista permite la reusabilidad del modelo, de modo que la misma  implementación de la lógica de negocio que maneja una aplicación pueda  ser usado en otras aplicaciones, sean éstas web o no.&lt;br /&gt;
 &lt;/li&gt;
&lt;li&gt;Permite una sencilla división de roles, dejando que sean diseñadores &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos11/estadi/estadi.shtml#METODOS&quot; id=&quot;autolink&quot;&gt;gráficos&lt;/a&gt; sin conocimientos de &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/Computacion/Programacion/&quot; id=&quot;autolink&quot;&gt;programación&lt;/a&gt;  o desarrollo de aplicaciones los que se encarguen de la realización de  la capa vista, sin necesidad de mezclar código Java entre el código  visual que desarrollen (tan sólo utilizando algunos tags, no muy  diferentes de los usados en el código HTML).&lt;br /&gt;
 &lt;/li&gt;
&lt;/ul&gt;
&lt;a href=&quot;http://draft.blogger.com/blogger.g?blogID=7813956266500130511&quot; name=&quot;laplatafoa&quot;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;h2&gt;
&lt;a href=&quot;http://draft.blogger.com/blogger.g?blogID=7813956266500130511&quot; name=&quot;laplatafoa&quot;&gt;&lt;b&gt;&lt;i&gt;La plataforma Java&lt;/i&gt;&lt;/b&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;a href=&quot;http://draft.blogger.com/blogger.g?blogID=7813956266500130511&quot; name=&quot;laplatafoa&quot;&gt; &lt;/a&gt;&lt;br /&gt;
Java es el nombre de un entorno o plataforma de &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/Computacion/index.shtml&quot; id=&quot;autolink&quot;&gt;computación&lt;/a&gt; originaria de &lt;i&gt;Sun Microsystems&lt;/i&gt;, capaz de ejecutar aplicaciones desarrolladas usando el &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/Computacion/Programacion/&quot; id=&quot;autolink&quot;&gt;Lenguaje de programación&lt;/a&gt; Java u otros lenguajes que compilen a bytecode y un conjunto de &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos11/contrest/contrest.shtml&quot; id=&quot;autolink&quot;&gt;herramientas&lt;/a&gt; de desarrollo. En este caso, la plataforma no es un &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/Computacion/Hardware/&quot; id=&quot;autolink&quot;&gt;hardware&lt;/a&gt; específico o un &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/Computacion/Sistemas_Operativos/&quot; id=&quot;autolink&quot;&gt;sistema operativo&lt;/a&gt;,  sino más bien una máquina virtual encargada de la ejecución de  aplicaciones, y un conjunto de librerías estándar que ofrecen  funcionalidad común.&lt;br /&gt;
La plataforma así llamada incluye:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Edición Estándar (&lt;i&gt;Java Platform, Standard Edition&lt;/i&gt;), o Java SE (antes J2SE)&lt;br /&gt;
 &lt;/li&gt;
&lt;li&gt;Plataforma Java, &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos901/nuevas-tecnologias-edicion-montaje/nuevas-tecnologias-edicion-montaje.shtml&quot; id=&quot;autolink&quot;&gt;Edición&lt;/a&gt; &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos11/empre/empre.shtml&quot; id=&quot;autolink&quot;&gt;Empresa&lt;/a&gt; (&lt;i&gt;Java Platform, Enterprise Edition&lt;/i&gt;), o Java EE (antes J2EE)&lt;br /&gt;
 &lt;/li&gt;
&lt;li&gt;Plataforma Java, Edición Micro (&lt;i&gt;Java Platform, Micro Edition&lt;/i&gt;), o Java ME (antes J2ME)&lt;br /&gt;
 &lt;/li&gt;
&lt;/ul&gt;
Desde 2006, la versión actual de la Plataforma &lt;i&gt;Java Standard Edition &lt;/i&gt;se le conoce como Java SE 6 como versión externa, y 1.6 como versión interna. Sin embargo, se prefiere el término versión 6. &lt;br /&gt;
La Plataforma Java se compone de un amplio abanico de tecnologías,  cada una de las cuales ofrece una parte del complejo de desarrollo o del  entorno de ejecución en &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos901/evolucion-historica-concepciones-tiempo/evolucion-historica-concepciones-tiempo.shtml&quot; id=&quot;autolink&quot;&gt;tiempo&lt;/a&gt; real. Por ejemplo, los usuarios finales suelen interactuar con la máquina virtual de Java y el conjunto estándar de &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos10/ponency/ponency.shtml&quot; id=&quot;autolink&quot;&gt;bibliotecas&lt;/a&gt;. Además, las aplicaciones Java pueden usarse de forma variada, como por ejemplo ser incrustadas en una &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos5/laweb/laweb.shtml&quot; id=&quot;autolink&quot;&gt;página Web&lt;/a&gt;. Para el desarrollo de aplicaciones, se utiliza un conjunto de herramientas conocidas como JDK  (&lt;i&gt;Java Development Kit&lt;/i&gt;, o herramientas de desarrollo para Java).&lt;br /&gt;
&lt;a href=&quot;http://draft.blogger.com/blogger.g?blogID=7813956266500130511&quot; name=&quot;javaruntia&quot;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;h2&gt;
&lt;a href=&quot;http://draft.blogger.com/blogger.g?blogID=7813956266500130511&quot; name=&quot;javaruntia&quot;&gt;&lt;b&gt;&lt;i&gt;Java Runtime Environment&lt;/i&gt;&lt;/b&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;a href=&quot;http://draft.blogger.com/blogger.g?blogID=7813956266500130511&quot; name=&quot;javaruntia&quot;&gt; &lt;/a&gt;&lt;br /&gt;
Un &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/Computacion/Programacion/&quot; id=&quot;autolink&quot;&gt;programa&lt;/a&gt; destinado a la Plataforma Java necesita dos componentes en el &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos11/teosis/teosis.shtml&quot; id=&quot;autolink&quot;&gt;sistema&lt;/a&gt; donde se va a ejecutar: una máquina virtual de Java (&lt;i&gt;Java Virtual Machine, JVM&lt;/i&gt;), y un conjunto de librerías para proporcionar los &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos14/verific-servicios/verific-servicios.shtml&quot; id=&quot;autolink&quot;&gt;servicios&lt;/a&gt;  que pueda necesitar la aplicación. La JVM que proporciona Sun  Microsystems, junto con su implementación de las librerías estándar, se  conocen como &lt;i&gt;Java Runtime Environment &lt;/i&gt;(JRE) o Entorno en tiempo de ejecución para Java. El JRE es lo mínimo que debe contener un sistema para &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos35/el-poder/el-poder.shtml&quot; id=&quot;autolink&quot;&gt;poder&lt;/a&gt; ejecutar una aplicación Java sobre el mismo.&lt;br /&gt;
En el &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos10/teca/teca.shtml&quot; id=&quot;autolink&quot;&gt;concepto&lt;/a&gt; de máquina virtual se encierra el concepto común de un &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos5/sisope/sisope.shtml&quot; id=&quot;autolink&quot;&gt;procesador&lt;/a&gt; &quot;virtual&quot; que ejecuta &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/Computacion/Programacion/&quot; id=&quot;autolink&quot;&gt;programas&lt;/a&gt; escritos en &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos16/desarrollo-del-lenguaje/desarrollo-del-lenguaje.shtml&quot; id=&quot;autolink&quot;&gt;el lenguaje&lt;/a&gt; de programación Java. En &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos/histoconcreto/histoconcreto.shtml&quot; id=&quot;autolink&quot;&gt;concreto&lt;/a&gt;,  ejecuta el código resultante de la compilación del código fuente,  conocido como bytecode. Este &quot;procesador&quot; es la máquina virtual de Java o  JVM, que se encarga de traducir (interpretar o compilar al vuelo) el  bytecode en instrucciones nativas de la plataforma destino. Esto permite  que una misma aplicación Java pueda ser ejecutada en una gran variedad  de sistemas con arquitecturas distintas, siempre que con una  implementación adecuada de la JVM. Este hecho es lo que ha dado lugar a  la famosa frase: &quot;&lt;i&gt;write once, run anywhere&quot; &lt;/i&gt;(escriba una vez, ejecute en cualquier parte). La condición es que no se utilicen llamadas nativas o &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos7/mafu/mafu.shtml&quot; id=&quot;autolink&quot;&gt;funciones&lt;/a&gt; especificas de una plataforma y aún así no se asegura completamente que se cumpla una verdadera &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos/indephispa/indephispa.shtml&quot; id=&quot;autolink&quot;&gt;independencia&lt;/a&gt; de plataforma.&lt;br /&gt;
Desde la versión 1.2 de JRE, la implementación de la máquina virtual de Sun incluye un compilador JIT (&lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos6/juti/juti.shtml&quot; id=&quot;autolink&quot;&gt;Just In Time&lt;/a&gt;). De esta forma, en vez de la tradicional &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos37/interpretacion/interpretacion.shtml&quot; id=&quot;autolink&quot;&gt;interpretación&lt;/a&gt;  del código bytecode, que da lugar a una ejecución lenta de las  aplicaciones, el JIT convierte el bytecode a código nativo de la  plataforma destino. Esta segunda compilación del código penaliza en  cuanto a tiempo, pero el código nativo resultante se ejecuta de forma  más eficaz y rápida que si fuera interpretado. Otras &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos6/juti/juti.shtml&quot; id=&quot;autolink&quot;&gt;técnicas&lt;/a&gt; de compilación &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos34/cinematica-dinamica/cinematica-dinamica.shtml&quot; id=&quot;autolink&quot;&gt;dinámica&lt;/a&gt;  del código durante el tiempo de ejecución permiten optimizar más aún el  código, dejando atrás el estigma que caía sobre Java en cuanto a su  lentitud y en sus últimas versiones la JVM se ha optimizado a tal punto  que ya no se considera una plataforma lenta en cuanto a ejecución de  aplicaciones.&lt;br /&gt;
Java no fue la primera plataforma basada en el concepto de una  máquina virtual, aunque es la que de más amplia difusión ha gozado. El &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos36/teoria-empleo/teoria-empleo.shtml&quot; id=&quot;autolink&quot;&gt;empleo&lt;/a&gt; de &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos6/auti/auti.shtml&quot; id=&quot;autolink&quot;&gt;máquinas&lt;/a&gt; virtuales se había centrado principalmente en el uso de emuladores para ayudar al desarrollo de hardware en &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos35/materiales-construccion/materiales-construccion.shtml&quot; id=&quot;autolink&quot;&gt;construcción&lt;/a&gt; o &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/Computacion/Sistemas_Operativos/&quot; id=&quot;autolink&quot;&gt;sistemas operativos&lt;/a&gt;, pero la JVM fue diseñada para ser implementada completamente en &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/Computacion/Software/&quot; id=&quot;autolink&quot;&gt;software&lt;/a&gt;, y al mismo tiempo hacer que fuera portable a todo tipo de hardware.&lt;br /&gt;
&lt;a href=&quot;http://draft.blogger.com/blogger.g?blogID=7813956266500130511&quot; name=&quot;libreriasa&quot;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;h2&gt;
&lt;a href=&quot;http://draft.blogger.com/blogger.g?blogID=7813956266500130511&quot; name=&quot;libreriasa&quot;&gt;&lt;b&gt;&lt;i&gt;Librerías de Java&lt;/i&gt;&lt;/b&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;a href=&quot;http://draft.blogger.com/blogger.g?blogID=7813956266500130511&quot; name=&quot;libreriasa&quot;&gt; &lt;/a&gt;&lt;br /&gt;
En la mayoría de los &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/Computacion/Sistemas_Operativos/&quot; id=&quot;autolink&quot;&gt;sistemas operativos&lt;/a&gt;  actuales, se ofrece una cantidad de código para simplificar la tarea de  programación. Este código toma la forma, normalmente, de un conjunto de  librerías dinámicas que las aplicaciones pueden llamar cuando lo  necesiten. Pero la Plataforma Java está pensada para ser independiente  del sistema operativo subyacente, por lo que las aplicaciones no pueden  apoyarse en funciones dependientes de cada sistema en concreto. Lo que  hace la Plataforma Java, es ofrecer un conjunto de libererías estándar,  que contiene mucha de las funciones reutilizables disponibles en los  sistemas operativos actuales.&lt;br /&gt;
Las librerías de Java tienen tres propósitos dentro de la Plataforma  Java. Al igual que otras librerías estándar, ofrecen al programador un  conjunto bien definido de funciones para realizar tareas comunes, como  manejar listas de elementos u operar de forma sofisticada sobre cadenas  de caracteres. Además, las librerías proporcionan una interfaz abstracta  para tareas que son altamente dependientes del hardware de la  plataforma destino y de su sistema operativo. Tareas tales como manejo  de las funciones de &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/Computacion/Redes/&quot; id=&quot;autolink&quot;&gt;red&lt;/a&gt;  o acceso a ficheros, suelen depender fuertemente de la funcionalidad  nativa de la plataforma destino. En el caso concreto anterior, las  librerías java.net y java.io implementan el código nativo internamente, y  ofrecen una interfaz estándar para que aplicaciones Java puedan  ejecutar tales funciones. Finalmente, no todas las plataformas soportan  todas las funciones que una aplicación Java espera. En estos casos, las  librerías bien pueden emular esas funciones usando lo que esté  disponible, o bien ofrecer un mecanismo para comprobar si una  funcionalidad concreta está presente.&lt;br /&gt;
&lt;a href=&quot;http://draft.blogger.com/blogger.g?blogID=7813956266500130511&quot; name=&quot;lenguajeda&quot;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;h2&gt;
&lt;a href=&quot;http://draft.blogger.com/blogger.g?blogID=7813956266500130511&quot; name=&quot;lenguajeda&quot;&gt;&lt;b&gt;&lt;i&gt;Lenguaje de programación Java&lt;/i&gt;&lt;/b&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;a href=&quot;http://draft.blogger.com/blogger.g?blogID=7813956266500130511&quot; name=&quot;lenguajeda&quot;&gt; &lt;/a&gt;&lt;br /&gt;
La palabra Java, por sí misma, se refiere habitualmente al &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos35/concepto-de-lenguaje/concepto-de-lenguaje.shtml&quot; id=&quot;autolink&quot;&gt;lenguaje&lt;/a&gt; de programación Java, que fue diseñado para usar con la Plataforma Java. Los &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/Computacion/Programacion/&quot; id=&quot;autolink&quot;&gt;lenguajes de programación&lt;/a&gt;  se encuentran fuera del ámbito de lo que es una &quot;plataforma&quot;, aunque el  lenguaje de programación Java es uno de los componentes fundamentales  de la  propia plataforma. El propio lenguaje y el entorno en tiempo de  ejecución suelen considerarse una única entidad.&lt;br /&gt;
&lt;a href=&quot;http://draft.blogger.com/blogger.g?blogID=7813956266500130511&quot; name=&quot;marcosdeta&quot;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;h2&gt;
&lt;a href=&quot;http://draft.blogger.com/blogger.g?blogID=7813956266500130511&quot; name=&quot;marcosdeta&quot;&gt;&lt;b&gt;&lt;i&gt;Marcos de trabajo en Java&lt;/i&gt;&lt;/b&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;a href=&quot;http://draft.blogger.com/blogger.g?blogID=7813956266500130511&quot; name=&quot;marcosdeta&quot;&gt; &lt;/a&gt;&lt;br /&gt;
Lo novedoso de las tecnologías usadas es uno de los puntos fuertes de este &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos12/pmbok/pmbok.shtml&quot; id=&quot;autolink&quot;&gt;proyecto&lt;/a&gt;. Todas ellas son tecnologías Java de código abierto. &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos5/teap/teap.shtml&quot; id=&quot;autolink&quot;&gt;El aprendizaje&lt;/a&gt;  y familiarización ha ocupado la mayor parte del tiempo del proyecto. A  continuación se describen los marcos de trabajo utilizados para el  desarrollo de la aplicación&lt;br /&gt;
&lt;b&gt;Spring&lt;/b&gt;&lt;br /&gt;
Spring es un marco de trabajo de aplicaciones Java/J2EE desarrollado  por Rod Jonson, Juergen Hoeller, Justin Gehtland y Bruce A. Tate.&lt;br /&gt;
Spring proporciona:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Una potente &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos15/sistemas-control/sistemas-control.shtml&quot; id=&quot;autolink&quot;&gt;gestión&lt;/a&gt; de configuración basada en JavaBeans, aplicando los &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos6/etic/etic.shtml&quot; id=&quot;autolink&quot;&gt;principios&lt;/a&gt; de &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos12/cntbtres/cntbtres.shtml&quot; id=&quot;autolink&quot;&gt;Inversión&lt;/a&gt; de Control (&lt;i&gt;IoC&lt;/i&gt;). Esto hace que la configuración de aplicaciones sea rápida y sencilla. Ya no es necesario tener &lt;i&gt;singletons &lt;/i&gt;ni ficheros de configuración, una aproximación consistente y elegante. Esta factoría de &lt;i&gt;beans &lt;/i&gt;puede ser usada en cualquier entorno, desde &lt;i&gt;applets &lt;/i&gt;hasta contenedores J2EE. Estas definiciones de &lt;i&gt;beans &lt;/i&gt;se realizan en lo que se llama el contexto de aplicación.&lt;br /&gt;
 &lt;/li&gt;
&lt;li&gt;Una capa genérica de abstracción para la gestión de transacciones, permitiendo gestores de transacción enchufables (&lt;i&gt;pluggables&lt;/i&gt;), y haciendo sencilla la demarcación de transacciones sin tratarlas a bajo nivel. Se incluyen &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos11/henrym/henrym.shtml&quot; id=&quot;autolink&quot;&gt;estrategias&lt;/a&gt;  genéricas para JTA y un único JDBC DataSource. En contraste con el JTA  simple o EJB CMT, el soporte de transacciones de Spring no está atado a  entornos J2EE.&lt;br /&gt;
 &lt;/li&gt;
&lt;li&gt;Una capa de abstracción JDBC que ofrece una significativa  jerarquía de excepciones (evitando la necesidad de obtener de  SQLException los códigos que cada gestor de &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos34/base-de-datos/base-de-datos.shtml&quot; id=&quot;autolink&quot;&gt;base de datos&lt;/a&gt; asigna a los errores), simplifica el manejo de errores, y reduce considerablemente la cantidad de código necesario.&lt;br /&gt;
 &lt;/li&gt;
&lt;li&gt;Integración con Hibernate, JDO e iBatis &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos14/sqlserver/sqlserver.shtml&quot; id=&quot;autolink&quot;&gt;SQL&lt;/a&gt;  Maps en términos de soporte a implementaciones DAO y estrategias con  transacciones. Especial soporte a Hibernate añadiendo convenientes  características de &lt;i&gt;IoC&lt;/i&gt;, y solucionando muchos de los comunes &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos15/calidad-serv/calidad-serv.shtml#PLANT&quot; id=&quot;autolink&quot;&gt;problemas&lt;/a&gt; de &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos11/funpro/funpro.shtml&quot; id=&quot;autolink&quot;&gt;integración&lt;/a&gt; de Hibernate. Todo ello cumpliendo con las transacciones genéricas de Spring y la jerarquía de excepciones DAO.&lt;br /&gt;
 &lt;/li&gt;
&lt;li&gt;Funcionalidad basada en Programación orientada a aspectos  (AOP), totalmente integrada en la gestión de configuración de Spring. Se  puede aplicar AOP a cualquier objeto gestionado por Spring, añadiendo  aspectos como gestión de transacciones declarativa. Con Spring se puede  tener gestión de transacciones declarativa sin EJB, incluso sin JTA, si  se utiliza una única base de datos en un contenedor web sin soporte JTA.&lt;br /&gt;
 &lt;/li&gt;
&lt;li&gt;Un marco de trabajo MVC (&lt;i&gt;Model-View-Controller&lt;/i&gt;),  construido sobre el núcleo de Spring. Este marcod de trabajo es  altamente configurable a través de interfaces y permite el uso de  múltiples tecnologías para la capa vista como pueden ser JSP, Velocity,  Tiles, iText o POI. De cualquier manera una capa modelo realizada con  Spring puede ser fácilmente utilizada con una capa web basada en  cualquier otro framework MVC, como Struts, WebWork o Tapestry.&lt;br /&gt;
 &lt;/li&gt;
&lt;/ul&gt;
Toda esta funcionalidad puede usarse en cualquier servidor J2EE, y la mayoría de ella ni siquiera requiere su uso. El &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos16/objetivos-educacion/objetivos-educacion.shtml&quot; id=&quot;autolink&quot;&gt;objetivo&lt;/a&gt;  central de Spring es permitir que objetos de negocio y de acceso a  datos sean reusables, no atados a servicios J2EE específicos. Estos  objetos pueden ser reutilizados tanto en entornos J2EE (web o EJB),  aplicaciones standalone, entornos de &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos12/romandos/romandos.shtml#PRUEBAS&quot; id=&quot;autolink&quot;&gt;pruebas&lt;/a&gt;,... sin ningún problema.&lt;br /&gt;
La arquitectura en capas de Spring (Figura 1.3) ofrece gran  flexibilidad. Toda la funcionalidad está construida sobre los niveles  inferiores. Por ejemplo se puede utilizar la gestión de configuración  basada en JavaBeans sin utilizar el marco de trabajo MVC o el soporte  AOP.&lt;br /&gt;
&lt;div align=&quot;center&quot;&gt;
&lt;img alt=&quot;Monografias.com&quot; src=&quot;http://www.monografias.com/trabajos71/aplicaciones-web-java/image003.jpg&quot; /&gt;&lt;/div&gt;
&lt;div align=&quot;center&quot;&gt;
&lt;i&gt;Figura 1.3. Arquitectura en capas de Spring&lt;/i&gt;&lt;/div&gt;
&lt;b&gt;Hibernate&lt;/b&gt;&lt;br /&gt;
Hibernate es un potente mapeador objeto/relacional y &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos14/verific-servicios/verific-servicios.shtml&quot; id=&quot;autolink&quot;&gt;servicio&lt;/a&gt; de consultas para Java. Es la solución ORM (&lt;i&gt;Object-Relational Mapping&lt;/i&gt;) más popular en el mundo Java.&lt;br /&gt;
Hibernate permite desarrollar clases persistentes a partir de clases comunes, incluyendo asociación, &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos13/heren/heren.shtml&quot; id=&quot;autolink&quot;&gt;herencia&lt;/a&gt;, polimorfismo, composición y colecciones de objetos. El lenguaje de consultas de Hibernate HQL (&lt;i&gt;Hibernate Query Language&lt;/i&gt;),  diseñado como una mínima extensión orientada a objetos de SQL,  proporciona un puente elegante entre los mundos objetual y relacional.  Hibernate también permite expresar consultas utilizando SQL nativo o  consultas basadas en criterios.&lt;br /&gt;
Soporta todos los sistemas gestores de &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos11/basda/basda.shtml&quot; id=&quot;autolink&quot;&gt;bases de datos&lt;/a&gt; SQL y se integra de manera elegante y sin restricciones con los más populares &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos12/rete/rete.shtml&quot; id=&quot;autolink&quot;&gt;servidores&lt;/a&gt; de aplicaciones J2EE y contenedores web, y por supuesto también puede utilizarse en aplicaciones &lt;i&gt;standalone&lt;/i&gt;.&lt;br /&gt;
Características clave:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Persistencia transparente&lt;br /&gt;
 &lt;/li&gt;
&lt;/ul&gt;
Hibernate puede operar proporcionando persistencia de una manera transparente para el desarrollador.&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Modelo de programación natural&lt;br /&gt;
 &lt;/li&gt;
&lt;/ul&gt;
Hibernate soporta el &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos16/paradigmas/paradigmas.shtml#queson&quot; id=&quot;autolink&quot;&gt;paradigma&lt;/a&gt;  de orientación a objetos de una manera natural: herencia, polimorfismo,  composición y el marco de trabajo de colecciones de Java.&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Soporte para &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos/adolmodin/adolmodin.shtml&quot; id=&quot;autolink&quot;&gt;modelos&lt;/a&gt; de objetos con una granularidad muy fina&lt;br /&gt;
 &lt;/li&gt;
&lt;/ul&gt;
Permite una gran variedad de mapeos para colecciones y objetos dependientes.&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Sin necesidad de mejorar el código compilado (&lt;i&gt;bytecode&lt;/i&gt;)&lt;br /&gt;
 &lt;/li&gt;
&lt;/ul&gt;
No es necesaria la generación de código ni el procesamiento del &lt;i&gt;bytecode &lt;/i&gt;en el &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos14/administ-procesos/administ-procesos.shtml#PROCE&quot; id=&quot;autolink&quot;&gt;proceso&lt;/a&gt; de compilación.&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Escalabilidad extrema&lt;br /&gt;
 &lt;/li&gt;
&lt;/ul&gt;
Hibernate posee un alto rendimiento, tiene una caché de dos niveles y  puede ser usado en un cluster. Permite inicialización perezosa (&lt;i&gt;lazy&lt;/i&gt;) de objetos y colecciones.&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Lenguaje de consultas HQL&lt;br /&gt;
 &lt;/li&gt;
&lt;/ul&gt;
Este lenguaje proporciona una independencia del SQL de cada base de datos, tanto para el &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos12/dispalm/dispalm.shtml&quot; id=&quot;autolink&quot;&gt;almacenamiento&lt;/a&gt; de objetos como para su recuperación.&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Soporte para transacciones de aplicación&lt;br /&gt;
 &lt;/li&gt;
&lt;/ul&gt;
Hibernate soporta transacciones largas (aquellas que requieren la &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos901/interaccion-comunicacion-exploracion-teorica-conceptual/interaccion-comunicacion-exploracion-teorica-conceptual.shtml&quot; id=&quot;autolink&quot;&gt;interacción&lt;/a&gt; con el usuario durante su ejecución) y gestiona la &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/Politica/index.shtml&quot; id=&quot;autolink&quot;&gt;política&lt;/a&gt; &lt;i&gt;optimistic locking &lt;/i&gt;automáticamente.&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Generación automática de claves primarias&lt;br /&gt;
 &lt;/li&gt;
&lt;/ul&gt;
Soporta los diversos tipos de generación de identificadores que  proporcionan los sistemas gestores de bases de datos (secuencias,  columnas autoincrementales,...) así como generación independiente de la  base de datos, incluyendo identificadores asignados por la aplicación o  claves compuestas.&lt;br /&gt;
&lt;b&gt;Java Server Pages&lt;/b&gt;&lt;br /&gt;
Es una &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/Tecnologia/index.shtml&quot; id=&quot;autolink&quot;&gt;tecnología&lt;/a&gt; Java que permite generar contenido dinámico para web, en forma de &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos14/comer/comer.shtml&quot; id=&quot;autolink&quot;&gt;documentos&lt;/a&gt;  HTML, XML o de otro tipo. Es un desarrollo de la compañía Sun  Microsystems. La Especificación JSP 1.2 fue la primera que se liberó y  en la actualidad está disponible la especificación JSP 2.1.&lt;br /&gt;
Permiten la utilización de código Java mediante scripts y permite la utilización de algunas &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos4/acciones/acciones.shtml&quot; id=&quot;autolink&quot;&gt;acciones&lt;/a&gt;  JSP predefinidas mediante etiquetas. Estas etiquetas pueden ser  enriquecidas mediante la utilización de Librerías de Etiquetas (TagLibs o  Tag Libraries) externas e incluso personalizadas.&lt;br /&gt;
JSP puede considerarse como una manera alternativa, y simplificada, de construir &lt;i&gt;servlets&lt;/i&gt;. Es por ello que una página JSP puede hacer todo lo que un &lt;i&gt;servlet &lt;/i&gt;puede  hacer, y viceversa. El funcionamiento general de la tecnología JSP es  que el Servidor de Aplicaciones interpreta el código contenido en la  página JSP para construir el código Java del &lt;i&gt;servlet &lt;/i&gt;a generar.  Este será luego el que genere el documento (típicamente HTML) que se  presentará en la pantalla del Navegador del usuario.&lt;br /&gt;
El rendimiento de una página JSP es el mismo que tendría el servidor  equivalente, ya que el código es compilado como cualquier otra &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos901/debate-multicultural-etnia-clase-nacion/debate-multicultural-etnia-clase-nacion.shtml&quot; id=&quot;autolink&quot;&gt;clase&lt;/a&gt;  Java. A su vez, la máquina virtual compilará dinámicamente a código de  máquina las partes de la aplicación que lo requieran. Esto hace que JSP  tenga un buen &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos15/indicad-evaluacion/indicad-evaluacion.shtml&quot; id=&quot;autolink&quot;&gt;desempeño&lt;/a&gt; y sea más eficiente que otras tecnologías web que ejecutan el código de una manera puramente interpretada.&lt;br /&gt;
La principal ventaja de &lt;b&gt;JSP &lt;/b&gt;frente a otros lenguajes es que el  lenguaje Java es un lenguaje de propósito general que excede el mundo  web y que es apto para crear clases que manejen lógica de negocio y  acceso a datos de una manera prolija. Esto permite separar en niveles  las aplicaciones web, dejando la parte encargada de generar el documento  HTML en el &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos7/arch/arch.shtml&quot; id=&quot;autolink&quot;&gt;archivo&lt;/a&gt; JSP.&lt;br /&gt;
Otra ventaja es que JSP hereda la portabilidad de Java, y es posible  ejecutar las aplicaciones en múltiples plataformas sin cambios. Es común  incluso que los desarrolladores trabajen en una plataforma y que la  aplicación termine siendo ejecutada en otra.&lt;br /&gt;
&lt;b&gt;Java Server Faces&lt;/b&gt;&lt;br /&gt;
Es un marco de trabajo para aplicaciones Java basadas en web que  simplifica el desarrollo de intrefaces de usuario en aplicaciones Java  EE. Usa Java Server Pages (JSP) como la tecnología que permite hacer el  despliegue de las páginas, pero también se puede acomodar a otras  tecnologías.&lt;br /&gt;
Su implementación incluye:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Un conjunto de APIs para representar componentes de una interfaz de usuario y administrar su &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos12/elorigest/elorigest.shtml&quot; id=&quot;autolink&quot;&gt;estado&lt;/a&gt;, manejar &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos13/gaita/gaita.shtml&quot; id=&quot;autolink&quot;&gt;eventos&lt;/a&gt;, validar entrada, definir un esquema de navegación de las páginas y dar soporte para internacionalización y accesibilidad.&lt;br /&gt;
 &lt;/li&gt;
&lt;li&gt;Un conjunto por defecto de componentes para la interfaz de usuario.&lt;br /&gt;
 &lt;/li&gt;
&lt;li&gt;Dos librerías de etiquetas personalizadas para &lt;i&gt;JavaServer Pages &lt;/i&gt;que permiten expresar una interfaz &lt;i&gt;JavaServer Faces &lt;/i&gt;dentro de una página JSP.&lt;br /&gt;
 &lt;/li&gt;
&lt;li&gt;Un modelo de eventos en el lado del servidor.&lt;br /&gt;
 &lt;/li&gt;
&lt;li&gt;Administración de estados.&lt;br /&gt;
 &lt;/li&gt;
&lt;li&gt;Beans administrados.&lt;br /&gt;
 &lt;/li&gt;
&lt;/ul&gt;
La especificación de JSF fue desarrollada por la &lt;i&gt;Java Community Process&lt;/i&gt;.&lt;br /&gt;
&lt;b&gt;Richfaces&lt;/b&gt;&lt;br /&gt;
Es una &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos10/ponency/ponency.shtml&quot; id=&quot;autolink&quot;&gt;biblioteca&lt;/a&gt;  de componentes para JSF y un avanzado marco de trabajo para la  integración de AJAX con facilidad en la capacidad de desarrollo de  aplicaciones de negocio. Los componentes de RichFaces vienen listos para  ser usados de manera rápida y sencilla, por lo que los desarrolladores  pueden ahorrar tiempo de inmediato para aprovechar las características  de los componentes para crear aplicaciones Web que proporcionan mejoras  en gran medida la experiencia del usuario. RichFaces también incluye un  fuerte apoyo para el tratamiento de temas visuales (&lt;i&gt;skins&lt;/i&gt;) en  las aplicaciones JSF. También aprovecha al máximo los beneficios del  marco de trabajo JSF incluyendo, la validación y conversión de  instalaciones, junto con la gestión de &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos5/estat/estat.shtml&quot; id=&quot;autolink&quot;&gt;estática&lt;/a&gt; y dinámica los &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos4/refrec/refrec.shtml&quot; id=&quot;autolink&quot;&gt;recursos&lt;/a&gt;.&lt;br /&gt;
Es una biblioteca de código abierto que se integra totalmente en la  arquitectura de JSF y hereda las funcionalidades de sus etiquetas  dotándolas con tecnología Ajax de forma limpia y sin añadir código &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos16/java/java.shtml&quot; id=&quot;autolink&quot;&gt;Javascript&lt;/a&gt;. Mediante este marco de trabajo se puede variar el &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos16/proyecto-inversion/proyecto-inversion.shtml#CICLO&quot; id=&quot;autolink&quot;&gt;ciclo de vida&lt;/a&gt;  de una petición JSF, recargar determinados componentes de la página sin  necesidad de recargarla por completo, realizar peticiones al servidor  automáticas y controlar cualquier evento de usuario. &lt;br /&gt;
El funcionamiento de la herramienta es muy sencillo. Mediante sus  propias etiquetas se generan eventos que envían peticiones al contenedor  Ajax. Estos eventos se pueden ejecutar por pulsar un botón, un enlace,  una región específica de la pantalla, un &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos2/mercambiario/mercambiario.shtml&quot; id=&quot;autolink&quot;&gt;cambio&lt;/a&gt;  de estado de un componente, etc. Esto significa que el desarrollador no  tiene que preocuparse de crear el código Javascript y el objeto  XMLHttpRequest para que envíe la petición al servidor ya que el marco de  trabajo hace &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos/fintrabajo/fintrabajo.shtml&quot; id=&quot;autolink&quot;&gt;el trabajo&lt;/a&gt;.&lt;br /&gt;
Una etiqueta especial del marco de trabajo es &lt;i&gt;Ajax4jsf &lt;/i&gt;que se   usa para activar las funcionalidades de Ajax dentro de la aplicación.   Los tags de Richfaces se pueden acceder mediante el tag , como por ejemplo   (para hacer una lista desplegable editable o , para visualizar   datos en un componente tipo rejilla (&lt;i&gt;grid&lt;/i&gt;)&lt;br /&gt;
&lt;b&gt;Facelets&lt;/b&gt;&lt;br /&gt;
Es un sistema de plantillas, que sirve para integrar las partes  estaticas de la aplicación web dentro del contenido dinámico. El  problema de esta herramienta para JSF es la poca integración que tiene  con otros marcos de trabajo, uno de ellos es &lt;i&gt;Spring Security &lt;/i&gt;2.0,  que no dispone de etiquetas para trabajarlo. Las plantillas deben ser  nombradas con la extensión .xhtml y su uso es muy sencillo.&lt;br /&gt;
&lt;b&gt;Spring AOP&lt;/b&gt;&lt;br /&gt;
La Programación Orientada a Aspectos, más conocida como AOP por su nombre en &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos16/manual-ingles/manual-ingles.shtml&quot; id=&quot;autolink&quot;&gt;inglés&lt;/a&gt; &lt;i&gt;Aspect Oriented Programming&lt;/i&gt;,  es un modelo de programación que aborda un problema específico:  capturar las partes de un sistema que los modelos de programación  habituales obligan a que estén repartidos a lo largo de distintos  módulos del sistema. Estos fragmentos que afectan a distintos módulos  son llamados aspectos y los problemas que solucionan, problemas cruzados  (&lt;i&gt;crosscutting concerns&lt;/i&gt;).&lt;br /&gt;
Usando un lenguaje que soporte AOP, podemos capturar estas  dependencias en módulos individuales, obteniendo un sistema  independiente de ellos y podemos utilizarlos o no sin tocar el código  del sistema básico, preservando la integridad de las &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos6/diop/diop.shtml&quot; id=&quot;autolink&quot;&gt;operaciones&lt;/a&gt; básicas.&lt;br /&gt;
Los principales campos de aplicación de la AOP son:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;rastreo de la ejecución (&lt;i&gt;tracing&lt;/i&gt;)&lt;br /&gt;
 &lt;/li&gt;
&lt;li&gt;medida de tiempos y optimización (&lt;i&gt;profiling&lt;/i&gt;)&lt;br /&gt;
 &lt;/li&gt;
&lt;li&gt;pruebas (&lt;i&gt;testing&lt;/i&gt;)&lt;br /&gt;
 &lt;/li&gt;
&lt;/ul&gt;
Spring AOP es uno de los marcos de trabajo existentes para implantar la programación orientada a aspectos. &lt;br /&gt;
&lt;b&gt;Spring Security&lt;/b&gt;&lt;br /&gt;
Proporciona servicios de &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos/seguinfo/seguinfo.shtml&quot; id=&quot;autolink&quot;&gt;seguridad&lt;/a&gt; dentro de &lt;i&gt;Spring&lt;/i&gt;. Proporciona   un sistema de autenticación a través del cual los usuarios pueden   autenticarse y acceder a múltiples aplicaciones a través de un   único punto de entrada. Para ello utiliza el servicio de autenticación   CAS (&lt;i&gt;Central Authentication Service&lt;/i&gt;) desarrollado por la &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos13/admuniv/admuniv.shtml&quot; id=&quot;autolink&quot;&gt;Universidad&lt;/a&gt;   de Yale [CAS], con el que una aplicación puede participar en un entorno   &lt;i&gt;single sign on &lt;/i&gt;a nivel de toda &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos11/empre/empre.shtml&quot; id=&quot;autolink&quot;&gt;la empresa&lt;/a&gt;. Ya no es necesario que cada   aplicación tenga su propia base de datos de autenticación, ni   tampoco existe la restricción de que sólo se pueda utilizar dentro   del mismo servidor de aplicaciones. Otras características avanzadas que   proporciona son soporte para &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos12/rete/rete.shtml&quot; id=&quot;autolink&quot;&gt;proxy&lt;/a&gt; y refrescamiento forzado de logins. Tiene   completa integración con Spring, utiliza los propios mecanismos de configuración   de Spring y asegura la seguridad a nivel de instancia de objetos del &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos7/doin/doin.shtml&quot; id=&quot;autolink&quot;&gt;dominio&lt;/a&gt;.   En muchas aplicaciones es deseable definir listas de control de acceso (&lt;i&gt;Access   Control Lists &lt;/i&gt;o ACLs) para instancias de objetos del dominio individuales.   Spring Security proporciona un completo paquete ACL con características   que incluyen máscaras de bits, herencia de permisos, un repositorio utilizando   JDBC, caché y un &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos13/diseprod/diseprod.shtml&quot; id=&quot;autolink&quot;&gt;diseño&lt;/a&gt; &lt;i&gt;pluggable &lt;/i&gt;utilizando interfaces.&lt;br /&gt;
Spring Security también implementa la protección de las peticiones  HTTP. Ya no es necesario depender de restricciones de seguridad  definidas en el fichero web.xml. Las peticiones HTTP pueden ser  protegidas por una serie de &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos29/introduccion-expresiones-regulares/introduccion-expresiones-regulares.shtml&quot; id=&quot;autolink&quot;&gt;expresiones regulares&lt;/a&gt;  que definen expresiones de caminos de acceso, así como para la  autenticación, autorización y gestores de reemplazo de credenciales para  la ejecución como otro usuario, todo ello totalmente configurable.&lt;br /&gt;
Además, el sistema de seguridad puede redirigir automáticamente las  peticiones a un canal de transmisión adecuado. Comúnmente esto se aplica  para asegurar que las páginas seguras estarán sólo disponibles sobre  HTTPS, y las páginas públicas sobre HTTP, aunque es suficientemente  flexible para soportar cualquier tipo de requisitos de &quot;canal&quot;. &lt;br /&gt;
&lt;a href=&quot;http://draft.blogger.com/blogger.g?blogID=7813956266500130511&quot; name=&quot;conclusioa&quot;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;h2&gt;
&lt;a href=&quot;http://draft.blogger.com/blogger.g?blogID=7813956266500130511&quot; name=&quot;conclusioa&quot;&gt;&lt;b&gt;&lt;i&gt;Conclusiones&lt;/i&gt;&lt;/b&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;a href=&quot;http://draft.blogger.com/blogger.g?blogID=7813956266500130511&quot; name=&quot;conclusioa&quot;&gt; &lt;/a&gt;&lt;br /&gt;
Las tecnologías modernas y el avance en la &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos/objetos/objetos.shtml&quot; id=&quot;autolink&quot;&gt;programación orientada a objetos&lt;/a&gt;, aspectos y a servicios, o sea llámese, diferentes perspectivas de abordar el tema unido al creciente auge de &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/Computacion/Internet/&quot; id=&quot;autolink&quot;&gt;Internet&lt;/a&gt;  hace que las aplicaciones del presente y del futuro se orienten cada  vez más a la web y al mundo de Internet, por varias razones: facilidad  de uso, necesidad de pocas &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos15/cumplimiento-defectuoso/cumplimiento-defectuoso.shtml#INCUMPL&quot; id=&quot;autolink&quot;&gt;prestaciones&lt;/a&gt; de hardware y software para manipular tal aplicación y otras. &lt;br /&gt;
Dentro de este mundo, las tecnologías de desarrollo y programación de  software han evolucionado a paso rápido y Java, una herramienta de gran  expansión mundial y que cuenta con una inmensa comunidad de  desarrolladores no está exenta de proponer muchas variantes y  alternativas válidas para realizar aplicaciones de este tipo. La curva  de &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos5/teap/teap.shtml&quot; id=&quot;autolink&quot;&gt;aprendizaje&lt;/a&gt;  y sobre todo el ensamblaje de todas estas tecnologías resulta ser algo  que requiere de manos expertas y conocedoras del tema pero una vez que  se logran establecer los marcos de trabajo y las herramientas se  configuran para su buen uso y trabajo, la programación con  Java  orientado a aplicaciones web resulta ser algo relativamente sencillo y  práctico y se convierte en una herramienta de trabajo muy útil para el  desarrollo de aplicaciones.&lt;br /&gt;
&lt;a href=&quot;http://draft.blogger.com/blogger.g?blogID=7813956266500130511&quot; name=&quot;bibliograa&quot;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;h2&gt;
&lt;a href=&quot;http://draft.blogger.com/blogger.g?blogID=7813956266500130511&quot; name=&quot;bibliograa&quot;&gt;&lt;b&gt;&lt;i&gt;Bibliografía utilizada&lt;/i&gt;&lt;/b&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;a href=&quot;http://draft.blogger.com/blogger.g?blogID=7813956266500130511&quot; name=&quot;bibliograa&quot;&gt; &lt;/a&gt;&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;div align=&quot;left&quot;&gt;
Agüero, Martín. &lt;i&gt;Introducción a Spring Framework. &lt;/i&gt;UP: Universidad de Palermo. Facultad de &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos14/historiaingenieria/historiaingenieria.shtml&quot; id=&quot;autolink&quot;&gt;Ingeniería&lt;/a&gt;.  [En línea] octubre de 2007. [Citado el: 31 de abril de 2009.]  http://www.palermo.edu/ingenieria/downloads/introduccion_spring_framework_v1.0.pdf.  version 1.0.&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;div align=&quot;left&quot;&gt;
Albin, Stephen. &lt;i&gt;The Art of Software Architecture: Design methods and techniques. &lt;/i&gt;Nueva YorkÂ ; Wiley, 2003.&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;div align=&quot;left&quot;&gt;
Alur, D.; Crupi, J. y Malks, D. &lt;i&gt;Core J2EE Patterns, Best Practices and Design Strategies. . &lt;/i&gt;s.l. ; Pretince Hall, 2001.&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;div align=&quot;left&quot;&gt;
Bagüés, Ramiro Lago. Proactiva &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos11/conge/conge.shtml&quot; id=&quot;autolink&quot;&gt;Calidad&lt;/a&gt;  - Framework Spring. [En línea] mayo de 2009. [Citado el: 1 de junio de  2009.] http://www.proactiva-calidad.com/java/spring/index.html.&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;div align=&quot;left&quot;&gt;
Bosch, Jan. 2000. &lt;i&gt;Design and use of Software Architecture. &lt;/i&gt;s.l.Â ; Addison-Wesley, 2000.&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;div align=&quot;left&quot;&gt;
Campo, Miguel Ángel Manzanedo del, y otros. UBU  - Guía de Iniciación al Lenguaje Java. [En línea] Universidad de Burgos  , 19 de septiembre de 1999. [Citado el: 25 de mayo de 2009.]  http://pisuerga.inf.ubu.es/lsi/Invest/Java/Tuto/Index.htm.&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;div align=&quot;left&quot;&gt;
Fielding, Roy Thomas ; &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos7/freta/freta.shtml&quot; id=&quot;autolink&quot;&gt;Taylor&lt;/a&gt;, Richard. &lt;i&gt;Principled design of the modern Web architecture. &lt;/i&gt;s.l.Â ; ACM Transactions on Internet Technologies, 2002. 2(2), pp. 115-150.&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;div align=&quot;left&quot;&gt;
García, Sergio Campos. Hibernate. [En línea].  [Citado el: 14 de abril de 2009.]  http://md2.dei.inf.uc3m.es:8000/PA/Practicas/Exposiciones%20(2006)/Hibernate.ppt&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;div align=&quot;left&quot;&gt;
Marañón, Gonzalo Álvarez. Departamento de Tratamiento de la &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos7/sisinf/sisinf.shtml&quot; id=&quot;autolink&quot;&gt;Información&lt;/a&gt; y &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos37/codificacion/codificacion.shtml&quot; id=&quot;autolink&quot;&gt;Codificación&lt;/a&gt; - Qué es Java? [En línea] [Citado el: 26 de mayo de 2009.] http://www.iec.csic.es/CRIPTONOMICON/java/funcionamiento.html.&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;div align=&quot;left&quot;&gt;
Microsystem, Sun. Java en &lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos5/oriespa/oriespa.shtml&quot; id=&quot;autolink&quot;&gt;Castellano&lt;/a&gt;. [En línea] [Citado el: 17 de marzo de 2009.] http://www.programacion.net/java/tutorial/patrones2/0/.&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;div align=&quot;left&quot;&gt;
MyFaces. MyFaces Apache. [En línea] [Citado el: 11 de mayo de 2009.] http://myfaces.apache.org/index.html.&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;div align=&quot;left&quot;&gt;
Ajax4JSF. MyFaces Apache. [En línea]. [Citado el: 1 de junio de 2009.] http://www.adictosaltrabajo.com/&lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/cgi-bin/search.cgi?substring=0&amp;amp;bool=and&amp;amp;query=tutoriales&quot; id=&quot;autolink&quot;&gt;tutoriales&lt;/a&gt;/tutoriales.&lt;a class=&quot;autolink&quot; href=&quot;http://www.monografias.com/trabajos11/winnet/winnet.shtml&quot; id=&quot;autolink&quot;&gt;php&lt;/a&gt;?pagina=Ajax4Jsf &lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;div align=&quot;left&quot;&gt;
Spring – Wikipedia.[En línea]. [Citado el: 26 de mayo de 2009.] http://es.wikipedia.org/wiki/Spring&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;div align=&quot;left&quot;&gt;
JSP – Wikipedia [En línea]. [Citado el: 29 de mayo de 2009.]&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div align=&quot;left&quot;&gt;
http://es.wikipedia.org/wiki/JSP&lt;/div&gt;
&lt;div align=&quot;left&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;</description><link>http://littlebitzltm.blogspot.com/2011/10/aplicaciones-web-con-java-pagina-2.html</link><author>noreply@blogger.com (littlebitz)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7813956266500130511.post-6205750668768917133</guid><pubDate>Thu, 13 Oct 2011 14:15:00 +0000</pubDate><atom:updated>2012-10-04T17:46:01.269+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">classes</category><category domain="http://www.blogger.com/atom/ns#">java</category><category domain="http://www.blogger.com/atom/ns#">JavaServer</category><title>jGuru: JavaServer Pages Fundamentals, Short Course Contents</title><description>&lt;h4&gt;
Course Outline&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://192.9.162.55/developer/onlineTraining/JSPIntro/contents.html#Introduction&quot;&gt;Introduction&lt;/a&gt;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://192.9.162.55/developer/onlineTraining/JSPIntro/contents.html#JSPIntro0&quot;&gt;JSP Advantages&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://192.9.162.55/developer/onlineTraining/JSPIntro/contents.html#JSPIntro1&quot;&gt;Comparing JSP with ASP&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://192.9.162.55/developer/onlineTraining/JSPIntro/contents.html#JSPIntro2&quot;&gt;JSP or Servlets?&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;&lt;a href=&quot;http://192.9.162.55/developer/onlineTraining/JSPIntro/contents.html#JSPIntro3&quot;&gt;JSP Architecture&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://192.9.162.55/developer/onlineTraining/JSPIntro/contents.html#JSPIntro4&quot;&gt;JSP Access Models&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://192.9.162.55/developer/onlineTraining/JSPIntro/contents.html#JSPIntro6&quot;&gt;JSP Syntax Basics&lt;/a&gt;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://192.9.162.55/developer/onlineTraining/JSPIntro/contents.html#JSPIntro6_1&quot;&gt;Directives&lt;/a&gt;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://192.9.162.55/developer/onlineTraining/JSPIntro/contents.html#JSPIntro6_1_1&quot;&gt;Page Directive&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://192.9.162.55/developer/onlineTraining/JSPIntro/contents.html#JSPIntro6_1_2&quot;&gt;Include Directive&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;&lt;a href=&quot;http://192.9.162.55/developer/onlineTraining/JSPIntro/contents.html#JSPIntro6_2&quot;&gt;Declarations&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://192.9.162.55/developer/onlineTraining/JSPIntro/contents.html#JSPIntro6_3&quot;&gt;Expressions&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://192.9.162.55/developer/onlineTraining/JSPIntro/contents.html#JSPIntro6_4&quot;&gt;Scriptlets&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://192.9.162.55/developer/onlineTraining/JSPIntro/contents.html#JSPIntro6_5&quot;&gt;Comments&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;&lt;a href=&quot;http://192.9.162.55/developer/onlineTraining/JSPIntro/contents.html#JSPIntro5&quot;&gt;Object Scopes&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://192.9.162.55/developer/onlineTraining/JSPIntro/contents.html#JSPIntro5_1&quot;&gt;JSP Implicit Objects&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://192.9.162.55/developer/onlineTraining/JSPIntro/contents.html#JSPIntro7&quot;&gt;Synchronization Issues&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://192.9.162.55/developer/onlineTraining/JSPIntro/contents.html#JSPIntro8&quot;&gt;Exception Handling&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://192.9.162.55/developer/onlineTraining/JSPIntro/contents.html#JSPIntro9&quot;&gt;Session Management&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://192.9.162.55/developer/onlineTraining/JSPIntro/contents.html#JSPIntro10&quot;&gt;Standard Actions&lt;/a&gt;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://192.9.162.55/developer/onlineTraining/JSPIntro/contents.html#JSPIntro11&quot;&gt;Using JavaBean Components&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://192.9.162.55/developer/onlineTraining/JSPIntro/contents.html#JSPIntro12&quot;&gt;Forwarding Requests&lt;/a&gt;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://192.9.162.55/developer/onlineTraining/JSPIntro/contents.html#JSPIntro121&quot;&gt;Request Chaining&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;&lt;a href=&quot;http://192.9.162.55/developer/onlineTraining/JSPIntro/contents.html#JSPIntro13&quot;&gt;Including Requests&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://192.9.162.55/developer/onlineTraining/JSPIntro/contents.html#websites&quot;&gt;Web Sites&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://192.9.162.55/developer/onlineTraining/JSPIntro/contents.html#documentation&quot;&gt;Documentation and Specs&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://192.9.162.55/developer/onlineTraining/JSPIntro/contents.html#articles&quot;&gt;Articles&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;h3&gt;
&lt;a href=&quot;http://draft.blogger.com/blogger.g?blogID=7813956266500130511&quot; name=&quot;Introduction&quot;&gt;Introduction&lt;/a&gt;&lt;/h3&gt;
While there are numerous technologies for building web applications that serve dynamic  content, the one that has really caught the attention of the development community is  JavaServer Pages (JSP).  And not without ample reason either. JSP not only enjoys cross-platform and cross-Web-server  support, but effectively melds the power of server-side Java technology with the WYSIWYG  features of static HTML pages.  &lt;br /&gt;
JSP pages typically comprise of: &lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Static HTML/XML components.&lt;/li&gt;
&lt;li&gt;Special JSP tags &lt;/li&gt;
&lt;li&gt;Optionally, snippets of code written in the Java programming language called &quot;scriptlets.&quot; &lt;/li&gt;
&lt;/ul&gt;
Consequently, you can create and maintain JSP pages by conventional HTML/XML tools.  &lt;br /&gt;
It is important to note that the JSP specification is a standard extension defined  on top of the Servlet API. Thus, it leverages all of your experience with servlets. &lt;br /&gt;
There are significant differences between JSP and servlet technology. Unlike servlets,  which is a programmatic technology requiring significant developer expertise, JSP appeals  to a much wider audience. It can be used not only by developers, but also by page designers,  who can now play a more direct role in the development life cycle.  &lt;br /&gt;
Another advantage of JSP is the inherent separation of presentation from content facilitated  by the technology, due its reliance upon reusable component technologies like the  JavaBeans component architecture and Enterprise  JavaBeans technology. This course provides you with  an in-depth introduction to this versatile technology, and uses  the &lt;a href=&quot;http://jakarta.apache.org/tomcat/&quot;&gt;Tomcat&lt;/a&gt; JSP 1.1 Reference Implementation  from the Apache group for running the example programs.  &lt;br /&gt;
&lt;h4&gt;
&lt;a href=&quot;http://draft.blogger.com/blogger.g?blogID=7813956266500130511&quot; name=&quot;JSPIntro0&quot;&gt;JSP Advantages&lt;/a&gt;&lt;/h4&gt;
&lt;i&gt;Separation of static from dynamic content&lt;/i&gt;: With servlets, the logic for generation  of the dynamic content is an intrinsic part of the servlet itself, and is closely tied to the  static presentation templates responsible for the user interface. Thus, even minor changes made  to the UI typically result in the recompilation of the servlet. This tight coupling of presentation  and content results in brittle, inflexible applications. However, with JSP, the logic to generate the  dynamic content is kept separate from the static presentation templates by encapsulating it within  external JavaBeans components. These are then created and used by the JSP page using special tags  and scriptlets. When a page designer makes any changes to the presentation template, the JSP page is automatically recompiled and reloaded into the web server by the JSP engine. &lt;br /&gt;
&lt;i&gt;Write Once Run Anywhere&lt;/i&gt;: JSP technology brings the &quot;Write Once, Run Anywhere&quot; paradigm  to interactive Web pages. JSP pages can be moved easily across platforms, and across web servers, without any changes. &lt;br /&gt;
&lt;i&gt;Dynamic content can be served in a variety of formats&lt;/i&gt;: There is nothing that mandates the  static template data within a JSP page to be of a certain format. Consequently, JSP can service  a diverse clientele ranging from conventional browsers using HTML/DHTML, to handheld wireless  devices like mobile phones and PDAs using WML, to other B2B applications using XML. &lt;br /&gt;
&lt;i&gt;Recommended Web access layer for n-tier  architecture&lt;/i&gt;: &lt;a href=&quot;http://192.9.162.55/reference/blueprints/&quot;&gt;Sun&#39;s J2EE Blueprints&lt;/a&gt;,  which offers guidelines for developing large-scale applications using the enterprise Java APIs, categorically  recommends JSP over servlets for serving dynamic content. &lt;br /&gt;
&lt;i&gt;Completely leverages the Servlet API&lt;/i&gt;: If you are a servlet developer, there is very little  that you have to &quot;unlearn&quot; to move over to JSP. In fact, servlet developers are at a distinct advantage  because JSP is nothing but a high-level abstraction of servlets. You can do almost anything that can be done with servlets using JSP--but more easily! &lt;br /&gt;
&lt;h4&gt;
&lt;a href=&quot;http://draft.blogger.com/blogger.g?blogID=7813956266500130511&quot; name=&quot;JSPIntro1&quot;&gt;Comparing JSP with ASP&lt;/a&gt;&lt;/h4&gt;
Although the features offered by JSP may seem similar to that offered by  Microsoft&#39;s Active Server Pages (ASP), they are fundamentally different technologies, as shown by the following table: &lt;br /&gt;
&lt;table border=&quot;1&quot; cellpadding=&quot;2&quot; cellspacing=&quot;1&quot; style=&quot;width: 100%px;&quot;&gt; &lt;tbody&gt;
&lt;tr&gt; &lt;td valign=&quot;MIDDLE&quot; width=&quot;20%&quot;&gt;&lt;br /&gt;&lt;/td&gt; &lt;td valign=&quot;MIDDLE&quot; width=&quot;30%&quot;&gt;JavaServer Pages&lt;/td&gt; &lt;td valign=&quot;MIDDLE&quot; width=&quot;50%&quot;&gt;Active Server Pages&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;LEFT&quot; valign=&quot;MIDDLE&quot;&gt;Web Server Support&lt;/td&gt; &lt;td align=&quot;LEFT&quot; valign=&quot;MIDDLE&quot;&gt;Most popular web servers including Apache, Netscape, and Microsoft IIS can be easily enabled with JSP.&lt;/td&gt; &lt;td align=&quot;LEFT&quot; valign=&quot;MIDDLE&quot;&gt;Native support only within Microsoft IIS or Personal Web Server. Support for select servers using third-party products.&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;LEFT&quot; valign=&quot;MIDDLE&quot;&gt;Platform Support&lt;/td&gt; &lt;td align=&quot;LEFT&quot; valign=&quot;MIDDLE&quot;&gt;Platform independent. Runs on all Java-enabled platforms.&lt;/td&gt; &lt;td align=&quot;LEFT&quot; valign=&quot;MIDDLE&quot;&gt;Is fully supported under Windows. Deployment on other platforms is cumbersome due to reliance  on the Win32-based component model.&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;LEFT&quot; valign=&quot;MIDDLE&quot;&gt;Component Model&lt;/td&gt; &lt;td align=&quot;LEFT&quot; valign=&quot;MIDDLE&quot;&gt;Relies on reusable, cross-platform components like JavaBeans, Enterprise JavaBeans, and custom tag libraries.&lt;/td&gt; &lt;td align=&quot;LEFT&quot; valign=&quot;MIDDLE&quot;&gt;Uses the Win32-based COM component model.&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;LEFT&quot; valign=&quot;MIDDLE&quot;&gt;Scripting&lt;/td&gt; &lt;td align=&quot;LEFT&quot; valign=&quot;MIDDLE&quot;&gt;Can use the Java programming language or JavaScript.&lt;/td&gt; &lt;td align=&quot;LEFT&quot; valign=&quot;MIDDLE&quot;&gt;Supports VBScript and JScript for scripting.&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;LEFT&quot; valign=&quot;MIDDLE&quot;&gt;Security&lt;/td&gt; &lt;td align=&quot;LEFT&quot; valign=&quot;MIDDLE&quot;&gt;Works with the Java security model.&lt;/td&gt; &lt;td align=&quot;LEFT&quot; valign=&quot;MIDDLE&quot;&gt;Can work with the Windows NT security architecture.&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;LEFT&quot; valign=&quot;MIDDLE&quot;&gt;Database Access&lt;/td&gt; &lt;td align=&quot;LEFT&quot; valign=&quot;MIDDLE&quot;&gt;Uses JDBC for data access.&lt;/td&gt; &lt;td align=&quot;LEFT&quot; valign=&quot;MIDDLE&quot;&gt;Uses Active Data Objects for data access.&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align=&quot;LEFT&quot; valign=&quot;MIDDLE&quot;&gt;Customizable Tags&lt;/td&gt; &lt;td align=&quot;LEFT&quot; valign=&quot;MIDDLE&quot;&gt;JSP is extensible with custom tag libraries.&lt;/td&gt; &lt;td align=&quot;LEFT&quot; valign=&quot;MIDDLE&quot;&gt;Cannot use custom tag libraries and is not extensible.&lt;/td&gt; &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;h4&gt;
&lt;a href=&quot;http://draft.blogger.com/blogger.g?blogID=7813956266500130511&quot; name=&quot;JSPIntro2&quot;&gt;JSP or Servlets?&lt;/a&gt;&lt;/h4&gt;
It is true that both servlets and JSP pages have many features in common, and can be used  for serving up dynamic web content. Naturally, this may cause some confusion as to when to  opt for one of the technologies over the other. Luckily, Sun&#39;s  J2EE &lt;a href=&quot;http://192.9.162.55/reference/blueprints/&quot;&gt;Blueprints&lt;/a&gt; offers some guidelines towards this. &lt;br /&gt;
According to the Blueprints, use servlets strictly as a web server extension technology. This could  include the implementation of specialized controller components offering services like authentication,  database validation, and so forth. It is interesting to note that what is commonly known as the &quot;JSP engine&quot; itself is a specialized servlet running under the control of the servlet engine.  Since JSP only deals with textual data, you will have to continue to use servlets when communicating with Java  applets and applications. &lt;br /&gt;
Use JSP to develop typical web applications that rely upon dynamic content. JSP should also be used in  place of proprietary web server extensions like server-side includes as it offers excellent features for  handling repetitive content. &lt;br /&gt;
&lt;h3&gt;
Exercise&lt;/h3&gt;
&lt;blockquote&gt;
&lt;ol start=&quot;1&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://192.9.162.55/developer/onlineTraining/JSPIntro/exercises/SetupTomcat/index.html&quot;&gt;Installing and Configuring Tomcat&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/blockquote&gt;
&lt;h3&gt;
&lt;a href=&quot;http://draft.blogger.com/blogger.g?blogID=7813956266500130511&quot; name=&quot;JSPIntro3&quot;&gt;JSP Architecture&lt;/a&gt;&lt;/h3&gt;
The purpose of JSP is to provide a declarative, presentation-centric method of developing servlets. As  noted before, the JSP specification itself is defined as a standard extension on top the Servlet API.  Consequently, it should not be too surprisingly that under the covers, servlets and JSP pages have a lot in common. &lt;br /&gt;
Typically, JSP pages are subject to a translation phase and a request processing phase. The translation  phase is carried out only once, unless the JSP page changes, in which case it is repeated. Assuming there  were no syntax errors within the page, the result is a JSP page implementation class file that implements  the Servlet interface, as shown below.  &lt;br /&gt;
&lt;div align=&quot;center&quot;&gt;
&lt;img alt=&quot;[JSP Translation Phase]&quot; height=&quot;287&quot; src=&quot;http://192.9.162.55/developer/onlineTraining/JSPIntro/images/translation.GIF&quot; width=&quot;393&quot; /&gt; &lt;/div&gt;
The translation phase is typically carried out by the JSP engine itself, when it receives an  incoming request for the JSP page for the first time. Note that the JSP 1.1 specification also  allows for JSP pages to be precompiled into class files. Precompilation may be especially useful  in removing the start-up lag that occurs when a JSP page delivered in source form  receives the first request from a client. Many details of the translation phase, like the location  where the source and class files are stored are implementation dependent. The source for the class  file generated by Tomcat for this example JSP page (shown in the above figure) is as follows: &lt;br /&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;10&quot; cellspacing=&quot;0&quot; class=&quot;grey4&quot; style=&quot;width: 100%px;&quot;&gt; &lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;pre&gt;package jsp;  import javax.servlet.*; import javax.servlet.http.*; import javax.servlet.jsp.*; import javax.servlet.jsp.tagext.*; import java.io.PrintWriter; import java.io.IOException; import java.io.FileInputStream; import java.io.ObjectInputStream; import java.util.Vector; import org.apache.jasper.runtime.*; import java.beans.*; import org.apache.jasper.JasperException; import java.text.*; import  java.util.*;  public class _0005cjsp_0005cjsptest_0002ejspjsptest_jsp_0   extends HttpJspBase {   static {  }  public _0005cjsp_0005cjsptest_0002ejspjsptest_jsp_0( ) {  }   private static boolean _jspx_inited = false;  public final void _jspx_init() throws JasperException {  }   public void _jspService(HttpServletRequest request,     HttpServletResponse  response)       throws IOException, ServletException {       JspFactory _jspxFactory = null;      PageContext pageContext = null;      HttpSession session = null;      ServletContext application = null;      ServletConfig config = null;      JspWriter out = null;      Object page = this;      String  _value = null;      try {           if (_jspx_inited == false) {              _jspx_init();              _jspx_inited = true;          }          _jspxFactory = JspFactory.getDefaultFactory();          response.setContentType(&quot;text/html&quot;);          pageContext = _jspxFactory.getPageContext(this,           request,response, &quot;&quot;, true, 8192, true);           application = pageContext.getServletContext();          config = pageContext.getServletConfig();          session = pageContext.getSession();          out = pageContext.getOut();          // begin          out.write(&quot;\r\n\r\n\r\n&quot;);         // end         // begin [file=&quot;E:\\jsp\\jsptest.jsp&quot;;from=(3,2);to=(5,0)]         Date d = new Date();         String today =  DateFormat.getDateInstance().format(d);         // end         // begin         out.write(&quot;\r\nToday is: \r\n&lt;i&gt; &quot;);         // end         // begin [file=&quot;E:\\jsp\\jsptest.jsp&quot;;from=(7,8);to=(7,13)]         out.print(today);         // end         // begin         out.write(&quot; &lt;/i&gt;\r\n\r\n\r\n&quot;);         // end     } catch (Exception ex) {        if (out.getBufferSize() != 0)        out.clear();        pageContext.handlePageException(ex);     } finally {        out.flush();        _jspxFactory.releasePageContext(pageContext);     }   } } &lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;span class=&quot;sp20&quot;&gt; &lt;/span&gt;
&lt;br /&gt;
The JSP page implementation class file extends &lt;code&gt;HttpJspBase&lt;/code&gt;, which in turn implements  the &lt;code&gt;Servlet&lt;/code&gt; interface. Observe how the service method of this class,  &lt;code&gt;_jspService()&lt;/code&gt;, essentially inlines the contents of the JSP page.  Although &lt;code&gt;_jspService()&lt;/code&gt; cannot be overridden, the developer can describe  initialization and destroy events by providing implementations for the &lt;code&gt;jspInit()&lt;/code&gt; and  &lt;code&gt;jspDestroy()&lt;/code&gt; methods within their JSP pages. &lt;br /&gt;
Once this class file is loaded within the servlet container, the &lt;code&gt;_jspService()&lt;/code&gt; method is   responsible for replying to a client&#39;s request. By default, the &lt;code&gt;_jspService()&lt;/code&gt; method is  dispatched on a separate thread by the servlet container in processing concurrent client requests, as  shown below: &lt;br /&gt;
&lt;div align=&quot;center&quot;&gt;
&lt;img alt=&quot;[JSP Request Processing Phase]&quot; height=&quot;286&quot; src=&quot;http://192.9.162.55/developer/onlineTraining/JSPIntro/images/reqprocess.GIF&quot; width=&quot;460&quot; /&gt; &lt;/div&gt;
&lt;h3&gt;
&lt;a href=&quot;http://draft.blogger.com/blogger.g?blogID=7813956266500130511&quot; name=&quot;JSPIntro4&quot;&gt;JSP Access Models&lt;/a&gt;&lt;/h3&gt;
The early JSP specifications advocated two philosophical approaches, popularly known as Model 1 and Model 2 architectures, for applying JSP technology. These  approaches differ essentially in the location at which the bulk of the request processing  was performed, and offer a useful paradigm for building applications using JSP technology.  &lt;br /&gt;
Consider the Model 1 architecture, shown below: &lt;br /&gt;
&lt;div align=&quot;center&quot;&gt;
&lt;img alt=&quot;[Model1 Architecture]&quot; height=&quot;277&quot; src=&quot;http://192.9.162.55/developer/onlineTraining/JSPIntro/images/model1.GIF&quot; width=&quot;558&quot; /&gt; &lt;/div&gt;
In the Model 1 architecture, the incoming request from a web browser is sent  directly to the JSP page, which is responsible for processing it and replying back  to the client. There is still separation of presentation from content, because all  data access is performed using beans.  &lt;br /&gt;
Although the Model 1 architecture is suitable for simple applications, it may not be  desirable for complex implementations. Indiscriminate usage of this architecture usually  leads to a significant amount of scriptlets or Java code embedded within the JSP page,  especially if there is a significant amount of request processing to be performed. While  this may not seem to be much of a problem for Java developers, it is certainly an issue if  your JSP pages are created and maintained by designers--which is usually the norm on large  projects. Another downside of this architecture is that each of the JSP pages must be individually  responsible for managing application state and verifying authentication and security.  &lt;br /&gt;
&lt;div align=&quot;center&quot;&gt;
&lt;img alt=&quot;Model2 Architecture&quot; height=&quot;321&quot; src=&quot;http://192.9.162.55/developer/onlineTraining/JSPIntro/images/model2.GIF&quot; width=&quot;570&quot; /&gt; &lt;/div&gt;
The Model 2 architecture, shown above, is a server-side implementation of the popular  Model/View/Controller design pattern. Here, the processing is divided between presentation and  front components. Presentation components are JSP pages that generate the HTML/XML response that  determines the user interface when rendered by the browser. Front components (also known as controllers) do not handle any presentation issues, but rather, process all the HTTP requests. Here,  they are responsible for creating any beans or objects used by the presentation components, as well  as deciding, depending on the user&#39;s actions, which presentation component to forward the request to.  Front components can be implemented as either a servlet or JSP page.  &lt;br /&gt;
The advantage of this architecture is that there is no processing logic within the  presentation component itself; it is simply responsible for retrieving any objects or beans that may have  been previously created by the controller, and extracting the dynamic content within for insertion within  its static templates. Consequently, this clean separation of presentation from content leads to a  clear delineation of the roles and responsibilities of the developers and page designers on the programming  team. Another benefit of this approach is that the front components present a single point of entry into the  application, thus making the management of application state, security, and presentation uniform and easier  to maintain. &lt;br /&gt;
&lt;h3&gt;
&lt;a href=&quot;http://draft.blogger.com/blogger.g?blogID=7813956266500130511&quot; name=&quot;JSPIntro6&quot;&gt;JSP Syntax Basics&lt;/a&gt;&lt;/h3&gt;
JSP syntax is fairly straightforward, and can be classified into directives, scripting  elements, and standard actions. &lt;br /&gt;
&lt;h4&gt;
&lt;a href=&quot;http://draft.blogger.com/blogger.g?blogID=7813956266500130511&quot; name=&quot;JSPIntro6_1&quot;&gt;Directives&lt;/a&gt;&lt;/h4&gt;
JSP directives are messages for the JSP engine. They do not directly produce any visible output,  but tell the engine what to do with the rest of the JSP page. JSP directives are always enclosed  within the&lt;code&gt; &amp;lt;%@ ... %&amp;gt; &lt;/code&gt;tag. The two primary directives are &lt;code&gt;page&lt;/code&gt;  and &lt;code&gt;include&lt;/code&gt;. (Note that JSP 1.1 also provides the &lt;code&gt;taglib&lt;/code&gt; directive, which  can be used for working with custom tag libraries, although this isn&#39;t discussed here.)  &lt;br /&gt;
&lt;h5&gt;
&lt;a href=&quot;http://draft.blogger.com/blogger.g?blogID=7813956266500130511&quot; name=&quot;JSPIntro6_1_1&quot;&gt;Page Directive&lt;/a&gt;&lt;/h5&gt;
Typically, the &lt;code&gt;page&lt;/code&gt; directive is found at the top of almost all of your JSP pages.  There can be any number of &lt;code&gt;page&lt;/code&gt; directives within a JSP page, although the attribute/value pair  must be unique. Unrecognized attributes or values result in a translation error. For example,  &lt;br /&gt;
&lt;pre&gt;&amp;lt;%@ page import=&quot;java.util.*, com.foo.*&quot; buffer=&quot;16k&quot; %&amp;gt;  &lt;/pre&gt;
makes available the types declared within the included packages for scripting and sets the page buffering to 16K. &lt;br /&gt;
&lt;h5&gt;
&lt;a href=&quot;http://draft.blogger.com/blogger.g?blogID=7813956266500130511&quot; name=&quot;JSPIntro6_1_2&quot;&gt;Include Directive&lt;/a&gt;&lt;/h5&gt;
The &lt;code&gt;include&lt;/code&gt; directive lets you separate your content into more  manageable elements, such as those for including a common page header or footer.  The page included can be a static HTML page or more JSP content. For example, the directive: &lt;br /&gt;
&lt;pre&gt;&amp;lt;%@ include file=&quot;copyright.html&quot; %&amp;gt; &lt;/pre&gt;
can be used to include the contents of the indicated file at any location within the JSP page. &lt;br /&gt;
&lt;h4&gt;
&lt;a href=&quot;http://draft.blogger.com/blogger.g?blogID=7813956266500130511&quot; name=&quot;JSPIntro6_2&quot;&gt;Declarations&lt;/a&gt;&lt;/h4&gt;
JSP declarations let you define page-level variables to save information or define supporting methods  that the rest of a JSP page may need. While it is easy to get led away and have a lot of code within  your JSP page, this move will eventually turn out to be a maintenance nightmare. For that reason, and  to improve reusability, it is best that logic-intensive processing is encapsulated as JavaBean components.  &lt;br /&gt;
Declarations are found within the &lt;code&gt;&amp;lt;%! ... %&amp;gt;&lt;/code&gt; tag. Always end variable declarations  with a semicolon, as any content must be valid Java statements:  &lt;br /&gt;
&lt;pre&gt;&amp;lt;%! int i=0; %&amp;gt; &lt;/pre&gt;
You can also declare methods. For example, you can override the initialization event in the JSP life  cycle by declaring: &lt;br /&gt;
&lt;pre&gt;&amp;lt;%! public void jspInit() {  //some initialization code      } %&amp;gt; &lt;/pre&gt;
&lt;h4&gt;
&lt;a href=&quot;http://draft.blogger.com/blogger.g?blogID=7813956266500130511&quot; name=&quot;JSPIntro6_3&quot;&gt;Expressions&lt;/a&gt;&lt;/h4&gt;
With expressions in JSP, the results of evaluating the expression are converted to a string and  directly included within the output page. Typically expressions are used to display simple values  of variables or return values by invoking a bean&#39;s getter methods. JSP expressions begin within  &lt;code&gt;&amp;lt;%= ... %&amp;gt;&lt;/code&gt; tags and do not include semicolons: &lt;br /&gt;
&lt;pre&gt; &amp;lt;%= fooVariable %&amp;gt;  &amp;lt;%= fooBean.getName() %&amp;gt; &lt;/pre&gt;
&lt;h4&gt;
&lt;a href=&quot;http://draft.blogger.com/blogger.g?blogID=7813956266500130511&quot; name=&quot;JSPIntro6_4&quot;&gt;Scriptlets&lt;/a&gt;&lt;/h4&gt;
JSP code fragments or scriptlets are embedded within &lt;code&gt;&amp;lt;% ... %&amp;gt;&lt;/code&gt; tags. This  Java code is run when the request is serviced by the JSP page. You can have just about any valid  Java code within a scriptlet, and is not limited to one line of source code. For example, the following  displays the string &quot;Hello&quot; within H1, H2, H3, and H4 tags, combining the use of expressions and scriptlets: &lt;br /&gt;
&lt;pre&gt;&amp;lt;% for (int i=1; i&amp;lt;=4; i++) { %&amp;gt;     &lt;h i=&quot;i&quot;&gt;&amp;gt;Hello&lt;/h&gt;&amp;gt; &amp;lt;% } %&amp;gt; &lt;/pre&gt;
&lt;h4&gt;
&lt;a href=&quot;http://draft.blogger.com/blogger.g?blogID=7813956266500130511&quot; name=&quot;JSPIntro6_5&quot;&gt;Comments&lt;/a&gt;&lt;/h4&gt;
Although you can always include HTML comments in JSP pages, users can view these if they  view the page&#39;s source. If you don&#39;t want users to be able to see your comments, embed them  within the &lt;code&gt;&amp;lt;%-- ... --%&amp;gt;&lt;/code&gt; tag: &lt;br /&gt;
&lt;pre&gt;&amp;lt;%-- comment for server side only --%&amp;gt; &lt;/pre&gt;
A most useful feature of JSP comments is that they can be used to selectively block out  scriptlets or tags from compilation. Thus, they can play a significant role during the  debugging and testing process. &lt;br /&gt;
&lt;h3&gt;
&lt;a href=&quot;http://draft.blogger.com/blogger.g?blogID=7813956266500130511&quot; name=&quot;JSPIntro5&quot;&gt;Object Scopes&lt;/a&gt;&lt;/h3&gt;
Before we look at JSP syntax and semantics, it is important to understand the scope or visibility  of Java objects within JSP pages that are processing a request. Objects may be created implicitly  using JSP directives, explicitly through actions, or, in rare cases, directly using scripting code.  The instantiated objects can be associated with a scope attribute defining where there is a reference  to the object and when that reference is removed. The following diagram indicates the various scopes  that can be associated with a newly created object: &lt;br /&gt;
&lt;div align=&quot;center&quot;&gt;
&lt;img alt=&quot;[JSP Object Scopes]&quot; height=&quot;273&quot; src=&quot;http://192.9.162.55/developer/onlineTraining/JSPIntro/images/scopes.GIF&quot; width=&quot;573&quot; /&gt; &lt;/div&gt;
&lt;h3&gt;
&lt;a href=&quot;http://draft.blogger.com/blogger.g?blogID=7813956266500130511&quot; name=&quot;JSPIntro5_1&quot;&gt;JSP Implicit Objects&lt;/a&gt;&lt;/h3&gt;
As a convenience feature, the JSP container makes available implicit objects that  can be used within scriptlets and expressions, without the page author first having to  create them. These objects act as wrappers around underlying Java classes or interfaces  typically defined within the Servlet API. The nine implicit objects: &lt;br /&gt;
&lt;ul&gt;
&lt;li&gt; request: represents the &lt;code&gt;&lt;a href=&quot;http://192.9.162.55/products/servlet/2.2/javadoc/javax/servlet/http/HttpServletRequest.html&quot;&gt;HttpServletRequest&lt;/a&gt;&lt;/code&gt; triggering the service invocation. Request scope.&lt;/li&gt;
&lt;li&gt; response: represents &lt;code&gt;&lt;a href=&quot;http://192.9.162.55/products/servlet/2.2/javadoc/javax/servlet/http/HttpServletResponse.html&quot;&gt;HttpServletResponse&lt;/a&gt;&lt;/code&gt; to the request. Not used often by page authors. Page scope.&lt;/li&gt;
&lt;li&gt; pageContext: encapsulates implementation-dependent features in &lt;code&gt;&lt;a href=&quot;http://192.9.162.55/products/servlet/2.2/javadoc/javax/servlet/jsp/PageContext.html&quot;&gt;PageContext&lt;/a&gt;&lt;/code&gt;. Page scope. &lt;/li&gt;
&lt;li&gt; application: represents the &lt;code&gt;&lt;a href=&quot;http://192.9.162.55/products/servlet/2.2/javadoc/javax/servlet/ServletContext.html&quot;&gt;ServletContext&lt;/a&gt;&lt;/code&gt; obtained from servlet configuration object. Application scope. &lt;/li&gt;
&lt;li&gt; out: a &lt;code&gt;&lt;a href=&quot;http://192.9.162.55/products/servlet/2.2/javadoc/javax/servlet/jsp/JspWriter.html&quot;&gt;JspWriter&lt;/a&gt;&lt;/code&gt; object that writes into the output stream. Page scope.&lt;/li&gt;
&lt;li&gt; config: represents the &lt;code&gt;&lt;a href=&quot;http://192.9.162.55/products/servlet/2.2/javadoc/javax/servlet/ServletConfig.html&quot;&gt;ServletConfig&lt;/a&gt;&lt;/code&gt; for the JSP. Page scope. &lt;/li&gt;
&lt;li&gt; page: synonym for the &quot;this&quot; operator, as an &lt;code&gt;&lt;a href=&quot;http://192.9.162.55/products/servlet/2.2/javadoc/javax/servlet/jsp/HttpJspPage.html&quot;&gt;HttpJspPage&lt;/a&gt;&lt;/code&gt;. Not used often by page authors. Page scope. &lt;/li&gt;
&lt;li&gt; session: An &lt;code&gt;&lt;a href=&quot;http://192.9.162.55/products/servlet/2.2/javadoc/javax/servlet/http/HttpSession.html&quot;&gt;HttpSession&lt;/a&gt;&lt;/code&gt;. Session scope. More on sessions &lt;a href=&quot;http://192.9.162.55/developer/onlineTraining/JSPIntro/contents.html#JSPIntro9&quot;&gt;shortly&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt; exception: the uncaught &lt;code&gt;&lt;a href=&quot;http://192.9.162.55/products/jdk/1.2/docs/api/java/lang/Throwable.html&quot;&gt;Throwable&lt;/a&gt;&lt;/code&gt; object that resulted in the error page being invoked. Page scope. &lt;/li&gt;
&lt;/ul&gt;
Note that these implicit objects are only visible within the system generated  &lt;code&gt;_jspService()&lt;/code&gt; method. They are not visible within methods you define yourself in  declarations. &lt;br /&gt;
&lt;h3&gt;
&lt;a href=&quot;http://draft.blogger.com/blogger.g?blogID=7813956266500130511&quot; name=&quot;JSPIntro7&quot;&gt;Synchronization Issues&lt;/a&gt;&lt;/h3&gt;
By default, the service method of the JSP page implementation class that services the client  request is multithreaded. Thus, it is the responsibility of the JSP page author to ensure that  access to shared  state is effectively synchronized. There are a couple of different ways to ensure  that the service methods are thread-safe. The easy approach is to include the JSP page directive: &lt;br /&gt;
&lt;pre&gt;&amp;lt;%@ page isThreadSafe=&quot;false&quot; %&amp;gt; &lt;/pre&gt;
This causes the JSP page implementation class to implement the &lt;code&gt;SingleThreadModel&lt;/code&gt; interface,  resulting in the synchronization of the service method, and having multiple instances of the servlet to  be loaded in memory. The concurrent client requests are then distributed evenly amongst these instances  for processing in a round-robin fashion, as shown below: &lt;br /&gt;
&lt;div align=&quot;center&quot;&gt;
&lt;img alt=&quot;[Thread-safe JSPs]&quot; height=&quot;300&quot; src=&quot;http://192.9.162.55/developer/onlineTraining/JSPIntro/images/threadsafe.GIF&quot; width=&quot;412&quot; /&gt; &lt;/div&gt;
The downside of using this approach is that it is not scalable. If the wait queue grows due to a large  number of concurrent requests overwhelming the processing ability of the servlet instances, then the  client may suffer a significant delay in obtaining the response. &lt;br /&gt;
A better approach is to explicitly synchronize access to shared objects (like those instances  with application scope, for example) within the JSP page, using scriptlets: &lt;br /&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;10&quot; cellspacing=&quot;0&quot; class=&quot;grey4&quot; style=&quot;width: 100%px;&quot;&gt; &lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;pre&gt;&amp;lt;% synchronized (application) {    SharedObject foo = (SharedObject)  application.getAttribute(&quot;sharedObject&quot;);    foo.update(someValue);    application.setAttribute(&quot;sharedObject&quot;,foo); } %&amp;gt; &lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;span class=&quot;sp20&quot;&gt; &lt;/span&gt;
&lt;br /&gt;
&lt;h3&gt;
&lt;a href=&quot;http://draft.blogger.com/blogger.g?blogID=7813956266500130511&quot; name=&quot;JSPIntro8&quot;&gt;Exception Handling&lt;/a&gt;&lt;/h3&gt;
JSP provides a rather elegant mechanism for handling runtime exceptions. Although you can provide your  own exception handling within JSP pages, it may not be possible to anticipate all situations. By  making use of the &lt;code&gt;page&lt;/code&gt; directive&#39;s &lt;code&gt;errorPage&lt;/code&gt; attribute, it is possible to forward  an uncaught exception to an error handling JSP page for processing. For example, &lt;br /&gt;
&lt;pre&gt;&amp;lt;%@ page isErrorPage=&quot;false&quot; errorPage=&quot;errorHandler.jsp&quot; %&amp;gt; &lt;/pre&gt;
informs the JSP engine to forward any uncaught exception to the JSP page &lt;code&gt;errorHandler.jsp&lt;/code&gt;.  It is then necessary for &lt;code&gt;errorHandler.jsp&lt;/code&gt; to flag itself as a error processing page using the directive: &lt;br /&gt;
&lt;pre&gt;&amp;lt;%@ page isErrorPage=&quot;true&quot; %&amp;gt; &lt;/pre&gt;
This allows the &lt;code&gt;Throwable&lt;/code&gt; object describing the exception to be accessed within a scriptlet  through the implicit &lt;code&gt;exception&lt;/code&gt; object. &lt;br /&gt;
&lt;h3&gt;
Exercise&lt;/h3&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;
&lt;ol start=&quot;2&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://192.9.162.55/developer/onlineTraining/JSPIntro/exercises/ErrorHandling/index.html&quot;&gt;Exception Handling in JSP&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/blockquote&gt;
&lt;h3&gt;
&lt;a href=&quot;http://draft.blogger.com/blogger.g?blogID=7813956266500130511&quot; name=&quot;JSPIntro9&quot;&gt;Session Management&lt;/a&gt;&lt;/h3&gt;
&lt;br /&gt;
&lt;br /&gt;
By default, all JSP pages participate in an HTTP session.  The &lt;code&gt;&lt;a href=&quot;http://192.9.162.55/products/servlet/2.2/javadoc/javax/servlet/http/HttpSession.html&quot;&gt;HttpSession&lt;/a&gt;&lt;/code&gt;  object can be accessed within scriptlets through the &lt;code&gt;session&lt;/code&gt; implicit JSP object.  Sessions are a good place for storing beans and objects that need to be shared across other JSP  pages and servlets that may be accessed by the user. The session objects is identified by a session  ID and stored in the browser as a cookie. If cookies are unsupported by the browser, then the session  ID may be maintained by URL rewriting. Support for URL rewriting is not mandated by the JSP specification  and is supported only within a few servers. Although you cannot place primitive data types into the session,  you can store any valid Java object by identifying it by a unique key. For example: &lt;br /&gt;
&lt;pre&gt;&amp;lt;%  Foo foo = new Foo(); session.putValue(&quot;foo&quot;,foo); %&amp;gt; &lt;/pre&gt;
makes available the &lt;code&gt;Foo&lt;/code&gt; instance within all JSP pages and servlets belonging  to the same session. The instance may be retrieved within a different JSP page as: &lt;br /&gt;
&lt;pre&gt;&amp;lt;% Foo myFoo = (Foo) session.getValue(&quot;foo&quot;); %&amp;gt; &lt;/pre&gt;
The call to &lt;code&gt;session.getValue()&lt;/code&gt; returns a reference to the  generic &lt;code&gt;Object&lt;/code&gt; type. Thus it is important to always cast the value returned to  the appropriate data type before using it. It is not mandatory for JSP pages to participate  in a session; they may choose to opt out by setting the appropriate attribute of the &lt;code&gt;page&lt;/code&gt; directive: &lt;br /&gt;
&lt;pre&gt;&amp;lt;%@ page session=&quot;false&quot; %&amp;gt; &lt;/pre&gt;
There is no limit on the number of objects you can store into the session. However, placing large  objects into the session may degrade performance, as they take up valuable heap space. By default,  most servers set the lifetime of a session object to 30 minutes, although you can easily reset it  on a per session basis by invoking &lt;code&gt;setMaxInvalidationInterval(int secs)&lt;/code&gt; on the session  object. The figure below highlights the general architecture of session management: &lt;br /&gt;
&lt;div align=&quot;center&quot;&gt;
&lt;img alt=&quot;[JSP Session Management]&quot; height=&quot;307&quot; src=&quot;http://192.9.162.55/developer/onlineTraining/JSPIntro/images/sessions.GIF&quot; width=&quot;472&quot; /&gt; &lt;/div&gt;
The JSP engine holds a live reference to objects placed into the session as long as the session is  valid. If the session is invalidated or encounters a session timeout, then the objects within are  flagged for garbage collection.  &lt;br /&gt;
&lt;h3&gt;
&lt;a href=&quot;http://draft.blogger.com/blogger.g?blogID=7813956266500130511&quot; name=&quot;JSPIntro10&quot;&gt;Standard Actions&lt;/a&gt;&lt;/h3&gt;
Actions allow you to perform sophisticated tasks like instantiating objects and communicating with  server-side resources like JSP pages and servlets without requiring Java coding. Although the same  can be achieved using Java code within scriptlets, using action tags promotes reusability of your  components and enhances the maintainability of your application. &lt;br /&gt;
&lt;h4&gt;
&lt;a href=&quot;http://draft.blogger.com/blogger.g?blogID=7813956266500130511&quot; name=&quot;JSPIntro11&quot;&gt;Using JavaBean Components&lt;/a&gt;&lt;/h4&gt;
The component model for JSP technology is based on JavaBeans component architecture.  JavaBeans components are nothing but Java objects which follow a well-defined design/naming  pattern: the bean encapsulates its properties by declaring them private and provides public  accessor (getter/setter) methods for reading and modifying their values.  &lt;br /&gt;
Before you can access a bean within a JSP page, it is necessary to identify the bean and  obtain a reference to it. The &lt;code&gt;&lt;jsp:usebean&gt;&lt;/jsp:usebean&gt;&lt;/code&gt; tag tries to obtain a reference  to an existing instance using the specified id and scope, as the bean may have been previously  created and placed into the session or application scope from within a different JSP page. The bean  is newly instantiated using the Java class name specified through the class attribute only if a  reference was not obtained from the specified scope. Consider the tag: &lt;br /&gt;
&lt;pre&gt;&lt;jsp:usebean class=&quot;com.jguru.Person&quot; id=&quot;user&quot; scope=&quot;session&quot;&gt; &lt;/jsp:usebean&gt;&lt;/pre&gt;
In this example, the &lt;code&gt;Person&lt;/code&gt; instance is created just once and placed into the  session. If this &lt;code&gt;useBean&lt;/code&gt; tag is later encountered within a different JSP page,  a reference to the original instance that was created before is retrieved from the session. &lt;br /&gt;
The &lt;code&gt;&lt;jsp:usebean&gt;&lt;/jsp:usebean&gt;&lt;/code&gt; tag can also optionally include a body, such as &lt;br /&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;10&quot; cellspacing=&quot;0&quot; class=&quot;grey4&quot; style=&quot;width: 100%px;&quot;&gt; &lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;pre&gt;&lt;jsp:usebean class=&quot;com.jguru.Person&quot; id=&quot;user&quot; scope=&quot;session&quot;&gt; &amp;lt;%   user.setDate(DateFormat.getDateInstance(                        ).format(new Date()));   //etc.. %&amp;gt; &lt;/jsp:usebean&gt; &lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;span class=&quot;sp20&quot;&gt; &lt;/span&gt;
&lt;br /&gt;
Any scriptlet (or &lt;code&gt;&lt;jsp:setproperty&gt;&lt;/jsp:setproperty&gt;&lt;/code&gt; tags, which are explained shortly) present  within the body of a &lt;code&gt;&lt;jsp:usebean&gt;&lt;/jsp:usebean&gt;&lt;/code&gt; tag are executed only when the bean is instantiated,  and are used to initialize the bean&#39;s properties. &lt;br /&gt;
Once you have declared a JavaBean component, you have access to its  properties to customize it. The value of a bean&#39;s property is accessed  using the &lt;code&gt;&lt;jsp:getproperty&gt;&lt;/jsp:getproperty&gt;&lt;/code&gt; tag. With the &lt;code&gt;&lt;jsp:getproperty&gt;&lt;/jsp:getproperty&gt;&lt;/code&gt; tag, you specify the name of the bean to use (from the id field of &lt;code&gt;useBean&lt;/code&gt;),  as well as the name of the property whose value you are interested in.  The actual value is then directly printed to the output: &lt;br /&gt;
&lt;pre&gt;&lt;jsp:getproperty name=&quot;user&quot; property=&quot;name&quot;&gt; &lt;/jsp:getproperty&gt;&lt;/pre&gt;
Changing the property of a JavaBean component requires you to use the  &lt;code&gt;&lt;jsp:setproperty&gt;&lt;/jsp:setproperty&gt;&lt;/code&gt; tag. For this tag, you identify the bean and  property to modify and provide the new value:  &lt;br /&gt;
&lt;pre&gt;&lt;jsp:setproperty name=&quot;user&quot; property=&quot;name&quot; value=&quot;jGuru&quot;&gt; &lt;/jsp:setproperty&gt;&lt;/pre&gt;
or&lt;br /&gt;
&lt;pre&gt;&lt;jsp:setproperty name=&quot;user&quot; property=&quot;name&quot; value=&quot;&amp;lt;%=expression %&amp;gt;&quot;&gt; &lt;/jsp:setproperty&gt;&lt;/pre&gt;
When developing beans for processing form data, you can follow a common design pattern by  matching the names of the bean properties with the names of the form input elements. You also  need to define the corresponding getter/setter methods for each property within the bean. The  advantage in this is that you can now direct the JSP engine to parse all the incoming values from  the HTML form elements that are part of the request object, then assign them to their corresponding  bean properties with a single statement, like this:  &lt;br /&gt;
&lt;pre&gt;&lt;jsp:setproperty name=&quot;user&quot; property=&quot;*&quot;&gt; &lt;/jsp:setproperty&gt;&lt;/pre&gt;
This runtime magic is possible through a process called &lt;i&gt;introspection&lt;/i&gt;, which lets a  class expose its properties on request. The introspection is managed by the JSP engine, and  implemented through the Java reflection mechanism. This feature alone can be a lifesaver when  processing complex forms containing a significant number of input elements. &lt;br /&gt;
If the names of your bean properties do not match those of the form&#39;s input elements, they can still  be mapped explicitly to your property by naming the parameter as: &lt;br /&gt;
&lt;pre&gt;&lt;jsp:setproperty name=&quot;user&quot; param=&quot;parameterName&quot; property=&quot;address&quot;&gt; &lt;/jsp:setproperty&gt;&lt;/pre&gt;
&lt;h3&gt;
Exercises&lt;/h3&gt;
&lt;blockquote&gt;
&lt;ol start=&quot;3&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://192.9.162.55/developer/onlineTraining/JSPIntro/exercises/Counter/index.html&quot;&gt;Understanding JSP object scope&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://192.9.162.55/developer/onlineTraining/JSPIntro/exercises/Forms/index.html&quot;&gt;Form processing using JSP&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/blockquote&gt;
&lt;h4&gt;
&lt;a href=&quot;http://draft.blogger.com/blogger.g?blogID=7813956266500130511&quot; name=&quot;JSPIntro12&quot;&gt;Forwarding Requests&lt;/a&gt;&lt;/h4&gt;
With the &lt;code&gt;&lt;jsp:forward&gt;&lt;/jsp:forward&gt;&lt;/code&gt; tag, you can redirect the request to any JSP, servlet, or  static HTML page within the same context as the invoking page. This effectively halts processing of the  current page at the point where the redirection occurs, although all processing up to that point still takes place: &lt;br /&gt;
&lt;pre&gt;&lt;jsp:forward page=&quot;somePage.jsp&quot;&gt; &lt;/jsp:forward&gt;&lt;/pre&gt;
The invoking page can also pass the target resource bean parameters by placing them into the  request, as shown in the diagram: &lt;br /&gt;
&lt;div align=&quot;center&quot;&gt;
&lt;img alt=&quot;[JSP Forwarding]&quot; height=&quot;268&quot; src=&quot;http://192.9.162.55/developer/onlineTraining/JSPIntro/images/forwarding.GIF&quot; width=&quot;441&quot; /&gt; &lt;/div&gt;
A &lt;code&gt;&lt;jsp:forward&gt;&lt;/jsp:forward&gt;&lt;/code&gt; tag may also have &lt;code&gt;jsp:param&lt;/code&gt; subelements that can  provide values for some elements in the request used in the forwarding: &lt;br /&gt;
&lt;pre&gt;&lt;jsp:forward page=&quot;&amp;lt;%= somePage %&amp;gt;&quot;&gt; &lt;jsp:param name=&quot;name1&quot; value=&quot;value1&quot;&gt; &lt;jsp:param name=&quot;name2&quot; value=&quot;value2&quot;&gt; &lt;/jsp:param&gt;&lt;/jsp:param&gt;&lt;/jsp:forward&gt; &lt;/pre&gt;
&lt;h5&gt;
&lt;a href=&quot;http://draft.blogger.com/blogger.g?blogID=7813956266500130511&quot; name=&quot;JSPIntro121&quot;&gt;Request Chaining&lt;/a&gt;&lt;/h5&gt;
Request chaining is a powerful feature and can be used to effectively meld JSP  pages and servlets in processing HTML forms, as shown in the following figure: &lt;br /&gt;
&lt;div align=&quot;center&quot;&gt;
&lt;img alt=&quot;[JSP Including]&quot; height=&quot;342&quot; src=&quot;http://192.9.162.55/developer/onlineTraining/JSPIntro/images/chaining.GIF&quot; width=&quot;566&quot; /&gt; &lt;/div&gt;
Consider the following JSP page, say &lt;code&gt;Bean1.jsp&lt;/code&gt;, which creates a named instance  &lt;code&gt;fBean&lt;/code&gt; of type &lt;code&gt;FormBean&lt;/code&gt;, places it in the request, and forwards the call to the  servlet &lt;code&gt;JSP2Servlet&lt;/code&gt;. Observe the way the bean is instantiated--here we  automatically call the bean&#39;s setter methods for properties which match the  names of the posted form elements, while passing the corresponding values to the  methods.  &lt;br /&gt;
&lt;pre&gt;&lt;jsp:usebean class=&quot;govi.FormBean&quot; id=&quot;fBean&quot; scope=&quot;request&quot;&gt; &lt;jsp:setproperty name=&quot;fBean&quot; property=&quot;*&quot;&gt; &lt;jsp:forward page=&quot;/servlet/JSP2Servlet&quot;&gt; &lt;/jsp:forward&gt;&lt;/jsp:setproperty&gt;&lt;/jsp:usebean&gt;&lt;/pre&gt;
The servlet &lt;code&gt;JSP2Servlet&lt;/code&gt; now extracts the bean passed  to it from the request, makes changes using the  appropriate setters, and forwards the call to another  JSP page &lt;code&gt;Bean2.jsp&lt;/code&gt; using a request dispatcher. Note that  this servlet, acting as a controller, can also place  additional beans if necessary, within the request.  &lt;br /&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;10&quot; cellspacing=&quot;0&quot; class=&quot;grey4&quot; style=&quot;width: 100%px;&quot;&gt; &lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;pre&gt;public void doPost (HttpServletRequest request,                       HttpServletResponse response) {   try {     FormBean f = (FormBean) request.getAttribute                                          (&quot;fBean&quot;);      f.setName(&quot;Mogambo&quot;);      // do whatever else necessary     getServletConfig().getServletContext().       getRequestDispatcher(&quot;/jsp/Bean2.jsp&quot;).         forward(request, response);   } catch (Exception ex) {     . . .   } } &lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;span class=&quot;sp20&quot;&gt; &lt;/span&gt;
&lt;br /&gt;
The JSP page &lt;code&gt;Bean2.jsp&lt;/code&gt; can now extract the bean &lt;code&gt;fBean&lt;/code&gt; (and whatever other beans  that may have been passed by the controller servlet) from the request and  extract its properties.  &lt;br /&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;10&quot; cellspacing=&quot;0&quot; class=&quot;grey4&quot; style=&quot;width: 100%px;&quot;&gt; &lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;pre&gt;  &lt;jsp:usebean class=&quot;govi.FormBean&quot; id=&quot;fBean&quot; scope=&quot;request&quot;&gt; &lt;jsp:getproperty name=&quot;fBean&quot; property=&quot;name&quot;&gt;    &lt;/jsp:getproperty&gt;&lt;/jsp:usebean&gt;&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;span class=&quot;sp20&quot;&gt; &lt;/span&gt;
&lt;br /&gt;
&lt;h4&gt;
&lt;a href=&quot;http://draft.blogger.com/blogger.g?blogID=7813956266500130511&quot; name=&quot;JSPIntro13&quot;&gt;Including Requests&lt;/a&gt;&lt;/h4&gt;
The &lt;code&gt;&lt;jsp:include&gt;&lt;/jsp:include&gt;&lt;/code&gt; tag can be used to redirect the request to any static or  dynamic resource that is in the same context as the calling JSP page. The  calling page can also pass the target resource bean parameters by placing them  into the request, as shown in the diagram: &lt;br /&gt;
&lt;div align=&quot;center&quot;&gt;
&lt;img alt=&quot;[JSP Including]&quot; height=&quot;248&quot; src=&quot;http://192.9.162.55/developer/onlineTraining/JSPIntro/images/including.GIF&quot; width=&quot;441&quot; /&gt; &lt;/div&gt;
For example: &lt;br /&gt;
&lt;pre&gt;&lt;jsp:include flush=&quot;true&quot; page=&quot;shoppingcart.jsp&quot;&gt; &lt;/jsp:include&gt;&lt;/pre&gt;
not only allows &lt;code&gt;shoppingcart.jsp&lt;/code&gt; to access any beans placed within the request  using a &lt;code&gt;&lt;jsp:usebean&gt;&lt;/jsp:usebean&gt;&lt;/code&gt; tag, but the dynamic content produced by it is  inserted into the calling page at the point where the &lt;code&gt;&lt;jsp:include&gt;&lt;/jsp:include&gt;&lt;/code&gt; tag  occurs. The included resource, however, cannot set any HTTP headers, which  precludes it from doing things like setting cookies, or else an exception is thrown.  &lt;br /&gt;
&lt;h3&gt;
&lt;a href=&quot;http://draft.blogger.com/blogger.g?blogID=7813956266500130511&quot; name=&quot;websites&quot;&gt;Web Sites&lt;/a&gt;&lt;/h3&gt;
The following sites have product information as well as whitepapers on JSP and Servlets:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://192.9.162.55/products/jsp/index.jsp&quot;&gt;Sun Microsystems, JSP Home Page&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://archives.java.sun.com/archives/jsp-interest.html&quot;&gt;JSP-INTEREST Mailing List Archive&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP&quot;&gt;jGuru&#39;s JSP FAQ&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets&quot;&gt;jGuru&#39;s Servlets FAQ&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description><link>http://littlebitzltm.blogspot.com/2011/10/jguru-javaserver-pages-fundamentals.html</link><author>noreply@blogger.com (littlebitz)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7813956266500130511.post-6460155431193562570</guid><pubDate>Fri, 07 Oct 2011 01:15:00 +0000</pubDate><atom:updated>2012-10-04T17:25:20.535+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">photoshop</category><title>Hacer un texto que se adapta a un círculo, Photoshop</title><description>&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #e1e5ef; font-family: verdana, arial, helvetica, sans-serif; font-size: 12px; line-height: 18px;&quot;&gt;Existen tutoriales complicados con técnicas para conseguir con Photoshop que un texto se adapte a una circunferencia. Esas técnicas eran necesarias de utilizar porque Photoshop no tenía una manera directa de hacer que un texto se adapte a un círculo o una curva en general. Ahora con CS2 es posible hacer esto y conseguir un texto editable que se adapta a un trazo. En este artículo haremos un círculo y el texto se escribirá siguiendo la circunferencia. Pero en realidad esto se puede hacer con cualquier tipo de trazo.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #e1e5ef; font-family: verdana, arial, helvetica, sans-serif; font-size: 12px; line-height: 18px;&quot;&gt;Primero creamos un archivo nuevo, en el que vamos a dibujar una circunferencia con la herramienta elipse. Esta circunferencia nos servirá para adaptar el texto que vamos a escribir más tarde.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #e1e5ef; font-family: verdana, arial, helvetica, sans-serif; font-size: 12px; line-height: 18px;&quot;&gt;&lt;img alt=&quot;herramienta elipse&quot; border=&quot;0&quot; height=&quot;449&quot; src=&quot;http://www.desarrolloweb.com/articulos/images/diseno_photoshop/texto-circulo/elipse.gif&quot; width=&quot;169&quot; /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #e1e5ef; font-family: verdana, arial, helvetica, sans-serif; font-size: 12px; line-height: 18px;&quot;&gt;Seleccionamos la mencionada herramienta elipse y dibujamos una circunferencia. El tamaño será el deseado. Pero para la prueba vamos a hacer una elipse suficientemente grande para trabajar con espacio.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #e1e5ef; font-family: verdana, arial, helvetica, sans-serif; font-size: 12px; line-height: 18px;&quot;&gt;En nuestra lista de capas tendremos el fondo y la elipse.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #e1e5ef; font-family: verdana, arial, helvetica, sans-serif; font-size: 12px; line-height: 18px;&quot;&gt;&lt;img alt=&quot;creamos una elipse&quot; border=&quot;0&quot; height=&quot;300&quot; src=&quot;http://www.desarrolloweb.com/articulos/images/diseno_photoshop/texto-circulo/elipse2.gif&quot; width=&quot;350&quot; /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #e1e5ef; font-family: verdana, arial, helvetica, sans-serif; font-size: 12px; line-height: 18px;&quot;&gt;Entonces tomamos la herramienta de texto. Al situarnos sobre el lienzo, nuestro puntero se transforma en el típico cursor para mostrar que se va a insertar un texto (se muestra el típico puntero de texto, que es una línea vertical con una línea pequeña horizontal abajo y arriba). Si nos situamos con el puntero en la misma línea de la elipse veremos como el puntero se transforma en un cursor de texto especial, como el que podemos ver en la siguiente imagen:&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #e1e5ef; font-family: verdana, arial, helvetica, sans-serif; font-size: 12px; line-height: 18px;&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; height=&quot;109&quot; id=&quot;Cursor para texto que se adapta a una curva&quot; name=&quot;Cursor para texto que se adapta a una curva&quot; src=&quot;http://www.desarrolloweb.com/articulos/images/diseno_photoshop/texto-circulo/cursor.gif&quot; width=&quot;290&quot; /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #e1e5ef; font-family: verdana, arial, helvetica, sans-serif; font-size: 12px; line-height: 18px;&quot;&gt;En ese punto hacemos clic para empezar a escribir un texto. Veremos que el texto que vamos escribiendo se va colocando rodeando el círculo. Para ello, las letras se van adaptando al recorrido de la elipse. El resultado será algo como lo siguiente:&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #e1e5ef; font-family: verdana, arial, helvetica, sans-serif; font-size: 12px; line-height: 18px;&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; height=&quot;300&quot; id=&quot;Texto que se adapta a una elipse&quot; name=&quot;Texto que se adapta a una elipse&quot; src=&quot;http://www.desarrolloweb.com/articulos/images/diseno_photoshop/texto-circulo/texto-en-elipse.gif&quot; width=&quot;350&quot; /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #e1e5ef; font-family: verdana, arial, helvetica, sans-serif; font-size: 12px; line-height: 18px;&quot;&gt;Seguramente tengamos que editar la posición del texto, para situarlo en un lado u otro del perímetro de la elipse. Esto lo tenemos que hacer con la herramienta de selección directa.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #e1e5ef; font-family: verdana, arial, helvetica, sans-serif; font-size: 12px; line-height: 18px;&quot;&gt;&lt;img alt=&quot;Herramienta de seleccion directa&quot; border=&quot;0&quot; height=&quot;444&quot; src=&quot;http://www.desarrolloweb.com/articulos/images/diseno_photoshop/texto-circulo/herramienta-seleccion-direc.gif&quot; width=&quot;180&quot; /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #e1e5ef; font-family: verdana, arial, helvetica, sans-serif; font-size: 12px; line-height: 18px;&quot;&gt;Ahora nos situamos con el puntero encima del texto. Veremos que el puntero se transforma como en un guión para escribir texto, en el que aparece al lado una flecha, apuntando a uno u otro lado del puntero. Entonces podemos pinchar y arrastrar para mover una guía para recolocar el texto dentro del trazado de la curva.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #e1e5ef; font-family: verdana, arial, helvetica, sans-serif; font-size: 12px; line-height: 18px;&quot;&gt;Si queremos, podemos conseguir así mover el texto para que se coloque siguiendo la curva, pero por la parte de dentro en lugar de la de fuera. Para ello simplemente habrá que arrastrar la posición de la guía para dentro, o fuera, del trazo.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #e1e5ef; font-family: verdana, arial, helvetica, sans-serif; font-size: 12px; line-height: 18px;&quot;&gt;&lt;img alt=&quot;El texto podemos colocarlo dentro del círculo&quot; border=&quot;0&quot; height=&quot;345&quot; src=&quot;http://www.desarrolloweb.com/articulos/images/diseno_photoshop/texto-circulo/texto-en-elipse-dentro.gif&quot; width=&quot;360&quot; /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #e1e5ef; font-family: verdana, arial, helvetica, sans-serif; font-size: 12px; line-height: 18px;&quot;&gt;Con esto tenemos nuestro texto alrededor de un círculo. Hay que señalar que este texto es perfectamente editable, por lo que fácilmente podremos cambiar el tamaño del texto, el color, la fuente, etc. Como cualquier otro texto simple de Photoshop. De esta manera conseguirmos adaptar el texto y que este sea totalmente editable.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #e1e5ef; font-family: verdana, arial, helvetica, sans-serif; font-size: 12px; line-height: 18px;&quot;&gt;La elipse luego podemos eliminarla o ocultarla para que no salga en la imagen. El trazado ahora queda asociado al texto, por lo que es indiferente lo que hagamos con la silueta de la elipse.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #e1e5ef; font-family: verdana, arial, helvetica, sans-serif; font-size: 12px; line-height: 18px;&quot;&gt;&lt;img alt=&quot;resultado final del testo que se adapta a un círculo&quot; border=&quot;0&quot; height=&quot;345&quot; src=&quot;http://www.desarrolloweb.com/articulos/images/diseno_photoshop/texto-circulo/final.gif&quot; width=&quot;365&quot; /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #e1e5ef; font-family: verdana, arial, helvetica, sans-serif; font-size: 12px; line-height: 18px;&quot;&gt;Esta es la manera más simple que existe de adaptar un texto a una circunferencia. Espero que haya sido sencillo de entender.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #e1e5ef; font-family: verdana, arial, helvetica, sans-serif; font-size: 12px; line-height: 18px;&quot;&gt;Ahora puedes ver un vídeo sobre este tutorial, que hemos preparado en DesarrolloWeb.com.&lt;/span&gt;&lt;br /&gt;
&lt;div align=&quot;center&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #e1e5ef; font-family: verdana, arial, helvetica, sans-serif; font-size: 12px; line-height: 18px;&quot;&gt;&lt;object height=&quot;344&quot; width=&quot;425&quot;&gt;&lt;embed src=&quot;http://www.youtube.com/v/XjUhRTcx0EU&amp;amp;hl=es&amp;amp;fs=1&quot; type=&quot;application/x-shockwave-flash&quot; allowscriptaccess=&quot;always&quot; allowfullscreen=&quot;true&quot; width=&quot;425&quot; height=&quot;344&quot;&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/span&gt;&lt;/div&gt;
</description><link>http://littlebitzltm.blogspot.com/2011/10/hacer-un-texto-que-se-adapta-un-circulo.html</link><author>noreply@blogger.com (littlebitz)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7813956266500130511.post-8882306697098928389</guid><pubDate>Mon, 03 Oct 2011 14:32:00 +0000</pubDate><atom:updated>2011-10-03T16:32:02.377+02:00</atom:updated><title>Facebook Launches New Metric:</title><description>Facebook has overhauled its Pages Insights analytics tool and added a new metric to gauge the health of a page: “People Talking About.”&lt;br /&gt;&lt;br /&gt;That statistic, which users will see on Pages below the total number of “Likes,” will be one of four tracked by Pages Insights. The idea is that users will understand a Page with a high People Talking About rating is one that has compelling content. Likewise, content creators will be motivated to make their Pages more comment-worthy.&lt;br /&gt;&lt;br /&gt;People Talking About (that might not be the final name for the metric; at press time, Facebook wasn’t sure) will measure user-initiated activity related to a Page, including posting to a Page’s Wall, “liking,” commenting, sharing a Page post or content on the Page, answering a Question posed to fans, mentioning a Page, “liking” or sharing a deal or checking in at your Place.&lt;br /&gt;&lt;br /&gt;The other metrics, which are designed for administrators of brand and media Pages, include “Likes,” “Friends of Fans” and “Weekly Total Reach.” While “Likes” is self-explanatory, Friends of Fans is the actual number of friends your fans have, and weekly total reach is designed to be an accurate assessment of how many total people have posted something about your Page, how many news organizations (within Facebook) have referenced it and how much viral distribution elements of your Page has gotten.&lt;br /&gt;&lt;br /&gt;David Baser, product manager for Pages Insights, says that despite a raft of new activities that Facebook will be introducing soon under the Facebook Gestures banner, those four metrics will remain and the “Like” will maintain its ranking as a top measurement. “Likes are an expression of identity,” Baser says. “It’s a user saying that I have a relationship with this brand.”&lt;br /&gt;&lt;br /&gt;In addition to tracking the four metrics, Pages Insights will also offer a deeper dive into data around specific updates. Facebook will list your last 500 posts (the company began tracking them in July) and count the total number of engaged users, People Talking About it and virality. The latter measures the percentage of users who commented on the post.&lt;br /&gt;&lt;br /&gt;Sentiment, however, will not be part of the calculation. Whether a user is lauding a comment or trashing it, it will count the same.</description><link>http://littlebitzltm.blogspot.com/2011/10/facebook-launches-new-metric.html</link><author>noreply@blogger.com (littlebitz)</author><thr:total>0</thr:total></item></channel></rss>