ruby 入門
2、HelloWorld
posted @ 2007-05-11 17:14 風人園 閱讀(230) | 評論 (0) | 編輯 收藏
風人園弱水三千,只取一瓢,便能解渴;佛法無邊,奉行一法,便能得益。
隨筆 - 99, 文章 - 181, 評論 - 56, 引用 - 0
|
RadRails使用參考
利用Radrails開發Ruby on Rails程序入門指南
http://blog.csdn.net/futurelight/archive/2006/09/27/1297526.aspx 詳解用radrails調試rails應用程序 http://www.javaeye.com/topic/40548 使用 RadRails 和 Eclipse 可以輕松進行 Ruby on Rails 開發 http://www.ibm.com/developerworks/cn/opensource/os-ecl-radrails/ 以上為幾個使用參考posted @ 2007-05-09 20:03 風人園 閱讀(999) | 評論 (0) | 編輯 收藏 Struts2--form設計1、form的 theme屬性 你可以在<s:form>加上theme="simple"屬性,然后自已布局form的輸出。如: <s:form action="Login" method="POST" theme="simple"> <table> <tr> <td> User name: <s:textfield name="name" label="User name"/> </td> <td> Password: <s:password name="password" label="Password"/> </td> </tr> </table> </s:form> posted @ 2007-05-09 11:13 風人園 閱讀(1157) | 評論 (0) | 編輯 收藏 JSF--ajax4jsf入門示例(repeater)
一、下載
http://labs.jboss.com/jbossajax4jsf/downloads,現在的版本為1.1 · 復制 ajax4jsf.jar and oscache-2.2.jar 到程序的 WEB-INF/lib 文件夾下. ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 二、JSP ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 在這里我們在父標簽(<h:inputText>)中添加了一個AJAX 支持. 該支持綁定了JavaScript事件“onkeyup” .因此, 每一次該事件發布給父標簽時,我們的程序將發送一個AJAX請求到Server.這意味著我們的受管理的bean將包含該“text” 域中我們輸入的最新數據. 三、Bean & faces-config.xml ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() faces-config.xml ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() posted @ 2007-04-27 08:54 風人園 閱讀(2159) | 評論 (1) | 編輯 收藏 JSF--整合spring
使用JSF-Spring整合
一、下載 進官方網站http://jsf-spring.sourceforge.net,下載lib 二、參考quickstart配置相應文件 http://jsf-spring.sourceforge.net/quickstart.shtml 最終配置結果如下 web.xml ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 根據quitstart配置完之后可能還有如下異常: org.apache.jasper.JasperException: javax.servlet.ServletException: javax.servlet.jsp.JspException: javax.faces.el.EvaluationException: de.mindmatters.faces.spring.factory.BeansEvaluationException: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'uiBean': Scope 'request' is not active; nested exception is java.lang.IllegalStateException: No thread-bound request: use RequestContextFilter org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:532) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:408) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266) javax.servlet.http.HttpServlet.service(HttpServlet.java:803) com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322) com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:147) de.mindmatters.faces.lifecycle.RenderResponsePhase.executePhase(RenderResponsePhase.java:45) de.mindmatters.faces.lifecycle.AbstractPhase.execute(AbstractPhase.java:37) de.mindmatters.faces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:166) de.mindmatters.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:226) javax.faces.webapp.FacesServlet.service(FacesServlet.java:198) 然后再把這個listener加上 <listener> <listener-class>org.springframework.web.context.request.RequestContextListener</listener-class> </listener> 就ok了。 可選 如果還有問題,在faces-config.xml中添加 <application> <variable-resolver> org.springframework.web.jsf.DelegatingVariableResolver </variable-resolver> <view-handler>com.sun.facelets.FaceletViewHandler</view-handler> </application> posted @ 2007-04-26 16:18 風人園 閱讀(6104) | 評論 (3) | 編輯 收藏 JSF--Navigate
JSF中最重要的導航設置
一、靜態導航 <h:commandButton label="Login" action="login"/> 通過action返回的字符串,然后比較 from-outcome標簽值,如果相同,就返回到 to-view-id 制定的頁面 注: view ID strings must start with a /. 二、動態導航 <h:commandButton label="Login" action="#{loginController.verifyUser}"/> 根據action中調用的bean方法返回值來確定顯示頁面 loginController的驗證方法 String verifyUser() { if (...) return "success"; else return "failure"; } 三、高級導航 Redirection 如果你在to-view-id 后 加redirect元素,則JSP容器即中斷當前request請求,并發送一個HTTP redirect 請求到client. <navigation-case> <from-outcome>success</from-outcome> <to-view-id>/success.jsp</to-view-id> <redirect/> </navigation-case> Wildcards(通配符) <navigation-rule> <from-view-id>/secure/*</from-view-id> <navigation-case> . . . </navigation-case> </navigation-rule> 只要是在/secure/這個目錄下的頁面都使用這個導航規則。 所有 <from-view-id>/*</from-view-id> or The algorithm has three inputs(算法有三個輸入):
The first of two phases is to find the matching navigation-rule, following these steps(第二階段的第一步就是尋找符合的導航規則).
The second of two phases is to consider all navigation-case elements in the matching navigation rule (which may consist of several merged navigation-rule elements with matching from-view-id.values). Follow these steps to find the matching case.
posted @ 2007-04-26 15:23 風人園 閱讀(590) | 評論 (0) | 編輯 收藏 JSF--Managed Beans一、beans在 faces-config.xml中的定義 ![]() ![]() ![]() ![]() ![]() ![]() 在bean定義之后,就可以通過JSF組件來訪問Bean的屬性。 如 <h:inputSecret value="#{user.password}"/>,訪問userbean的password屬性。 二、Message Bundle 自定義資源文件com/corejsf/messages.properties,通過f:loadBundle訪問 <f:loadBundle basename="com.corejsf.messages" var="msgs"/> basename : properties文件的路徑 var: 文件定義的message key com/corejsf/messages_de.properties. 國際化,在默認資源文件的基礎上,增加后綴,標識語言類別。 語言默認顯示設置 You can add a locale attribute to the f:view element, for example <f:view locale="de"> You can set the default and supported locales in WEB-INF/faces-config.xml (or another application configuration resource): <faces-config> <application> <locale-config> <default-locale>en</default-locale> <supported-locale>de</supported-locale> </locale-config> </application> </faces-config>三、Backing Beans 四、Bean Scope Request Session 五、Configure Bean posted @ 2007-04-26 14:00 風人園 閱讀(563) | 評論 (0) | 編輯 收藏 JSF-- 入門 First Example一、JSF開發環境 ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
public class UserBean { private String name; private String password; // PROPERTY: name public void setName(String newValue) { // PROPERTY: password public void setPassword(String newValue) { </faces-config>
posted @ 2007-04-26 12:56 風人園 閱讀(612) | 評論 (0) | 編輯 收藏 |
|