[pal-cvs 2187] CVS-Update: s2helloworld/src/main/java/jp/sf/pal/s2helloworld/web/hello committed by shinsuke

Back to archive index

Shinsuke SUGAYA shins****@users*****
2007年 4月 2日 (月) 10:01:03 JST


Update of /cvsroot/pal/s2helloworld/src/main/java/jp/sf/pal/s2helloworld/web/hello
In directory sf-cvs:/tmp/cvs-serv6301/src/main/java/jp/sf/pal/s2helloworld/web/hello

Modified Files:
	SayHelloPage.java TypeNamePage.java 
Log Message:
replaced teeda with the latest one. added label.properties. DI'ed facesContext. updated dicon files.

s2helloworld/src/main/java/jp/sf/pal/s2helloworld/web/hello/SayHelloPage.java 1.1 -> 1.2 (modified)
http://cvs.sourceforge.jp/cgi-bin/viewcvs.cgi/pal/s2helloworld/src/main/java/jp/sf/pal/s2helloworld/web/hello/SayHelloPage.java.diff?r1=1.1&r2=1.2
s2helloworld/src/main/java/jp/sf/pal/s2helloworld/web/hello/TypeNamePage.java 1.1 -> 1.2 (modified)
http://cvs.sourceforge.jp/cgi-bin/viewcvs.cgi/pal/s2helloworld/src/main/java/jp/sf/pal/s2helloworld/web/hello/TypeNamePage.java.diff?r1=1.1&r2=1.2

===================================================================
RCS file: s2helloworld/src/main/java/jp/sf/pal/s2helloworld/web/hello/SayHelloPage.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- SayHelloPage.java	2006/11/26 01:44:54	1.1
+++ SayHelloPage.java	2007/04/02 01:01:03	1.2
@@ -7,6 +7,8 @@
 
     private String yourName;
 
+    private FacesContext facesContext;
+
     public String getYourName()
     {
         return yourName;
@@ -17,6 +19,22 @@
         this.yourName = yourName;
     }
 
+    /**
+     * @return the facesContext
+     */
+    public FacesContext getFacesContext()
+    {
+        return facesContext;
+    }
+
+    /**
+     * @param facesContext the facesContext to set
+     */
+    public void setFacesContext(FacesContext facesContext)
+    {
+        this.facesContext = facesContext;
+    }
+
     public String initialize()
     {
         return null;
@@ -24,8 +42,8 @@
 
     public String prerender()
     {
-        yourName = (String) FacesContext.getCurrentInstance()
-                .getExternalContext().getSessionMap().get("name");
+        yourName = (String) facesContext.getExternalContext().getSessionMap()
+                .get("name");
         return null;
     }
 

===================================================================
RCS file: s2helloworld/src/main/java/jp/sf/pal/s2helloworld/web/hello/TypeNamePage.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- TypeNamePage.java	2006/11/26 01:44:54	1.1
+++ TypeNamePage.java	2007/04/02 01:01:03	1.2
@@ -7,6 +7,8 @@
 
     private String yourName;
 
+    private FacesContext facesContext;
+
     public String getYourName()
     {
         return yourName;
@@ -17,11 +19,26 @@
         this.yourName = yourName;
     }
 
-    public String doTypeName()
+    /**
+     * @return the facesContext
+     */
+    public FacesContext getFacesContext()
+    {
+        return facesContext;
+    }
+
+    /**
+     * @param facesContext the facesContext to set
+     */
+    public void setFacesContext(FacesContext facesContext)
     {
-        FacesContext.getCurrentInstance().getExternalContext().getSessionMap()
-                .put("name", yourName);
-        return "hello_sayHello";
+        this.facesContext = facesContext;
+    }
+
+    public Class doTypeName()
+    {
+        facesContext.getExternalContext().getSessionMap().put("name", yourName);
+        return SayHelloPage.class;
     }
 
     public String initialize()
@@ -33,5 +50,5 @@
     {
         return null;
     }
-    
+
 }




pal-cvs メーリングリストの案内
Back to archive index