<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>没有比人更高的山 &#187; JSF</title>
	<atom:link href="http://www.zhlwish.com/tag/jsf/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.zhlwish.com</link>
	<description>Where there is a will there is a way.</description>
	<lastBuildDate>Fri, 13 Jan 2012 08:13:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>一个隐藏了将近2年的Bug</title>
		<link>http://www.zhlwish.com/2010/01/24/%e4%b8%80%e4%b8%aa%e9%9a%90%e8%97%8f%e4%ba%86%e5%b0%86%e8%bf%912%e5%b9%b4%e7%9a%84bug/</link>
		<comments>http://www.zhlwish.com/2010/01/24/%e4%b8%80%e4%b8%aa%e9%9a%90%e8%97%8f%e4%ba%86%e5%b0%86%e8%bf%912%e5%b9%b4%e7%9a%84bug/#comments</comments>
		<pubDate>Sat, 23 Jan 2010 17:48:59 +0000</pubDate>
		<dc:creator>周亮</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[JSF]]></category>

		<guid isPermaLink="false">http://www.zhlwish.com/?p=152</guid>
		<description><![CDATA[最近在维护华中科技大学电信系的电子档案库，发现了一个隐藏了将近2年的Bug，记录如下： 需求：一个科研项目有一定的工作量，而每个项目有很多参与人，需要为每个参与人设置其工作量分配额度。当用户添加了一个项目时，需要同时添加其参与人: 实现：当用户录入了科研项目信息之后，点击“添加参与人”的按钮，转向到选择参与人的页面，可以勾选任意数目的参与人，点击“保存”按钮后返回科研项目信息页面。 在执行保存选择的参与人信息时，检查所选择的人员是否已经在科研项目的参与人中存在的代码如下： 1 2 3 4 5 6 7 8 9 10 11 12 13 for &#40;Iterator&#60;string&#62; iterator = selectedMemberList.iterator&#40;&#41;; iterator.hasNext&#40;&#41;;&#41; &#123; ParticipatorBean participatorBean = new ParticipatorBean&#40;&#41;; long teacherId = Long.parseLong&#40;iterator.next&#40;&#41;&#41;; Teacherbasicinfo teacher = ServiceProvider.getTeacherInfoService&#40;&#41;.findById&#40;teacherId&#41;; Long id = &#8230; <a href="http://www.zhlwish.com/2010/01/24/%e4%b8%80%e4%b8%aa%e9%9a%90%e8%97%8f%e4%ba%86%e5%b0%86%e8%bf%912%e5%b9%b4%e7%9a%84bug/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
		<wfw:commentRss>http://www.zhlwish.com/2010/01/24/%e4%b8%80%e4%b8%aa%e9%9a%90%e8%97%8f%e4%ba%86%e5%b0%86%e8%bf%912%e5%b9%b4%e7%9a%84bug/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>JSF中CommandButton与CommandLink传值</title>
		<link>http://www.zhlwish.com/2009/12/31/jsf_commandbutton_commandlink/</link>
		<comments>http://www.zhlwish.com/2009/12/31/jsf_commandbutton_commandlink/#comments</comments>
		<pubDate>Thu, 31 Dec 2009 07:48:06 +0000</pubDate>
		<dc:creator>周亮</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[JSF]]></category>
		<category><![CDATA[web后台]]></category>

		<guid isPermaLink="false">http://www.zhlwish.com/?p=139</guid>
		<description><![CDATA[f:param标签能够将一个参数添加到组件。需要注意的是f:param标签的不同表现依赖于它所关联的组件类型： 【1】如果为 h:outputText添加f:param标签，那么JSF实现将使用参数来填充占位符，例如{0}、{1}等。 【2】如果添加f:param标签到h:commandLink，JSF实现会将参数值作为请求参数传递到服务器，如： 1 2 3 &#60;h :commandLink actionListener=&#34;#{userListBean.checkUser}&#34; value=&#34;审核通过&#34;&#62;     &#60;f :param name=&#34;userId&#34; value=&#34;#{user.userId}&#34; /&#62; &#60;/h&#62; 在服务器端可以使用如下方法来获取传递到服务器端的值： 1 2 3 4 private void checkUser&#40;ActionEvent actionEvent&#41;&#123; String uid = FacesContext.getCurrentInstance&#40;&#41;.getExternalContext&#40;&#41;.getRequestParameterMap&#40;&#41;.get&#40;&#34;userId&#34;&#41;; //othe &#125; 但是f:param的传值方式对于h:commandButton是没有作用的，（如果你是用搜索引擎搜到这篇文章的话，相信你肯定是遇到了这个问题），详情可以参考http://www.javaeye.com/topic/93388 如果是h:commandButton，那么可以使用f:attribute来进行传值，示例如下： 1 2 3 &#60;h :commandButton actionListener=&#34;#{userListBean.resetPassword}&#34; &#8230; <a href="http://www.zhlwish.com/2009/12/31/jsf_commandbutton_commandlink/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
		<wfw:commentRss>http://www.zhlwish.com/2009/12/31/jsf_commandbutton_commandlink/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Servlet、JSP中获取Web应用路径(context path)的方法</title>
		<link>http://www.zhlwish.com/2009/12/04/servlet_jsp_context_path/</link>
		<comments>http://www.zhlwish.com/2009/12/04/servlet_jsp_context_path/#comments</comments>
		<pubDate>Fri, 04 Dec 2009 06:36:17 +0000</pubDate>
		<dc:creator>周亮</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[JSF]]></category>
		<category><![CDATA[jsp]]></category>
		<category><![CDATA[servlet]]></category>
		<category><![CDATA[web后台]]></category>

		<guid isPermaLink="false">http://www.zhlwish.com/?p=112</guid>
		<description><![CDATA[在Servlet中可以直接使用request.getContextPath()获取当前web应用的路径(context path) 在JSP 2.0页面中可以使用el表达式${pageContext.request.contextPath} 如果是JSF页面，因为JSF默认使用#作为el表达式的起始符，所以应该写成#{pageContext.request.contextPath} 因为JSP2.0之前的版本不支持文本模板中的el表达式，故可以使用嵌入java代码来实现，和Servlet中一样 如果在JSP2.0之前的版本中使用了JSTL标签（el表达式的概念是JSTL 1.0推出来的），所以仍然可以配合JSTL的标签使用el表达式输出当前Web应用路径(context path)]]></description>
		<wfw:commentRss>http://www.zhlwish.com/2009/12/04/servlet_jsp_context_path/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JSF异常消息机制及应用</title>
		<link>http://www.zhlwish.com/2009/11/18/jsf_message/</link>
		<comments>http://www.zhlwish.com/2009/11/18/jsf_message/#comments</comments>
		<pubDate>Wed, 18 Nov 2009 02:49:46 +0000</pubDate>
		<dc:creator>周亮</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[JSF]]></category>
		<category><![CDATA[web后台]]></category>

		<guid isPermaLink="false">http://www.zhlwish.com/?p=77</guid>
		<description><![CDATA[JSF有两种异常消息： [1] JSF提供的标准异常信息，如标准的验证器和转换器生成的异常信息等 [2] 自定义的异常信息 与消息相关的类是javax.faces.application.FacesMessage，他封装了单一的、本地化的、人类可以理解的消息，除了消息字符串本身外，FacesMessage还有三个属性：severity(严重性),summary（摘要）,detail（详细信息） serverity被定义成FacesMessage的内部类，有四种类型：Info、Warn、Error、Fatal FacesContext负责维护FacesMessage的两个逻辑集合，一个和组件相关的消息集合、一个不与组件相关的消息集合，定义了如下的和消息相关的方法 public Iterator&#60;FacesMessage&#62; getMessages(); public Iterator&#60;FacesMessage&#62; getMessages(String clientId); public Iterator&#60;String&#62; getClientIdsWithMessages();//返回有消息绑定的组件id public void addMessage(String clientId, javax.faces.application.FacesMessage message);//向FacesContext中加入一条FacesMessage public FacesMessage.Severity getMaximumSeverity();//返回最严重的问题的严重性 FacesMessage的部分源代码如下： private FacesMessage.Severity _severity; private String _summary; private String _detail; public FacesMessage() { &#8230; <a href="http://www.zhlwish.com/2009/11/18/jsf_message/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
		<wfw:commentRss>http://www.zhlwish.com/2009/11/18/jsf_message/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

