﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>语源科技BlogJava-juanshuchun</title><link>http://www.blogjava.net/juanshuchun/</link><description>Never accpet failure no matter how oftern it visits you keep on going , never give up. never~~~
</description><language>zh-cn</language><lastBuildDate>Thu, 07 May 2026 06:33:25 GMT</lastBuildDate><pubDate>Thu, 07 May 2026 06:33:25 GMT</pubDate><ttl>60</ttl><item><title>session map</title><link>http://www.blogjava.net/juanshuchun/articles/167041.html</link><dc:creator>*一凡*</dc:creator><author>*一凡*</author><pubDate>Tue, 11 Dec 2007 12:25:00 GMT</pubDate><guid>http://www.blogjava.net/juanshuchun/articles/167041.html</guid><description><![CDATA[<p>session map code1:<br />
</p>
<div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><img id="Codehighlighter1_35_246_Open_Image" onclick="this.style.display='none'; Codehighlighter1_35_246_Open_Text.style.display='none'; Codehighlighter1_35_246_Closed_Image.style.display='inline'; Codehighlighter1_35_246_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockStart.gif" align="top"  alt="" /><img id="Codehighlighter1_35_246_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_35_246_Closed_Text.style.display='none'; Codehighlighter1_35_246_Open_Image.style.display='inline'; Codehighlighter1_35_246_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedBlock.gif" align="top"  alt="" /><span style="color: #0000ff">protected</span><span style="color: #000000">&nbsp;Status&nbsp;getDialogStatus()&nbsp;</span><span id="Codehighlighter1_35_246_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.blogjava.net/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_35_246_Open_Text"><span style="color: #000000">{<br />
<img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Map&nbsp;sessionMap&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;FacesContext.getCurrentInstance()<br />
<img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.getExternalContext()<br />
<img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.getSessionMap();<br />
<img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">return</span><span style="color: #000000">(Status)sessionMap.get(org.apache.shale.dialog.Globals.STATUS);<br />
<img src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span></div>
<br />
session map code2:<br />
<br />
<div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" /><span style="color: #000000">&nbsp;&nbsp;ChartData&nbsp;data&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;</span><span style="color: #0000ff">new</span><span style="color: #000000">&nbsp;ChartData();<br />
<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;data.setWidth(width);<br />
<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;data.setHeight(height);<br />
<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;data.setTitle(title);<br />
<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;data.setNames(names);<br />
<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;data.setValues(values);<br />
<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" /><br />
<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;String&nbsp;id&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;component.getClientId(context);<br />
<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;ExternalContext&nbsp;external&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;FacesContext.getCurrentInstance().getExternalContext();<br />
<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;Map</span><span style="color: #000000">&lt;</span><span style="color: #000000">String,&nbsp;Object</span><span style="color: #000000">&gt;</span><span style="color: #000000">&nbsp;session&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;external.getSessionMap();<br />
<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;session.put(id,&nbsp;data);<br />
<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" /></span></div>
<br />
将Object 保存在sessionscope map 里，可以在页面导航到其他页面时，还能继续访问Object。<br />
requestMap或sessionMap 临时保存对象。
<img src ="http://www.blogjava.net/juanshuchun/aggbug/167041.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/juanshuchun/" target="_blank">*一凡*</a> 2007-12-11 20:25 <a href="http://www.blogjava.net/juanshuchun/articles/167041.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>onchange</title><link>http://www.blogjava.net/juanshuchun/articles/167037.html</link><dc:creator>*一凡*</dc:creator><author>*一凡*</author><pubDate>Tue, 11 Dec 2007 12:09:00 GMT</pubDate><guid>http://www.blogjava.net/juanshuchun/articles/167037.html</guid><description><![CDATA[<div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" /><span style="color: #000000">&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">&lt;</span><span style="color: #800000">html</span><span style="color: #0000ff">&gt;</span><span style="color: #000000"><br />
<img id="Codehighlighter1_17_71_Open_Image" onclick="this.style.display='none'; Codehighlighter1_17_71_Open_Text.style.display='none'; Codehighlighter1_17_71_Closed_Image.style.display='inline'; Codehighlighter1_17_71_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockStart.gif" align="top"  alt="" /><img id="Codehighlighter1_17_71_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_17_71_Closed_Text.style.display='none'; Codehighlighter1_17_71_Open_Image.style.display='inline'; Codehighlighter1_17_71_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000; background-color: #ffff00">&lt;%</span><span id="Codehighlighter1_17_71_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.blogjava.net/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_17_71_Open_Text"><span style="color: #000000; background-color: #f5f5f5">@&nbsp;taglib&nbsp;uri</span><span style="color: #000000; background-color: #f5f5f5">=</span><span style="color: #000000; background-color: #f5f5f5">"</span><span style="color: #000000; background-color: #f5f5f5">http://java.sun.com/jsf/core</span><span style="color: #000000; background-color: #f5f5f5">"</span><span style="color: #000000; background-color: #f5f5f5">&nbsp;prefix</span><span style="color: #000000; background-color: #f5f5f5">=</span><span style="color: #000000; background-color: #f5f5f5">"</span><span style="color: #000000; background-color: #f5f5f5">f</span><span style="color: #000000; background-color: #f5f5f5">"</span><span style="color: #000000; background-color: #f5f5f5">&nbsp;</span></span><span style="color: #000000; background-color: #ffff00">%&gt;</span><span style="color: #000000"><br />
<img id="Codehighlighter1_84_138_Open_Image" onclick="this.style.display='none'; Codehighlighter1_84_138_Open_Text.style.display='none'; Codehighlighter1_84_138_Closed_Image.style.display='inline'; Codehighlighter1_84_138_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockStart.gif" align="top"  alt="" /><img id="Codehighlighter1_84_138_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_84_138_Closed_Text.style.display='none'; Codehighlighter1_84_138_Open_Image.style.display='inline'; Codehighlighter1_84_138_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000; background-color: #ffff00">&lt;%</span><span id="Codehighlighter1_84_138_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.blogjava.net/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_84_138_Open_Text"><span style="color: #000000; background-color: #f5f5f5">@&nbsp;taglib&nbsp;uri</span><span style="color: #000000; background-color: #f5f5f5">=</span><span style="color: #000000; background-color: #f5f5f5">"</span><span style="color: #000000; background-color: #f5f5f5">http://java.sun.com/jsf/html</span><span style="color: #000000; background-color: #f5f5f5">"</span><span style="color: #000000; background-color: #f5f5f5">&nbsp;prefix</span><span style="color: #000000; background-color: #f5f5f5">=</span><span style="color: #000000; background-color: #f5f5f5">"</span><span style="color: #000000; background-color: #f5f5f5">h</span><span style="color: #000000; background-color: #f5f5f5">"</span><span style="color: #000000; background-color: #f5f5f5">&nbsp;</span></span><span style="color: #000000; background-color: #ffff00">%&gt;</span><span style="color: #000000"><br />
<img id="Codehighlighter1_150_206_Open_Image" onclick="this.style.display='none'; Codehighlighter1_150_206_Open_Text.style.display='none'; Codehighlighter1_150_206_Closed_Image.style.display='inline'; Codehighlighter1_150_206_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockStart.gif" align="top"  alt="" /><img id="Codehighlighter1_150_206_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_150_206_Closed_Text.style.display='none'; Codehighlighter1_150_206_Open_Image.style.display='inline'; Codehighlighter1_150_206_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000; background-color: #ffff00">&lt;%</span><span id="Codehighlighter1_150_206_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.blogjava.net/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_150_206_Open_Text"><span style="color: #000000; background-color: #f5f5f5">@&nbsp;taglib&nbsp;uri</span><span style="color: #000000; background-color: #f5f5f5">=</span><span style="color: #000000; background-color: #f5f5f5">"</span><span style="color: #000000; background-color: #f5f5f5">http://corejsf.com/pager</span><span style="color: #000000; background-color: #f5f5f5">"</span><span style="color: #000000; background-color: #f5f5f5">&nbsp;prefix</span><span style="color: #000000; background-color: #f5f5f5">=</span><span style="color: #000000; background-color: #f5f5f5">"</span><span style="color: #000000; background-color: #f5f5f5">corejsf</span><span style="color: #000000; background-color: #f5f5f5">"</span><span style="color: #000000; background-color: #f5f5f5">&nbsp;</span></span><span style="color: #000000; background-color: #ffff00">%&gt;</span><span style="color: #000000"><br />
<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;<br />
<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">&lt;</span><span style="color: #800000">f:view</span><span style="color: #0000ff">&gt;</span><span style="color: #000000"><br />
<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">&lt;</span><span style="color: #800000">head</span><span style="color: #0000ff">&gt;</span><span style="color: #000000"><br />
<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">&lt;</span><span style="color: #800000">link&nbsp;</span><span style="color: #ff0000">href</span><span style="color: #0000ff">="styles.css"</span><span style="color: #ff0000">&nbsp;rel</span><span style="color: #0000ff">="stylesheet"</span><span style="color: #ff0000">&nbsp;type</span><span style="color: #0000ff">="text/css"</span><span style="color: #0000ff">/&gt;</span><span style="color: #000000"><br />
<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">&lt;</span><span style="color: #800000">title</span><span style="color: #0000ff">&gt;</span><span style="color: #000000">Pager&nbsp;Test</span><span style="color: #0000ff">&lt;/</span><span style="color: #800000">title</span><span style="color: #0000ff">&gt;</span><span style="color: #000000"><br />
<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">&lt;/</span><span style="color: #800000">head</span><span style="color: #0000ff">&gt;</span><span style="color: #000000"><br />
<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">&lt;</span><span style="color: #800000">body</span><span style="color: #0000ff">&gt;</span><span style="color: #000000"><br />
<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">&lt;</span><span style="color: #800000">h:form</span><span style="color: #0000ff">&gt;</span><span style="color: #000000"><br />
<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">&lt;</span><span style="color: #800000">h:dataTable&nbsp;</span><span style="color: #ff0000">id</span><span style="color: #0000ff">="timezones"</span><span style="color: #ff0000">&nbsp;value</span><span style="color: #0000ff">="#{bb.data}"</span><span style="color: #ff0000">&nbsp;var</span><span style="color: #0000ff">="row"</span><span style="color: #ff0000">&nbsp;rows</span><span style="color: #0000ff">="10"</span><span style="color: #0000ff">&gt;</span><span style="color: #000000"><br />
<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">&lt;</span><span style="color: #800000">h:column</span><span style="color: #0000ff">&gt;</span><span style="color: #000000"><br />
<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">&lt;</span><span style="color: #800000">h:selectBooleanCheckbox&nbsp;</span><span style="color: #ff0000">value</span><span style="color: #0000ff">="{bb.dummy}"</span><span style="color: #ff0000">&nbsp;onchange</span><span style="color: #0000ff">="submit()"</span><span style="color: #0000ff">/&gt;</span><span style="color: #000000"><br />
<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">&lt;/</span><span style="color: #800000">h:column</span><span style="color: #0000ff">&gt;</span><span style="color: #000000"><br />
<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">&lt;</span><span style="color: #800000">h:column</span><span style="color: #0000ff">&gt;</span><span style="color: #000000"><br />
<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">&lt;</span><span style="color: #800000">h:outputText&nbsp;</span><span style="color: #ff0000">value</span><span style="color: #0000ff">="#{row}"</span><span style="color: #ff0000">&nbsp;</span><span style="color: #0000ff">/&gt;</span><span style="color: #000000"><br />
<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">&lt;/</span><span style="color: #800000">h:column</span><span style="color: #0000ff">&gt;</span><span style="color: #000000"><br />
<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">&lt;/</span><span style="color: #800000">h:dataTable</span><span style="color: #0000ff">&gt;</span><span style="color: #000000"><br />
<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">&lt;</span><span style="color: #800000">corejsf:pager&nbsp;</span><span style="color: #ff0000">dataTableId</span><span style="color: #0000ff">="timezones"</span><span style="color: #ff0000"><br />
<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;showpages</span><span style="color: #0000ff">="20"</span><span style="color: #ff0000">&nbsp;selectedStyleClass</span><span style="color: #0000ff">="currentPage"</span><span style="color: #0000ff">/&gt;</span><span style="color: #000000"><br />
<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">&lt;</span><span style="color: #800000">h:commandButton&nbsp;</span><span style="color: #ff0000">value</span><span style="color: #0000ff">="foo"</span><span style="color: #0000ff">/&gt;</span><span style="color: #000000"><br />
<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">&lt;/</span><span style="color: #800000">h:form</span><span style="color: #0000ff">&gt;</span><span style="color: #000000"><br />
<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">&lt;/</span><span style="color: #800000">body</span><span style="color: #0000ff">&gt;</span><span style="color: #000000"><br />
<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">&lt;/</span><span style="color: #800000">f:view</span><span style="color: #0000ff">&gt;</span><span style="color: #000000"><br />
<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">&lt;/</span><span style="color: #800000">html</span><span style="color: #0000ff">&gt;</span><span style="color: #000000"><br />
<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" /></span></div>
<strong>onchange="submit()"</strong>
<img src ="http://www.blogjava.net/juanshuchun/aggbug/167037.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/juanshuchun/" target="_blank">*一凡*</a> 2007-12-11 20:09 <a href="http://www.blogjava.net/juanshuchun/articles/167037.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Event listeners can affect the JSF life cycle in one of three ways</title><link>http://www.blogjava.net/juanshuchun/articles/167034.html</link><dc:creator>*一凡*</dc:creator><author>*一凡*</author><pubDate>Tue, 11 Dec 2007 11:57:00 GMT</pubDate><guid>http://www.blogjava.net/juanshuchun/articles/167034.html</guid><description><![CDATA[<p>1.Let the life cycle proceed normally.</p>
<p>2.Call <strong>FacesContext.renderResponse()</strong> to skip the rest of the life cycle up to Render Response.</p>
<p>3.Call <strong>FacesContext.responseComplete()</strong> to skip the rest of the life cycle entirely.</p>
<p>See "Immediate Components" on page 287 for an example of using FacesContext.renderResponse().<br />
</p>
<div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" /><span style="color: #000000">&nbsp;&nbsp;</span><span style="color: #0000ff">private</span><span style="color: #000000">&nbsp;</span><span style="color: #0000ff">static</span><span style="color: #000000">&nbsp;</span><span style="color: #0000ff">final</span><span style="color: #000000">&nbsp;String&nbsp;US&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;</span><span style="color: #000000">"</span><span style="color: #000000">United&nbsp;States</span><span style="color: #000000">"</span><span style="color: #000000">;<br />
<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;<img src="http://www.blogjava.net/Images/dot.gif"  alt="" /><br />
<img id="Codehighlighter1_111_379_Open_Image" style="display: inline" onclick="this.style.display='none'; Codehighlighter1_111_379_Open_Text.style.display='none'; Codehighlighter1_111_379_Closed_Image.style.display='inline'; Codehighlighter1_111_379_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockStart.gif" align="top"  alt="" /><img id="Codehighlighter1_111_379_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_111_379_Closed_Text.style.display='none'; Codehighlighter1_111_379_Open_Image.style.display='inline'; Codehighlighter1_111_379_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedBlock.gif" align="top"  alt="" />&nbsp;&nbsp;</span><span style="color: #0000ff">public</span><span style="color: #000000">&nbsp;</span><span style="color: #0000ff">void</span><span style="color: #000000">&nbsp;countryChanged(ValueChangeEvent&nbsp;event)&nbsp;</span><span id="Codehighlighter1_111_379_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.blogjava.net/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_111_379_Open_Text" style="display: inline"><span style="color: #000000">{<br />
<img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;FacesContext&nbsp;context&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;FacesContext.getCurrentInstance();<br />
<img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top"  alt="" /><br />
<img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">if</span><span style="color: #000000">&nbsp;(US.equals((String)&nbsp;event.getNewValue()))<br />
<img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;context.getViewRoot().setLocale(Locale.US);<br />
<img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">else</span><span style="color: #000000"><br />
<img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;context.getViewRoot().setLocale(Locale.CANADA);<br />
<img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top"  alt="" /><br />
<img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;context.renderResponse();<br />
<img src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top"  alt="" />&nbsp;&nbsp;}</span></span></div>
<p class="docText">The call to <tt>renderResponse()</tt> skips the rest of the life cycle—including validation of the rest of the input components in the form—up to Render Response. Thus, the other validations are skipped and the response is rendered normally (in this case, the current page is <span style="color: red">redisplayed</span>).</p>
<p class="docText">To summarize, you can skip validation when a value change event fires by doing the <strong>following</strong>:</p>
<div style="font-weight: bold">
<ol class="docList" type="1">
    <li>
    <div style="font-weight: normal">
    <p class="docList">Adding an <tt>immediate</tt> attribute to your input tag</p>
    </div>
    <li>
    <div style="font-weight: normal">
    <p class="docList">Calling <tt>FacesContext.renderResponse()</tt> <strong>at the end of your listener</strong></p>
    </div>
    </li>
</ol>
</div>
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="font-size: 8pt; color: red">&nbsp;<br />
<br />
&nbsp;上文引用：《core JavaServer&#8482; Faces, Second Edition》</span> 
 <img src ="http://www.blogjava.net/juanshuchun/aggbug/167034.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/juanshuchun/" target="_blank">*一凡*</a> 2007-12-11 19:57 <a href="http://www.blogjava.net/juanshuchun/articles/167034.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>The Syntax of Value Expressions</title><link>http://www.blogjava.net/juanshuchun/articles/167023.html</link><dc:creator>*一凡*</dc:creator><author>*一凡*</author><pubDate>Tue, 11 Dec 2007 11:25:00 GMT</pubDate><guid>http://www.blogjava.net/juanshuchun/articles/167023.html</guid><description><![CDATA[<p>
<table cellspacing="0" cellpadding="4" rules="rows" frame="hsides">
    <caption>
    <h5 class="docTableTitle">Table 2-4. Predefined Objects in the Value Expression Language</h5>
    </caption>
    <colgroup span="2" align="left">
    <col width="100">
    <col width="400"></colgroup>
    <thead>
        <tr>
            <th class="docTableCell thead" style="background-color: #e6e6e6" valign="top" scope="col" align="left">Variable Name</th>
            <th class="docTableCell thead" style="background-color: #e6e6e6" valign="top" scope="col" align="left">Meaning</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td class="docTableCell" valign="top" align="left"><tt>header</tt></td>
            <td class="docTableCell" valign="top" align="left">A <tt>Map</tt> of HTTP header parameters, containing only the first value for each name.</td>
        </tr>
        <tr>
            <td class="docTableCell" valign="top" align="left"><tt>headerValues</tt></td>
            <td class="docTableCell" valign="top" align="left">A <tt>Map</tt> of HTTP header parameters, yielding a <tt>String[]</tt>array of all values for a given name.</td>
        </tr>
        <tr>
            <td class="docTableCell" valign="top" align="left"><tt>param</tt></td>
            <td class="docTableCell" valign="top" align="left">A <tt>Map</tt> of HTTP request parameters, containing only the first value for each name.</td>
        </tr>
        <tr>
            <td class="docTableCell" valign="top" align="left"><tt>paramValues</tt></td>
            <td class="docTableCell" valign="top" align="left">A <tt>Map</tt> of HTTP request parameters, yielding a <tt>String[]</tt>array of all values for a given name.</td>
        </tr>
        <tr>
            <td class="docTableCell" valign="top" align="left"><tt>cookie</tt></td>
            <td class="docTableCell" valign="top" align="left">A <tt>Map</tt> of the cookie names and values of the current request.</td>
        </tr>
        <tr>
            <td class="docTableCell" valign="top" align="left"><tt>initParam</tt></td>
            <td class="docTableCell" valign="top" align="left">A <tt>Map</tt> of the initialization parameters of this web application. Initialization parameters are discussed in <a class="docLink" href="mk:@MSITStore:E:\CooYie\项目资料收集\JSF\Core.JavaServer.Faces.Second.Edition.May.2007.chm::/ch10.htm#ch10">Chapter 10</a>.</td>
        </tr>
        <tr>
            <td class="docTableCell" valign="top" align="left"><tt>requestScope</tt></td>
            <td class="docTableCell" valign="top" align="left">A <tt>Map</tt> of all request scope attributes.</td>
        </tr>
        <tr>
            <td class="docTableCell" valign="top" align="left"><tt><font style="background-color: #0a246a" color="#ffffff">sessionScope</font></tt></td>
            <td class="docTableCell" valign="top" align="left">A <tt>Map</tt> of all session scope attributes.</td>
        </tr>
        <tr>
            <td class="docTableCell" valign="top" align="left"><tt>applicationScope</tt></td>
            <td class="docTableCell" valign="top" align="left">A <tt>Map</tt> of all application scope attributes.</td>
        </tr>
        <tr>
            <td class="docTableCell" valign="top" align="left"><tt>facesContext</tt></td>
            <td class="docTableCell" valign="top" align="left">The <tt>FacesContext</tt> instance of this request. This class is discussed in <a class="docLink" href="mk:@MSITStore:E:\CooYie\项目资料收集\JSF\Core.JavaServer.Faces.Second.Edition.May.2007.chm::/ch6.htm#ch06">Chapter 6</a>.</td>
        </tr>
        <tr>
            <td class="docTableCell" valign="top" align="left"><tt>view</tt></td>
            <td class="docTableCell" valign="top" align="left">The <tt>UIViewRoot</tt> instance of this request. This class is discussed in </td>
        </tr>
    </tbody>
</table>
</p>
<p class="docText">&nbsp;Finally, if the name is still not found, it is passed to the <tt><span style="color: red"><tt>VariableResolver</tt> </span></tt>of the JSF application. The default variable resolver looks up <tt>managed-bean</tt> elements in a configuration resource, typically the <tt>faces-config.xml</tt> file.<br />
<br />
Consider, for example, the expression</p>
<p>&nbsp; #{user.password}</p>
<p><br />
The term user is not one of the predefined(预定义) objects. When it is encountered（遇到） for the first time, it is not an attribute name in request, session, or application scope.</p>
<p>Therefore, the variable resolver processes the faces-config.xml entry:</p>
<p>&nbsp; &lt;managed-bean&gt; <br />
&nbsp;&nbsp;&nbsp;&nbsp; &lt;managed-bean-name&gt;user&lt;/managed-bean-name&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp; &lt;managed-bean-class&gt;com.corejsf.UserBean&lt;/managed-bean-class&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp; &lt;managed-bean-scope&gt;session&lt;/managed-bean-scope&gt; <br />
&nbsp; &lt;/managed-bean&gt;</p>
<p><br />
The variable resolver calls the default constructor of the class com.corejsf.User-Bean. Next, <strong>it adds an association to the sessionScope map</strong>. Finally, it returns the object as the result of the lookup.<br />
</p>
<p>When the term <tt>user</tt> <strong>needs to be resolved again</strong> in the same session, it is located in the session scope<br />
<br />
<br />
Composite Expressions<br />
&nbsp;&nbsp;&nbsp;&nbsp;</p>
<p>You can use a limited set of operators inside value expressions:</p>
<p>Arithmetic operators + - * / %. The last two operators have alphabetic variants div and mod.</p>
<p>Relational operators &lt; &lt;= &gt; &gt;= == != and their alphabetic variants lt le gt ge eq ne. The first four variants are required for XML safety.</p>
<p>Logical operators &amp;&amp; || ! and their alphabetic variants and or not. The first variant is required for XML safety.</p>
<p>The empty operator. The expression empty a is true if a is null, an array or String of length 0, or a Collection or Map of size 0.</p>
<p>The ternary ?: selection operator.<br />
</p>
<p class="docText">&nbsp;Operator precedence follows the same rules as in Java. The <tt>empty</tt> operator has the same precedence as the unary <tt>-</tt> and <tt>!</tt> operators.</p>
<p class="docText">&nbsp;Generally, you do not want to do a lot of expression computation in web pages—that would violate the separation of presentation and business logic. However, occasionally, the presentation layer can benefit from operators. For example, suppose you want to hide a component when the <tt>hide</tt> property of a bean is true. To hide a component, you set its <tt>rendered</tt> attribute to <tt>false</tt>. Inverting the bean value requires the <tt>!</tt> (or <tt>not</tt>) operator:</p>
<div class="docText">
<pre>  &lt;h:inputText rendered="#{!bean.hide}" ... /&gt;</pre>
</div>
<p><br />
&nbsp;</p>
<p class="docText">Finally, you can concatenate plain strings and value expressions by placing them next to each other. Consider, for example,</p>
<div class="docText">
<pre>  &lt;h:outputText value="#{messages.greeting}, #{user.name}!"/&gt;</pre>
</div>
<p><br />
&nbsp;</p>
<p class="docText">The statement concatenates four strings: the string returned from <tt>#{messages. greeting}</tt>, the string consisting of a comma and a space, the string returned from <tt>#{user.name}</tt>, and the string consisting of an exclamation mark.</p>
<p><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
<span style="font-size: 8pt; color: red">上文出自：《core JavaServer&#8482; Faces, Second Edition》</span></p>
<img src ="http://www.blogjava.net/juanshuchun/aggbug/167023.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/juanshuchun/" target="_blank">*一凡*</a> 2007-12-11 19:25 <a href="http://www.blogjava.net/juanshuchun/articles/167023.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>使用动态选择菜单</title><link>http://www.blogjava.net/juanshuchun/articles/167017.html</link><dc:creator>*一凡*</dc:creator><author>*一凡*</author><pubDate>Tue, 11 Dec 2007 11:05:00 GMT</pubDate><guid>http://www.blogjava.net/juanshuchun/articles/167017.html</guid><description><![CDATA[<div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><img alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /><span style="color: #000000">&lt;</span><span style="color: #000000">h:selectOneMenu&nbsp;value</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">#{form.country}</span><span style="color: #000000">"</span><span style="color: #000000">&nbsp;onchange</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">submit()</span><span style="color: #000000">"</span><span style="color: #000000"><br />
<img alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;valueChangeListener</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">#{form.countryChanged}</span><span style="color: #000000">"</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
<img alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">f:selectItems&nbsp;value</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">#{form.countryNames}</span><span style="color: #000000">"</span><span style="color: #000000">/&gt;</span><span style="color: #000000"><br />
<img alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />&nbsp;&nbsp;</span><span style="color: #000000">&lt;/</span><span style="color: #000000">h:selectOneMenu</span><span style="color: #000000">&gt;</span></div>
<br />
<strong>onchange="submit()"</strong><br />
<br />
&lt;f:selectItems <strong style="color: red">value="#{form.countryNames}"/</strong>&gt;&nbsp;&nbsp;&nbsp;@ Specifies items for a select one or select many component 
<img src ="http://www.blogjava.net/juanshuchun/aggbug/167017.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/juanshuchun/" target="_blank">*一凡*</a> 2007-12-11 19:05 <a href="http://www.blogjava.net/juanshuchun/articles/167017.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Using from-action</title><link>http://www.blogjava.net/juanshuchun/articles/167012.html</link><dc:creator>*一凡*</dc:creator><author>*一凡*</author><pubDate>Tue, 11 Dec 2007 10:52:00 GMT</pubDate><guid>http://www.blogjava.net/juanshuchun/articles/167012.html</guid><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; In addition to the from-outcome element, there is also a from-action element. That flexibility can be useful if you have two separate actions with the same action string <strong style="color: red">or</strong> two action method expressions that return the same action string.<br />
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;For example, suppose that in our quiz application, the startOverAction returns the string "again" instead of "startOver". The same string can be returned by the answerAction. To differentiate between the two navigation cases, you can use a from-action element. The contents of the element must be identical to the method expression string of the action attribute:</p>
<div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><img alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /><span style="color: #000000">&nbsp;&nbsp;</span><span style="color: #0000ff">&lt;</span><span style="color: #800000">navigation-case</span><span style="color: #0000ff">&gt;</span><span style="color: #000000"><br />
<img alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">&lt;</span><span style="color: #800000">from-action</span><span style="color: #0000ff">&gt;</span><span style="color: #000000">#{quiz.answerAction}</span><span style="color: #0000ff">&lt;/</span><span style="color: #800000">from-action</span><span style="color: #0000ff">&gt;</span><span style="color: #000000"><br />
<img alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">&lt;</span><span style="color: #800000">from-outcome</span><span style="color: #0000ff">&gt;</span><span style="color: #000000">again</span><span style="color: #0000ff">&lt;/</span><span style="color: #800000">from-outcome</span><span style="color: #0000ff">&gt;</span><span style="color: #000000"><br />
<img alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">&lt;</span><span style="color: #800000">to-view-id</span><span style="color: #0000ff">&gt;</span><span style="color: #000000">/again.jsp</span><span style="color: #0000ff">&lt;/</span><span style="color: #800000">to-view-id</span><span style="color: #0000ff">&gt;</span><span style="color: #000000"><br />
<img alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />&nbsp;&nbsp;</span><span style="color: #0000ff">&lt;/</span><span style="color: #800000">navigation-case</span><span style="color: #0000ff">&gt;</span><span style="color: #000000"><br />
<img alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />&nbsp;&nbsp;</span><span style="color: #0000ff">&lt;</span><span style="color: #800000">navigation-case</span><span style="color: #0000ff">&gt;</span><span style="color: #000000"><br />
<img alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">&lt;</span><span style="color: #800000">from-action</span><span style="color: #0000ff">&gt;</span><span style="color: #000000">#{quiz.startOverAction}</span><span style="color: #0000ff">&lt;/</span><span style="color: #800000">from-action</span><span style="color: #0000ff">&gt;</span><span style="color: #000000"><br />
<img alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">&lt;</span><span style="color: #800000">from-outcome</span><span style="color: #0000ff">&gt;</span><span style="color: #000000">again</span><span style="color: #0000ff">&lt;/</span><span style="color: #800000">from-outcome</span><span style="color: #0000ff">&gt;</span><span style="color: #000000"><br />
<img alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">&lt;</span><span style="color: #800000">to-view-id</span><span style="color: #0000ff">&gt;</span><span style="color: #000000">/index.jsp</span><span style="color: #0000ff">&lt;/</span><span style="color: #800000">to-view-id</span><span style="color: #0000ff">&gt;</span><span style="color: #000000"><br />
<img alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />&nbsp;&nbsp;</span><span style="color: #0000ff">&lt;/</span><span style="color: #800000">navigation-case</span><span style="color: #0000ff">&gt;</span><span style="color: #000000"><br />
<img alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /></span></div>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="font-size: 10pt; color: red">上文出自：《core JavaServer&#8482; Faces, Second Edition》</span> 
<img src ="http://www.blogjava.net/juanshuchun/aggbug/167012.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/juanshuchun/" target="_blank">*一凡*</a> 2007-12-11 18:52 <a href="http://www.blogjava.net/juanshuchun/articles/167012.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>使用通配符导航</title><link>http://www.blogjava.net/juanshuchun/articles/167010.html</link><dc:creator>*一凡*</dc:creator><author>*一凡*</author><pubDate>Tue, 11 Dec 2007 10:40:00 GMT</pubDate><guid>http://www.blogjava.net/juanshuchun/articles/167010.html</guid><description><![CDATA[<p>You can use wildcards in the from-view-id element of a navigation rule, for example:</p>
<div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><img alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /><span style="color: #000000">&nbsp;&nbsp;</span><span style="color: #0000ff">&lt;</span><span style="color: #800000">navigation-rule</span><span style="color: #0000ff">&gt;</span><span style="color: #000000"><br />
<img alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">&lt;</span><span style="color: #800000">from-view-id</span><span style="color: #0000ff">&gt;</span><span style="color: #000000">/secure/*</span><span style="color: #0000ff">&lt;/</span><span style="color: #800000">from-view-id</span><span style="color: #0000ff">&gt;</span><span style="color: #000000"><br />
<img alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">&lt;</span><span style="color: #800000">navigation-case</span><span style="color: #0000ff">&gt;</span><span style="color: #000000"><br />
<img alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img alt="" src="http://www.blogjava.net/Images/dot.gif" /><br />
<img alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">&lt;/</span><span style="color: #800000">navigation-case</span><span style="color: #0000ff">&gt;</span><span style="color: #000000"><br />
<img alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />&nbsp;&nbsp;</span><span style="color: #0000ff">&lt;/</span><span style="color: #800000">navigation-rule</span><span style="color: #0000ff">&gt;</span></div>
<p>This rule applies to all pages that start with the prefix /secure/. <strong>Only a single * is allowed, and it <span style="color: red">must</span> be at the end of the ID string.</strong></p>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="font-size: 10pt; color: red">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;上文出自：《core JavaServer&#8482; Faces, Second&nbsp;Edition》</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
   <img src ="http://www.blogjava.net/juanshuchun/aggbug/167010.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/juanshuchun/" target="_blank">*一凡*</a> 2007-12-11 18:40 <a href="http://www.blogjava.net/juanshuchun/articles/167010.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>把导航规则放在faces-config.xml 之外</title><link>http://www.blogjava.net/juanshuchun/articles/167009.html</link><dc:creator>*一凡*</dc:creator><author>*一凡*</author><pubDate>Tue, 11 Dec 2007 10:37:00 GMT</pubDate><guid>http://www.blogjava.net/juanshuchun/articles/167009.html</guid><description><![CDATA[<p>Files listed in the javax.faces.CONFIG_FILES initialization parameter inside WEB-INF/web.xml. For example,</p>
<div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" /><span style="color: #0000ff">&lt;</span><span style="color: #800000">web-app</span><span style="color: #0000ff">&gt;</span><span style="color: #000000"><br />
<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">&lt;</span><span style="color: #800000">context-param</span><span style="color: #0000ff">&gt;</span><span style="color: #000000"><br />
<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">&lt;</span><span style="color: #800000">param-name</span><span style="color: #0000ff">&gt;</span><span style="color: #000000">javax.faces.CONFIG_FILES</span><span style="color: #0000ff">&lt;/</span><span style="color: #800000">param-name</span><span style="color: #0000ff">&gt;</span><span style="color: #000000"><br />
<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">&lt;</span><span style="color: #800000">param-value</span><span style="color: #0000ff">&gt;</span><span style="color: #000000">WEB-INF/navigation.xml,WEB-INF/beans.xml</span><span style="color: #0000ff">&lt;/</span><span style="color: #800000">param-value</span><span style="color: #0000ff">&gt;</span><span style="color: #000000"><br />
<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">&lt;/</span><span style="color: #800000">context-param</span><span style="color: #0000ff">&gt;</span><span style="color: #000000"><br />
<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;<img src="http://www.blogjava.net/Images/dot.gif"  alt="" /><br />
<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" /></span><span style="color: #0000ff">&lt;/</span><span style="color: #800000">web-app</span><span style="color: #0000ff">&gt;</span></div>
<p>(This mechanism is <strong>attractive for builder tools</strong> because it separates navigation, beans, etc.)<br />
</p>
navigation.xml ：navigation-rule<br />
beans.xml&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ：managed-bean
<img src ="http://www.blogjava.net/juanshuchun/aggbug/167009.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/juanshuchun/" target="_blank">*一凡*</a> 2007-12-11 18:37 <a href="http://www.blogjava.net/juanshuchun/articles/167009.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>JSF Advanced Navigation :: redirect </title><link>http://www.blogjava.net/juanshuchun/articles/167008.html</link><dc:creator>*一凡*</dc:creator><author>*一凡*</author><pubDate>Tue, 11 Dec 2007 10:09:00 GMT</pubDate><guid>http://www.blogjava.net/juanshuchun/articles/167008.html</guid><description><![CDATA[<p class="docText">&nbsp;&nbsp;&nbsp; &nbsp;If you add a <tt><font style="background-color: #0a246a" color="#ffffff">redirect</font></tt> element after <tt>to-view-id</tt>, then the JSP container terminates the current request and sends an HTTP <font style="background-color: #0a246a" color="#ffffff">redirect</font> to the client. The <font style="background-color: #0a246a" color="#ffffff">redirect</font> response tells the client which URL to use for the next page.</p>
<p class="docText">&nbsp;&nbsp;&nbsp;&nbsp;<strong>Redirecting the page is slower than forwarding because another round trip to the browser is involved. However, the redirection gives the browser a chance to update its address field.</strong></p>
<p class="docText"><a class="docLink" href="mk:@MSITStore:E:\CooYie\项目资料收集\JSF\Core.JavaServer.Faces.Second.Edition.May.2007.chm::/ch03lev1sec3.htm#ch03fig08">Figure 3-8</a> shows how the address field changes when you add a redirection element, as follows:</p>
<div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" /><span style="color: #0000ff">&lt;</span><span style="color: #800000">navigation-case</span><span style="color: #0000ff">&gt;</span><span style="color: #000000"><br />
<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">&lt;</span><span style="color: #800000">from-outcome</span><span style="color: #0000ff">&gt;</span><span style="color: #000000">success</span><span style="color: #0000ff">&lt;/</span><span style="color: #800000">from-outcome</span><span style="color: #0000ff">&gt;</span><span style="color: #000000"><br />
<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">&lt;</span><span style="color: #800000">to-view-id</span><span style="color: #0000ff">&gt;</span><span style="color: #000000">/success.jsp</span><span style="color: #0000ff">&lt;/</span><span style="color: #800000">to-view-id</span><span style="color: #0000ff">&gt;</span><span style="color: #000000"><br />
<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">&lt;</span><span style="color: #800000">redirect</span><span style="color: #0000ff">/&gt;</span><span style="color: #000000"><br />
<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" /></span><span style="color: #0000ff">&lt;/</span><span style="color: #800000">navigation-case</span><span style="color: #0000ff">&gt;</span></div>
<p><img id="" height="394" alt="" src="mk:@MSITStore:E:\CooYie\项目资料收集\JSF\Core.JavaServer.Faces.Second.Edition.May.2007.chm::/ch03lev1sec3_files/ile.jpg" width="610" border="0" /></p>
<p>Without redirection, the original URL (<tt>localhost:8080/javaquiz/index.faces</tt>) is <span style="color: red">unchanged</span> when the user moves from the <tt>/index.jsp </tt>&nbsp;page to the <tt>/success.jsp</tt> face. With redirection, the browser displays the new URL (<tt>localhost:8080/ javaquiz/success.faces</tt>).</p>
<p class="docNoteTitle"><span style="color: red">Tip</span></p>
<p>
<table cellspacing="0" cellpadding="1" width="90%" border="0">
    <tbody>
        <tr>
            <td valign="top" width="60"><img id="" height="24" alt="" src="mk:@MSITStore:E:\CooYie\项目资料收集\JSF\Core.JavaServer.Faces.Second.Edition.May.2007.chm::/ch03lev1sec3_files/getfile[3].jpg" width="25" align="left" border="0" /> </td>
            <td valign="top">
            <p class="docText">Use the <tt><font style="background-color: #0a246a" color="#ffffff">redirect</font></tt> element for pages that the user might want to bookmark.</p>
            </td>
        </tr>
    </tbody>
</table>
</p>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="font-size: 10pt; color: red">上文出自：《core JavaServer&#8482; Faces, Second Edition》</span>
<img src ="http://www.blogjava.net/juanshuchun/aggbug/167008.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/juanshuchun/" target="_blank">*一凡*</a> 2007-12-11 18:09 <a href="http://www.blogjava.net/juanshuchun/articles/167008.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>JavaServer Faces: The Complete Reference </title><link>http://www.blogjava.net/juanshuchun/articles/167002.html</link><dc:creator>*一凡*</dc:creator><author>*一凡*</author><pubDate>Tue, 11 Dec 2007 09:51:00 GMT</pubDate><guid>http://www.blogjava.net/juanshuchun/articles/167002.html</guid><description><![CDATA[<span style="font-size: 10pt"><strong>JSF 实现必须的库<br />
</strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;构建JSF应用程序时必须的关键jar文件是 <span style="color: red">jsf-api.jar </span>和 <span style="color: red">jsf-impl.jar </span>。<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;除了核心JSF运行时jar文件，还需要一些关键的&#8220;公共&#8221;jar文件（commons-beanutils.jar&nbsp;&nbsp;&nbsp;&nbsp; commonscollections.jar&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; commons-digester.jar&nbsp;&nbsp;&nbsp; commons-logging.jar&nbsp;）<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><span style="color: #008080">&nbsp;1</span>&nbsp;<span style="color: #008000">#</span><span style="color: #008000">&nbsp;Jars&nbsp;for&nbsp;implementations&nbsp;of&nbsp;JCP&nbsp;standards</span><span style="color: #008000"><br />
</span><span style="color: #008080">&nbsp;2</span>&nbsp;<span style="color: #000000">standard.jar</span><span style="color: #000000">=</span><span style="color: #000000">local&nbsp;path&nbsp;to&nbsp;JSTL&nbsp;standard.jar<br />
</span><span style="color: #008080">&nbsp;3</span>&nbsp;<span style="color: #000000">jsf</span><span style="color: #000000">-</span><span style="color: #000000">impl.jar</span><span style="color: #000000">=</span><span style="color: #000000">local&nbsp;path&nbsp;to&nbsp;jsf</span><span style="color: #000000">-</span><span style="color: #000000">impl.jar<br />
</span><span style="color: #008080">&nbsp;4</span>&nbsp;<span style="color: #000000"><br />
</span><span style="color: #008080">&nbsp;5</span>&nbsp;<span style="color: #000000"><br />
</span><span style="color: #008080">&nbsp;7</span>&nbsp;<span style="color: #008000">#</span><span style="color: #008000">&nbsp;Jars&nbsp;for&nbsp;miscellaneous&nbsp;dependencies&nbsp;required&nbsp;#by&nbsp;Sun's&nbsp;JSF&nbsp;1.1</span><span style="color: #008000"><br />
</span><span style="color: #008080">&nbsp;8</span>&nbsp;<span style="color: #008000">#</span><span style="color: #008000">&nbsp;implementation</span><span style="color: #008000"><br />
</span><span style="color: #008080">&nbsp;9</span>&nbsp;<span style="color: #000000">commons</span><span style="color: #000000">-</span><span style="color: #000000">beanutils.jar</span><span style="color: #000000">=</span><span style="color: #000000">local&nbsp;path&nbsp;to&nbsp;commons</span><span style="color: #000000">-</span><span style="color: #000000">beanutils.jar<br />
</span><span style="color: #008080">10</span>&nbsp;<span style="color: #000000">commons</span><span style="color: #000000">-</span><span style="color: #000000">collections.jar</span><span style="color: #000000">=</span><span style="color: #000000">local&nbsp;path&nbsp;to&nbsp;commons</span><span style="color: #000000">-</span><span style="color: #000000">collections.jar<br />
</span><span style="color: #008080">11</span>&nbsp;<span style="color: #000000">commons</span><span style="color: #000000">-</span><span style="color: #000000">digester.jar</span><span style="color: #000000">=</span><span style="color: #000000">local&nbsp;path&nbsp;to&nbsp;commons</span><span style="color: #000000">-</span><span style="color: #000000">digester.jar<br />
</span><span style="color: #008080">12</span>&nbsp;<span style="color: #000000">commons</span><span style="color: #000000">-</span><span style="color: #000000">logging.jar</span><span style="color: #000000">=</span><span style="color: #000000">local&nbsp;path&nbsp;to&nbsp;commons</span><span style="color: #000000">-</span><span style="color: #000000">logging.jar</span></div>
</span>
 <img src ="http://www.blogjava.net/juanshuchun/aggbug/167002.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/juanshuchun/" target="_blank">*一凡*</a> 2007-12-11 17:51 <a href="http://www.blogjava.net/juanshuchun/articles/167002.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>少儿不宜的素描</title><link>http://www.blogjava.net/juanshuchun/articles/166653.html</link><dc:creator>*一凡*</dc:creator><author>*一凡*</author><pubDate>Mon, 10 Dec 2007 06:26:00 GMT</pubDate><guid>http://www.blogjava.net/juanshuchun/articles/166653.html</guid><wfw:comment>http://www.blogjava.net/juanshuchun/comments/166653.html</wfw:comment><comments>http://www.blogjava.net/juanshuchun/articles/166653.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/juanshuchun/comments/commentRss/166653.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/juanshuchun/services/trackbacks/166653.html</trackback:ping><description><![CDATA[<embed align="center" src="http://player.youku.com/player.php/sid/XODc1NDg4NA==/v.swf" width="450" height="372" type="application/x-shockwave-flash" quality="high" allowscriptaccess="sameDomain"></embed> 
 <img src ="http://www.blogjava.net/juanshuchun/aggbug/166653.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/juanshuchun/" target="_blank">*一凡*</a> 2007-12-10 14:26 <a href="http://www.blogjava.net/juanshuchun/articles/166653.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>【转】30岁前不要去在乎的29件事</title><link>http://www.blogjava.net/juanshuchun/articles/166467.html</link><dc:creator>*一凡*</dc:creator><author>*一凡*</author><pubDate>Sun, 09 Dec 2007 08:47:00 GMT</pubDate><guid>http://www.blogjava.net/juanshuchun/articles/166467.html</guid><description><![CDATA[<p><span style="font-size: 10pt">&nbsp;1、放弃&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></p>
<p><span style="font-size: 10pt">　　把握的反面就是放弃，选择了一个机会，就等于放弃了其他所有的可能。<span style="color: red">当新的机会摆在面前的时候，敢于放弃已经获得的一切，这不是功亏一篑，这不是半途而废，这是为了谋求更大的发展空间</span>；或者什么都不为，只因为喜欢这样做，因为，年轻就是最大的机会。人，只有在三十岁之前才会有这个胆量，有这个别资本，有这个资格。&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></p>
<p><span style="font-size: 10pt">2、失恋&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></p>
<p><span style="font-size: 10pt">　　不是不在乎，是在乎不起。三十岁前最怕失去的不是已经拥有的东西，而是梦想。爱情如果只是一个过程，那么正是这个年龄应当经历的，如果要承担结果，三十岁以后，可能会更有能力，更有资格。<span style="color: red">其实，三十岁之前我们要做的事情很多，稍纵即逝，过久地沉溺在已经乾涸的爱河的河床中，与这个年龄的生命节奏不合</span>。&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></p>
<p><span style="font-size: 10pt">3、离婚&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></p>
<p><span style="font-size: 10pt">　　不是不在乎，是一切还来得及。一位三十八岁的女友与老公结婚十五年，冷战十三年，终于分手。她说：「如果说后来不愿意离婚是为了孩子，那他第一次提出离婚我没有同意，现在想来真不知道为什么。如果那个时候早分手，我的生活绝不会是今天这个样子。现在再重新开始，总觉得一切都晚了。&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></p>
<p><span style="font-size: 10pt">4、漂泊&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></p>
<p><span style="font-size: 10pt">　　漂泊不是一种不幸，而是一种资格。趁著没有家室拖累，趁著身体健康，此时不飘何时飘？当然，漂泊的不一定是身体，也许只是幻想和梦境。新世纪的时尚领袖是飘一代，渴望漂泊的人惟一不飘的是那颗心。&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></p>
<p><span style="font-size: 10pt">5、失业&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></p>
<p><span style="font-size: 10pt">　　三十岁以前就尝到失业的滋味当然是一件不幸的事，但不一定是坏事。<span style="color: red">三十岁之前就过早地固定在一个职业上终此一生也许才是最大的不幸</span>。失业也许让你想起埋藏很久而尘封的梦想，也许会唤醒连你自己都从未知道的潜能。也许你本来就没什么梦想，这时候也会逼著你去做梦。&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></p>
<p><span style="font-size: 10pt">6、时尚&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></p>
<p><span style="font-size: 10pt">　　<span style="color: red">不要追赶时尚</span>。按说青年人应该是最时尚的，但是独立思考和个性生活更重要。在这个物质社会，其实对时尚的追求早已经成为对金钱的追求。<span style="color: red">今天，时尚是物欲和世俗的同义语。</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></p>
<p><span style="font-size: 10pt">7、格调&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></p>
<p><span style="font-size: 10pt">　　这是小资的东西，「小资」这个词在今天又二度流行，追求格调就是他们的专利。小资们说，有格调要满足四大要件：智慧、素养、自信和金钱。格调就是把「高尚」理解成穿著、气质、爱好的品味和室内装潢。也就是大老粗只会表现谈吐的庸俗，「小资」们已经有能力庸俗他们的心灵了。主流观念倒不是非要另类，另类已经成为年轻人观念的主流了，在今天，老土倒显得另类。关键是当今社会是一个创造观念的时代，而不是一个固守陈旧观念的时代。&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></p>
<p><span style="font-size: 10pt">8、评价&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></p>
<p><span style="font-size: 10pt">　　我们最不应该做出的牺牲就是因为别人的评价而改变自我，因为那些对你指手画脚的人自己也不知道他们遵从的规则是什么。<span style="color: red">千万不要只遵从规矩做事，规矩还在创造之中，要根据自己的判断做每一件事，虽然这样会麻烦一点。</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></p>
<p><span style="font-size: 10pt">9、幼稚&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></p>
<p><span style="font-size: 10pt">　　不要怕人说我们幼稚，这正说明你还年轻，还充满活力。「成熟」是个吓人的词儿，也是个害人的词儿。成熟和幼稚是对一个人最大而无当、最不负责任、最没用的概括。那些庸人，绝不会有人说他们幼稚。不信，到哪天你被生活压得老气横秋，暮气沉沉的时候，人们一定会说你成熟了，你就会知道「成熟」是个什么东西。&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></p>
<p><span style="font-size: 10pt">10、不适应&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></p>
<p><span style="font-size: 10pt">　　在一首摇滚里有这么一句：「这个城市改变了我，这个城市不需要我。」<span style="color: red">不要盲目地适应你生存的环境，因为很可能这环境自身已经不适应这个社会的发展了。</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></p>
<p><span style="font-size: 10pt">11、失败&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></p>
<p><span style="font-size: 10pt">　　我的老师曾经跟我说，一个人起码要在感情上失恋一次，在事业上失败一次，<span style="color: red">在选择上失误一次，才能长大</span>。不要说失败是成功之母那样的老话，<span style="color: red">失败来得越早越好</span>，要是三十岁，四十岁之后再经历失败，有些事，很可能就来不及了。&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></p>
<p><span style="font-size: 10pt">12、错误&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></p>
<p><span style="font-size: 10pt">　　这是年轻人的专利。</span></p>
<p><span style="font-size: 10pt">13、浅薄&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></p>
<p><span style="font-size: 10pt">　　如果每看一次《泰坦尼克号》就流一次眼泪，每看一次《大话西游》就笑得直不起腰，就会有人笑你浅薄。其实那只能说明你的神经依旧非常敏锐，对哪怕非常微弱的刺激都会迅速做出适应的反应；等你的感觉迟钝了，人们就会说你深沉了。&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></p>
<p><span style="font-size: 10pt">14、明星&nbsp;&nbsp; </span></p>
<p><span style="font-size: 10pt">　　不是不必在乎，是不能在乎。明星在商品社会是一种消费品，花了钱，听了歌，看了电影，明星们的表现再好，不过是物超所值而己，也不值得崇拜呀？就像你在地摊上花五十块钱买的裙子，别人都猜是八百块钱买的，物超所值了吧？你就崇拜上这身裙子了？&nbsp;&nbsp; </span></p>
<p><span style="font-size: 10pt">15、代价&nbsp;&nbsp; </span></p>
<p><span style="font-size: 10pt">　　不是不计代价，而是要明白做任何事都要付出代价。对我们这个年龄的人来说，这绝不是一句废话。否则，要到三十岁的时候才会明白自己曾经付出了多少代价，却不明白为什么付出，更不明白自己得到了多少，得到什么。&nbsp;&nbsp; </span></p>
<p><span style="font-size: 10pt">16、孤独&nbsp;&nbsp; </span></p>
<p><span style="font-size: 10pt">　　<span style="color: red">这是为自由付出的代价。&nbsp;</span>&nbsp; </span></p>
<p><span style="font-size: 10pt">17、失意&nbsp;&nbsp; </span></p>
<p><span style="font-size: 10pt">　　包括感情上的，事业上的，也许仅仅是今天花了冤枉钱没买到可心的东西，朋友家高朋满座自己却插不上一句话。过分在乎失意的感受不是拿命运的捉弄来捉弄自己，就是拿别人的错误来惩罚自己。&nbsp;&nbsp; </span></p>
<p><span style="font-size: 10pt">18、缺陷&nbsp;&nbsp; </span></p>
<p><span style="font-size: 10pt">　　也许你个子矮，也许你长得不好看，也许你的嗓音像唐老鸭、、、那么你的优势就是你不会被自己表面的浅薄的亮点所耽搁，少花一些时间，少走一些弯，直接发现你内在的优势，直接挖掘自己深层的潜能。&nbsp;&nbsp; </span></p>
<p><span style="font-size: 10pt">19、误会&nbsp;&nbsp; </span></p>
<p><span style="font-size: 10pt">　　如果出于恶意，那么解释也没有用；如果出于善意，就不需要解释。专门说到「误会」倒不是因为一个人在三十岁之前被人误会的时候更多，而是这个年龄的人想不开的时候更多。&nbsp;&nbsp; </span></p>
<p><span style="font-size: 10pt">20、谣言&nbsp;&nbsp; </span></p>
<p><span style="font-size: 10pt">　　这是一种传染病，沈默是最好的疫苗。除非你能找出传染源，否则解释恰恰会成为病毒传播最理想的条件。&nbsp;&nbsp; </span></p>
<p><span style="font-size: 10pt">21、疯狂&nbsp;&nbsp; </span></p>
<p><span style="font-size: 10pt">　　这是年轻人最好的心理调适，只能说明你精力旺盛，身心健康。说你「疯狂」是某些生活压抑、心力交瘁的中老年人恶意的评价，他们就像一部年久修的机器，最需要调适，但只能微调，一次大修就会让他们完诞。&nbsp;&nbsp; </span></p>
<p><span style="font-size: 10pt">22、稳定&nbsp;&nbsp; </span></p>
<p><span style="font-size: 10pt">　　三十岁之前就在乎稳定的生活，那只有两种可能，要么就是中了彩票，要么就是未老先衰。&nbsp;&nbsp; </span></p>
<p><span style="font-size: 10pt">23、压力&nbsp;&nbsp; </span></p>
<p><span style="font-size: 10pt">　　中年人能够承受多大压力检验的是他的韧性；年轻人能承受多大压力，焕发的是他的潜能。&nbsp;&nbsp; <br />
&nbsp;&nbsp; <br />
24、出国&nbsp;&nbsp; </span></p>
<p><span style="font-size: 10pt">　　也许是个机会，也许是个陷阱。除非从考大学的那一刻你就抱著这个目标，否则，对待出国的态度应该像对待爱情一样，<span style="color: red">努力争取，成败随缘</span>。&nbsp;&nbsp; </span></p>
<p><span style="font-size: 10pt">25、薪水&nbsp;&nbsp; </span></p>
<p><span style="font-size: 10pt">　　只是给人打工，薪水再高也高不到哪儿去。所以<span style="color: red">在三十岁之前，机会远比金钱重要</span>，<span style="color: red">事业远比金钱重要</span>，<span style="color: red">将来远比金钱重要</span>。对大多数人来说，<span style="color: red">三十</span><span style="color: red">岁之前干事业的首要目标绝不是挣钱，而是挣未来</span>。&nbsp;&nbsp; </span></p>
<p><span style="font-size: 10pt">26、存款&nbsp;&nbsp; </span></p>
<p><span style="font-size: 10pt">　　这倒不一定是因为我们钱少，年轻人现在谁都知道钱是有生命的。机会这么多，条件这么好，可以拿钱去按揭，做今天的事，花明天的钱；也可以拿钱去投资，拿钱去「充电」。<span style="color: red">钱只有在它流通的过程中才是钱，否则只 是一叠世界上质量最好的废纸</span>。&nbsp;&nbsp; </span></p>
<p><span style="font-size: 10pt">&nbsp;&nbsp; <br />
27、房子&nbsp;&nbsp; </span></p>
<p><span style="font-size: 10pt">　　<span style="color: red">除非你买房子是为了升值，要嘛就是你结婚了</span>。我有个同学，家在外地，大学毕业之后，单位没有宿舍，家里就给他买了一套房子。他曾经有过去北京工作的机会，但是他觉得刚买了房子就离开这座城市说不过去，就放弃了。到现在他工作稳定，但一事无成。唯一的成就就是结婚了，并且有了孩子，因为他觉得不该让这房子永远空著，所以房子变成了家。房子是都市生活的寓言，这个寓言不应该过早的和我们相关。&nbsp;&nbsp; </span></p>
<p><span style="font-size: 10pt">28、年龄&nbsp;&nbsp; </span></p>
<p><span style="font-size: 10pt">　　女孩子一过二十五就开始隐瞒自己的年龄，其实大可不必。现在青年期都延迟到四十五岁了，二十五又算得了什么呢？&nbsp;&nbsp; </span></p>
<p><span style="font-size: 10pt">29、在乎&nbsp;&nbsp; </span></p>
<p><span style="font-size: 10pt; color: red">　　这是一种拿不起、放不下的心态，它的反面不是放弃，而是天马行空，自由自在，永远保持革命乐观主义的精神。</span></p>
<img src ="http://www.blogjava.net/juanshuchun/aggbug/166467.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/juanshuchun/" target="_blank">*一凡*</a> 2007-12-09 16:47 <a href="http://www.blogjava.net/juanshuchun/articles/166467.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>MYSQL常用命令</title><link>http://www.blogjava.net/juanshuchun/articles/166145.html</link><dc:creator>*一凡*</dc:creator><author>*一凡*</author><pubDate>Fri, 07 Dec 2007 13:25:00 GMT</pubDate><guid>http://www.blogjava.net/juanshuchun/articles/166145.html</guid><description><![CDATA[<p style="font-size: 10.5pt; margin: 0in; color: black; font-family: Arial"><span style="font-size: 8pt">有很多朋友虽然安装好了mysql但却不知如何使用它。在这篇文章中我们就从连接MYSQL、修改密码、增加用户等方面来学习一些MYSQL的常用命令。 </span></p>
<p style="font-size: 10.5pt; margin: 0in; color: black; font-family: Arial"><span style="font-size: 8pt">一、连接MYSQL。 </span></p>
<p style="font-size: 10.5pt; margin: 0in; color: black; font-family: Arial"><span style="font-size: 8pt">格式： mysql -h主机地址 -u用户名 －p用户密码 </span></p>
<p style="font-size: 10.5pt; margin: 0in; color: black; font-family: Arial"><span style="font-size: 8pt">1、例1：连接到本机上的MYSQL。 </span></p>
<p style="font-size: 10.5pt; margin: 0in; color: black; font-family: Arial"><span style="font-size: 8pt">首先在打开DOS窗口，然后进入目录 mysqlbin，再键入命令mysql -uroot -p，回车后提示你输密码，如果刚安装好MYSQL，超级用户root是没有密码的，故直接回车即可进入到MYSQL中了，MYSQL的提示符是：mysql&gt; </span></p>
<p style="font-size: 10.5pt; margin: 0in; color: black; font-family: Arial"><span style="font-size: 8pt">2、例2：连接到远程主机上的MYSQL。假设远程主机的IP为：110.110.110.110，用户名为root,密码为abcd123。则键入以下命令： </span></p>
<p style="font-size: 10.5pt; margin: 0in; color: black; font-family: Arial"><span style="font-size: 8pt">mysql -h110.110.110.110 -uroot -pabcd123 </span></p>
<p style="font-size: 10.5pt; margin: 0in; color: black; font-family: Arial"><span style="font-size: 8pt">（注:u与root可以不用加空格，其它也一样） </span></p>
<p style="font-size: 10.5pt; margin: 0in; color: black; font-family: Arial"><span style="font-size: 8pt">3、退出MYSQL命令： exit （回车） </span></p>
<p style="font-size: 10.5pt; margin: 0in; color: black; font-family: Arial"><span style="font-size: 8pt">二、修改密码。 </span></p>
<p style="font-size: 10.5pt; margin: 0in; color: black; font-family: Arial"><span style="font-size: 8pt">格式：mysqladmin -u用户名 -p旧密码 password 新密码 </span></p>
<p style="font-size: 10.5pt; margin: 0in; color: black; font-family: Arial"><span style="font-size: 8pt">1、例1：给root加个密码ab12。首先在DOS下进入目录mysqlbin，然后键入以下命令 </span></p>
<p style="font-size: 10.5pt; margin: 0in; color: black; font-family: Arial"><span style="font-size: 8pt">mysqladmin -uroot -password ab12 </span></p>
<p style="font-size: 10.5pt; margin: 0in; color: black; font-family: Arial"><span style="font-size: 8pt">注：因为开始时root没有密码，所以-p旧密码一项就可以省略了。 </span></p>
<p style="font-size: 10.5pt; margin: 0in; color: black; font-family: Arial"><span style="font-size: 8pt">2、例2：再将root的密码改为djg345。 </span></p>
<p style="font-size: 10.5pt; margin: 0in; color: black; font-family: Arial"><span style="font-size: 8pt">mysqladmin -uroot -pab12 password djg345 </span></p>
<p style="font-size: 10.5pt; margin: 0in; color: black; font-family: Arial"><span style="font-size: 8pt">三、增加新用户。（注意：和上面不同，下面的因为是MYSQL环境中的命令，所以后面都带一个分号作为命令结束符） </span></p>
<p style="font-size: 10.5pt; margin: 0in; color: black; font-family: Arial"><span style="font-size: 8pt">格式：grant select on 数据库.* to 用户名@登录主机 identified by \"密码\" </span></p>
<p style="font-size: 10.5pt; margin: 0in; color: black; font-family: Arial"><span style="font-size: 8pt">例1、增加一个用户test1密码为abc，让他可以在任何主机上登录，并对所有数据库有查询、插入、修改、删除的权限。首先用以root用户连入MYSQL，然后键入以下命令： </span></p>
<p style="font-size: 10.5pt; margin: 0in; color: black; font-family: Arial"><span style="font-size: 8pt">grant select,insert,update,delete on *.* to test1@\"%\" Identified by \"abc\"; </span></p>
<p style="font-size: 10.5pt; margin: 0in; color: black; font-family: Arial"><span style="font-size: 8pt">但例1增加的用户是十分危险的，你想如某个人知道test1的密码，那么他就可以在internet上的任何一台电脑上登录你的mysql数据库并对你的数据可以为所欲为了，解决办法见例2。 </span></p>
<p style="font-size: 10.5pt; margin: 0in; color: black; font-family: Arial"><span style="font-size: 8pt">例2、增加一个用户test2密码为abc,让他只可以在localhost上登录，并可以对数据库mydb进行查询、插入、修改、删除的操作（localhost指本地主机，即MYSQL数据库所在的那台主机），这样用户即使用知道test2的密码，他也无法从internet上直接访问数据库，只能通过MYSQL主机上的web页来访问了。 </span></p>
<p style="font-size: 10.5pt; margin: 0in; color: black; font-family: Arial"><span style="font-size: 8pt">grant select,insert,update,delete on mydb.* to test2@localhost identified by \"abc\"; </span></p>
<p style="font-size: 10.5pt; margin: 0in; color: black; font-family: Arial"><span style="font-size: 8pt">如果你不想test2有密码，可以再打一个命令将密码消掉。 </span></p>
<p style="font-size: 10.5pt; margin: 0in; color: black; font-family: Arial"><span style="font-size: 8pt">grant select,insert,update,delete on mydb.* to test2@localhost identified by \"\"; </span></p>
<p style="font-size: 10.5pt; margin: 0in; color: black; font-family: Arial"><span style="font-size: 8pt">在上篇我们讲了登录、增加用户、密码更改等问题。下篇我们来看看MYSQL中有关数据库方面的操作。注意：你必须首先登录到MYSQL中，以下操作都是在MYSQL的提示符下进行的，而且每个命令以分号结束。 </span></p>
<p style="font-size: 10.5pt; margin: 0in; color: black; font-family: Arial"><span style="font-size: 8pt">一、操作技巧 </span></p>
<p style="font-size: 10.5pt; margin: 0in; color: black; font-family: Arial"><span style="font-size: 8pt">1、如果你打命令时，回车后发现忘记加分号，你无须重打一遍命令，只要打个分号回车就可以了。也就是说你可以把一个完整的命令分成几行来打，完后用分号作结束标志就OK。 </span></p>
<p style="font-size: 10.5pt; margin: 0in; color: black; font-family: Arial"><span style="font-size: 8pt">2、你可以使用光标上下键调出以前的命令。但以前我用过的一个MYSQL旧版本不支持。我现在用的是mysql-3.23.27-beta-win。 </span></p>
<p style="font-size: 10.5pt; margin: 0in; color: black; font-family: Arial"><span style="font-size: 8pt">二、显示命令 </span></p>
<p style="font-size: 10.5pt; margin: 0in; color: black; font-family: Arial"><span style="font-size: 8pt">1、显示数据库列表。 </span></p>
<p style="font-size: 10.5pt; margin: 0in; color: black; font-family: Arial"><span style="font-size: 8pt">show databases; </span></p>
<p style="font-size: 10.5pt; margin: 0in; color: black; font-family: Arial"><span style="font-size: 8pt">刚开始时才两个数据库：mysql和test。mysql库很重要它里面有MYSQL的系统信息，我们改密码和新增用户，实际上就是用这个库进行操作。 </span></p>
<p style="font-size: 10.5pt; margin: 0in; color: black; font-family: Arial"><span style="font-size: 8pt">2、显示库中的数据表： </span></p>
<p style="font-size: 10.5pt; margin: 0in; color: black; font-family: Arial"><span style="font-size: 8pt">use mysql；／／打开库，学过FOXBASE的一定不会陌生吧 </span></p>
<p style="font-size: 10.5pt; margin: 0in; color: black; font-family: Arial"><span style="font-size: 8pt">show tables; </span></p>
<p style="font-size: 10.5pt; margin: 0in; color: black; font-family: Arial"><span style="font-size: 8pt">3、显示数据表的结构： </span></p>
<p style="font-size: 10.5pt; margin: 0in; color: black; font-family: Arial"><span style="font-size: 8pt">describe 表名; </span></p>
<p style="font-size: 10.5pt; margin: 0in; color: black; font-family: Arial"><span style="font-size: 8pt">4、建库： </span></p>
<p style="font-size: 10.5pt; margin: 0in; color: black; font-family: Arial"><span style="font-size: 8pt">create database 库名; </span></p>
<p style="font-size: 10.5pt; margin: 0in; color: black; font-family: Arial"><span style="font-size: 8pt">5、建表： </span></p>
<p style="font-size: 10.5pt; margin: 0in; color: black; font-family: Arial"><span style="font-size: 8pt">use 库名； </span></p>
<p style="font-size: 10.5pt; margin: 0in; color: black; font-family: Arial"><span style="font-size: 8pt">create table 表名 (字段设定列表)； </span></p>
<p style="font-size: 10.5pt; margin: 0in; color: black; font-family: Arial"><span style="font-size: 8pt">6、删库和删表: </span></p>
<p style="font-size: 10.5pt; margin: 0in; color: black; font-family: Arial"><span style="font-size: 8pt">drop database 库名; </span></p>
<p style="font-size: 10.5pt; margin: 0in; color: black; font-family: Arial"><span style="font-size: 8pt">drop table 表名； </span></p>
<p style="font-size: 10.5pt; margin: 0in; color: black; font-family: Arial"><span style="font-size: 8pt">7、将表中记录清空： </span></p>
<p style="font-size: 10.5pt; margin: 0in; color: black; font-family: Arial"><span style="font-size: 8pt">delete from 表名; </span></p>
<p style="font-size: 10.5pt; margin: 0in; color: black; font-family: Arial"><span style="font-size: 8pt">8、显示表中的记录： </span></p>
<p style="font-size: 10.5pt; margin: 0in; color: black; font-family: Arial"><span style="font-size: 8pt">select * from 表名; </span></p>
<p style="font-size: 10.5pt; margin: 0in; color: black; font-family: Arial"><span style="font-size: 8pt">三、一个建库和建表以及插入数据的实例 </span></p>
<p style="font-size: 10.5pt; margin: 0in; color: black; font-family: Arial"><span style="font-size: 8pt">drop database if exists school; //如果存在SCHOOL则删除 </span></p>
<p style="font-size: 10.5pt; margin: 0in; color: black; font-family: Arial"><span style="font-size: 8pt">create database school; //建立库SCHOOL </span></p>
<p style="font-size: 10.5pt; margin: 0in; color: black; font-family: Arial"><span style="font-size: 8pt">use school; //打开库SCHOOL </span></p>
<p style="font-size: 10.5pt; margin: 0in; color: black; font-family: Arial"><span style="font-size: 8pt">create table teacher //建立表TEACHER </span></p>
<p style="font-size: 10.5pt; margin: 0in; color: black; font-family: Arial"><span style="font-size: 8pt">( </span></p>
<p style="font-size: 10.5pt; margin: 0in; color: black; font-family: Arial"><span style="font-size: 8pt">id int(3) auto_increment not null primary key, </span></p>
<p style="font-size: 10.5pt; margin: 0in; color: black; font-family: Arial"><span style="font-size: 8pt">name char(10) not null, </span></p>
<p style="font-size: 10.5pt; margin: 0in; color: black; font-family: Arial"><span style="font-size: 8pt">address varchar(50) default &#8217;深圳&#8217;, </span></p>
<p style="font-size: 10.5pt; margin: 0in; color: black; font-family: Arial"><span style="font-size: 8pt">year date </span></p>
<p style="font-size: 10.5pt; margin: 0in; color: black; font-family: Arial"><span style="font-size: 8pt">); //建表结束 </span></p>
<p style="font-size: 10.5pt; margin: 0in; color: black; font-family: Arial"><span style="font-size: 8pt">//以下为插入字段 </span></p>
<p style="font-size: 10.5pt; margin: 0in; color: black; font-family: Arial"><span style="font-size: 8pt">insert into teacher values(&#8217;&#8217;,&#8217;glchengang&#8217;,&#8217;深圳一中&#8217;,&#8217;1976-10-10&#8217;); </span></p>
<p style="font-size: 10.5pt; margin: 0in; color: black; font-family: Arial"><span style="font-size: 8pt">insert into teacher values(&#8217;&#8217;,&#8217;jack&#8217;,&#8217;深圳一中&#8217;,&#8217;1975-12-23&#8217;); </span></p>
<p style="font-size: 10.5pt; margin: 0in; color: black; font-family: Arial"><span style="font-size: 8pt">注：在建表中（1）将ID设为长度为3的数字字段:int(3)并让它每个记录自动加一:auto_increment并不能为空:not null而且让他成为主字段primary key（2）将NAME设为长度为10的字符字段（3）将ADDRESS设为长度50的字符字段，而且缺省值为深圳。varchar和char有什么区别呢，只有等以后的文章再说了。（4）将YEAR设为日期字段。 </span></p>
<p style="font-size: 10.5pt; margin: 0in; color: black; font-family: Arial"><span style="font-size: 8pt">如果你在mysql提示符键入上面的命令也可以，但不方便调试。你可以将以上命令原样写入一个文本文件中假设为school.sql，然后复制到c:</span><a href="file://下/"><span style="font-size: 8pt">\\下</span></a><span style="font-size: 8pt">，并在DOS状态进入目录</span><a href="file://mysql/bin"><span style="font-size: 8pt">\\mysql\\bin</span></a><span style="font-size: 8pt">，然后键入以下命令： </span></p>
<p style="font-size: 10.5pt; margin: 0in; color: black; font-family: Arial"><span style="font-size: 8pt">mysql -uroot -p密码 &lt; c:</span><a href="file://school.sql/"><span style="font-size: 8pt">\\school.sql</span></a><span style="font-size: 8pt"> </span></p>
<p style="font-size: 10.5pt; margin: 0in; color: black; font-family: Arial"><span style="font-size: 8pt">如果成功，空出一行无任何显示；如有错误，会有提示。（以上命令已经调试，你只要将//的注释去掉即可使用）。 </span></p>
<p style="font-size: 10.5pt; margin: 0in; color: black; font-family: Arial"><span style="font-size: 8pt">四、将文本数据转到数据库中 </span></p>
<p style="font-size: 10.5pt; margin: 0in; color: black; font-family: Arial"><span style="font-size: 8pt">1、文本数据应符合的格式：字段数据之间用tab键隔开，null值用</span><a href="file://n来代替/"><span style="font-size: 8pt">\\n来代替</span></a><span style="font-size: 8pt">. </span></p>
<p style="font-size: 10.5pt; margin: 0in; color: black; font-family: Arial"><span style="font-size: 8pt">例： </span></p>
<p style="font-size: 10.5pt; margin: 0in; color: black; font-family: Arial"><span style="font-size: 8pt">3 rose 深圳二中 1976-10-10 </span></p>
<p style="font-size: 10.5pt; margin: 0in; color: black; font-family: Arial"><span style="font-size: 8pt">4 mike 深圳一中 1975-12-23 </span></p>
<p style="font-size: 10.5pt; margin: 0in; color: black; font-family: Arial"><span style="font-size: 8pt">2、数据传入命令 load data local infile \"文件名\" into table 表名; </span></p>
<p style="font-size: 10.5pt; margin: 0in; color: black; font-family: Arial"><span style="font-size: 8pt">注意：你最好将文件复制到</span><a href="file://mysql/bin目录下"><span style="font-size: 8pt">\\mysql\\bin目录下</span></a><span style="font-size: 8pt">，并且要先用use命令打表所在的库。 </span></p>
<p style="font-size: 10.5pt; margin: 0in; color: black; font-family: Arial"><span style="font-size: 8pt">五、备份数据库：（命令在DOS的</span><a href="file://mysql/bin目录下执行"><span style="font-size: 8pt">\\mysql\\bin目录下执行</span></a><span style="font-size: 8pt">） </span></p>
<p style="font-size: 10.5pt; margin: 0in; color: black; font-family: Arial"><span style="font-size: 8pt">mysqldump --opt school&gt;school.bbb </span></p>
<p style="font-size: 10.5pt; margin: 0in; color: black; font-family: Arial"><span style="font-size: 8pt">注释:将数据库school备份到school.bbb文件，school.bbb是一个文本文件，文件名任取，打开看看你会有新发现。 </span></p>
<p style="font-size: 10.5pt; margin: 0in; color: black; font-family: Arial"><span style="font-size: 8pt">后记：其实MYSQL的对数据库的操作与其它的SQL类数据库大同小异，您最好找本将SQL的书看看。我在这里只介绍一些基本的，其实我也就只懂这些了，呵呵。最好的MYSQL教程还是&#8220;晏子&#8220;译的&#8220;MYSQL中文参考手册&#8220;不仅免费每个相关网站都有下载，而且它是最权威的。可惜不是象\"PHP4中文手册\"那样是chm的格式，在查找函数命令的时候不太方便</span></p>
<p style="font-size: 10pt; margin: 0in; font-family: SimSun">&nbsp;</p>
<p style="font-size: 8pt; margin: 0in; color: #666666; font-family: 宋体"><span style="color: red">源文档 &lt;<a href="http://inclear.bokee.com/5197086.html">http://inclear.bokee.com/5197086.html</a>&gt; </span></p>
<p style="font-size: 10pt; margin: 0in; font-family: SimSun">&nbsp;</p>
<img src ="http://www.blogjava.net/juanshuchun/aggbug/166145.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/juanshuchun/" target="_blank">*一凡*</a> 2007-12-07 21:25 <a href="http://www.blogjava.net/juanshuchun/articles/166145.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>MyEclipse 配置（不完全）</title><link>http://www.blogjava.net/juanshuchun/articles/166133.html</link><dc:creator>*一凡*</dc:creator><author>*一凡*</author><pubDate>Fri, 07 Dec 2007 13:02:00 GMT</pubDate><guid>http://www.blogjava.net/juanshuchun/articles/166133.html</guid><description><![CDATA[<span style="font-size: 10pt">【转】原文地址<a href="http://www.blogjava.net/cooky/archive/2007/10/05/150522.html">http://www.blogjava.net/cooky/archive/2007/10/05/150522.html<br />
</a><br />
MyEclipse [All in One] Version: 6.0.0 GA&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font style="font-size: 8pt" size="2">文件字符编码:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<table cellspacing="2" cellpadding="2" width="500" border="0">
    <tbody>
        <tr>
            <td>&nbsp;&nbsp;<span style="font-size: 10pt">MENU: Window-&gt;Preferences-&gt;General-&gt;Workspace::Text file encoding: Other[UTF-8]</span></td>
        </tr>
    </tbody>
</table>
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 编译和执行环境:<br />
<table cellspacing="2" cellpadding="2" width="500" border="0">
    <tbody>
        <tr>
            <td style="width: 506px; height: 49px">1.&nbsp;<span style="font-size: 10pt">MENU: Window-&gt;Preferences-&gt;Java-&gt;Compiler::Compiler compliance level: 6.0<br />
            2.&nbsp; MENU: Window-&gt;Preferences-&gt;Java-&gt;Installed JREs::(Add...)jdk1.6.0<br />
            3.&nbsp;&nbsp;MENU: Window-&gt;Preferences-&gt;MyEclipse-&gt;Application Servers-&gt;Tomcat-&gt;Tomcat 6.x::Enable,%Apache-tomcat-6.0.10%<br />
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Window-&gt;Preferences-&gt;MyEclipse-&gt;Application Servers-&gt;Tomcat-&gt;Tomcat 6.x-&gt;JDK::jdk1.6.0</span> <br />
            </td>
        </tr>
    </tbody>
</table>
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font></span><br />
<img src ="http://www.blogjava.net/juanshuchun/aggbug/166133.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/juanshuchun/" target="_blank">*一凡*</a> 2007-12-07 21:02 <a href="http://www.blogjava.net/juanshuchun/articles/166133.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Xfire</title><link>http://www.blogjava.net/juanshuchun/articles/166129.html</link><dc:creator>*一凡*</dc:creator><author>*一凡*</author><pubDate>Fri, 07 Dec 2007 12:35:00 GMT</pubDate><guid>http://www.blogjava.net/juanshuchun/articles/166129.html</guid><description><![CDATA[<a href="http://baike.baidu.com/pic/93/11867130522729567.jpg" target="_blank"><img title="点击查看大图" alt="" hspace="5" src="http://baike.baidu.com/pic/93/11867130522729567_small.jpg" align="right" vspace="5" border="0" /></a> XFire是新一代的Java Web服务引擎，XFire<span style="color: red"><strong>使得在JavaEE应用中发布Web服务变得轻而易举</strong></span>。和其他Web服务引擎相比，XFire的配置非常简单，可以非常容易地和Spring集成，它使得Java开发人员终于可以获得和.Net开发人员一样的开发效率。<br />
<br />
由于使用了StAX（the Streaming API for XML，基于流的XML解析）作为XML解析器，XFire的运行速度又有了质的提高，并且XFire支持最新的JSR 181的Web服务注解。如果使用Java 5，只需要在源代码中编写相应的JSR 181注解，XFire就可以根据Java 5注解自动提取所需的全部信息。由于JSR 181也是JavaEE Web服务标准的一部分，使用它最大的好处在于不仅极大地简化了配置，而且避免了配置文件和某个特定的Web服务引擎的锁定
 <img src ="http://www.blogjava.net/juanshuchun/aggbug/166129.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/juanshuchun/" target="_blank">*一凡*</a> 2007-12-07 20:35 <a href="http://www.blogjava.net/juanshuchun/articles/166129.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Web Services 简介</title><link>http://www.blogjava.net/juanshuchun/articles/166125.html</link><dc:creator>*一凡*</dc:creator><author>*一凡*</author><pubDate>Fri, 07 Dec 2007 12:15:00 GMT</pubDate><guid>http://www.blogjava.net/juanshuchun/articles/166125.html</guid><description><![CDATA[<strong>Web Services </strong>是一种构建应用程序的普通模型，并能在所有支持 Internet 通讯的操作系统上实施运行。Web Services 令基于组件的开发和 Web 的结合达到最佳，基于组件的对象模型，如：Distributed Component Object Model(DCOM)、Remote Method Invocation(RMI)，Internet Inter-Orb Protocol(IIOP)都已经发布了很长时间了，但是这些模型都依赖于特殊对象模型协议，而 Web Services 利用 SOAP 和 XML<br />
对这些模型在通讯方面作了进一步的扩展以消除特殊对象模型的障碍。<br />
&nbsp;&nbsp;Web Services 主要利用 HTTP 和 SOAP 协议是商业数据在 Web 上传输，SOAP通过 HTTP 调用商业对象执行远程功能调用，Web 用户能够使用 SOAP 和 HTTP通过 Web 调用的方法来调用远程对象.<br />
<br />
<strong>Web Services 结构</strong><br />
<br />
客户根据 WSDL 描述文档，会生成一个 SOAP 请求消息。Web Services 都是放在Web服务器（如IIS）后面，客户生成的SOAP请求会被嵌入在一个HTTP POST请求中，发送到 Web 服务器来。Web 服务器再把这些请求转发给 Web Services 请求处理器。请求处理器的作用在于，解析收到的 SOAP 请求，调用 Web Services，<br />
然后再生成相应的 SOAP 应答。Web 服务器得到 SOAP 应答后，会再通过 HTTP应答的方式把信息送回到客户端。<br />
<br />
<strong>Web Services 体系</strong><br />
<br />
Web Services 体系主要包括以下几个方面：<br />
① Web Services 组件。包括 3 种组件：<br />
服务提供者：提供服务，进行注册以使服务可用；<br />
服务代理：服务交换所，服务提供者和服务请求者之间的媒体；<br />
服务请求者：向服务代理请求服务，调用这些服务创建应用程序。<br />
② Web Services 操作。包括 3 种操作：<br />
&nbsp;&nbsp;&nbsp;&nbsp;发布/不发布(Publish/Unpublish)：提供者向代理发布（注册）服务或不发布（移<br />
&nbsp;&nbsp;&nbsp;&nbsp;去）这些服务的注册；<br />
发现(Find)：由服务请求者向服务代理执行 find 操作，服务请求者描述要找的<br />
服务，服务代理分发匹配的结果；<br />
绑定(Bind)：在服务请求者和服务提供者之间绑定，这两部分协商以使请求者<br />
可以访问和调用提供者的服务。<br />
③ UDDI——通用发现、描述和整合。<br />
这是一个Web Services的信息注册规范,基于UDDI的Web Services注册可以被发现 UDDI 的发现方法是：在 Web 上有一种分布的注册服务，商务和服务以一种通用的 XML 格式描述，XML 中的结构化数据易于发现、分析和操作。<br />
④ WSDL——Web 服务描述语言。<br />
Web 服务描述言语(WSDL)是一种 XML 语法，为服务提供者提供了描述构建在不同协议或编码方式之上的 Web Services 请求基本格式的方法。<strong><span style="color: red"><strong>WSDL 用来描述一个 Web Services 能做什么，它的位置在哪里，如何调用它等。在假定以SOAP/HTTP/MIME 作为远程对象调用机制的情况下，WSDL 会发挥最大作用</strong>。</span></strong>UDDI 注册描述了 Web Services 绝大多数方面，包括服务的绑定细节。WSDL 可以看作是 UDDI 服务描述的子集。<br />
WSDL 将服务定义为一个网络端点的集合，或者说端口的集合。在 WSDL 里面，端点及消息的抽象定义与它们具体的网络实现和数据格式绑定是分离的。这样就可以重用这些抽象定义：消息，需要交换的数据的抽象描述；端口类型，操作的抽象集合。针对一个特定端口类型的具体协议和数据格式规范构成一个可重用的绑定。一个端口定义成网络地址和可重用的绑定的连接，端口的集合定义为服务。因此一个 WSDL 文档在定义网络服务的时候使用如下的元素：<br />
类型——使用某种的类型系统（如 XSD）定义数据类型的容器；<br />
消息——通讯数据抽象的有类型的定义；<br />
操作——服务支持动作的抽象描述；<br />
端口类型——一个操作的抽象集合，该操作由一个或多个端点支持；<br />
绑定——针对一个特定端口类型的具体协议规范和数据格式规范；<br />
端口——一个单一的端点，定义成一个绑定和一个网络地址的链接；<br />
服务——相关端点的集合。<br />
所以不难看出，WSDL 给客户提供了一个模板，方便客户描述和绑定服务 <br />
 <img src ="http://www.blogjava.net/juanshuchun/aggbug/166125.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/juanshuchun/" target="_blank">*一凡*</a> 2007-12-07 20:15 <a href="http://www.blogjava.net/juanshuchun/articles/166125.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>