Commits

cowboy  committed 157e9d3

17:47 2010/07/08

  • Participants
  • Parent commits a5d9840

Comments (0)

Files changed (5)

File src/info/mrchen/gae/blog/dao/UserInfoDao.java

 package info.mrchen.gae.blog.dao;
 
 import info.mrchen.gae.blog.Dao;
-import info.mrchen.gae.blog.pojo.Userinfo;
 
 import java.util.List;
 
 public class UserInfoDao extends Dao<Userinfo> {
 	public boolean checkPassword(String username, String password) {
 		String queryString = "from User where user=?";
-		List<Userinfo> l = this.getByQueryString(queryString);
+		List<UserInfo> l = this.getByQueryString(queryString);
 		return l.size() > 0 && l.get(0).getPassword().equals(password);
 	}
 
-	public Userinfo get(User user) {
+	public UserInfo get(User user) {
 
 		return null;
 	}

File src/info/mrchen/gae/blog/pojo/SysConf.java-

+package info.mrchen.gae.blog.pojo;
+
+import javax.jdo.annotations.IdGeneratorStrategy;
+import javax.jdo.annotations.IdentityType;
+import javax.jdo.annotations.PersistenceCapable;
+import javax.jdo.annotations.Persistent;
+import javax.jdo.annotations.PrimaryKey;
+
+@PersistenceCapable(identityType = IdentityType.APPLICATION)
+public class Sysconf {
+	@PrimaryKey
+	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
+	private Long id;
+
+	@Persistent
+	private String key;
+
+	@Persistent
+	private String value;
+
+	public Long getId() {
+		return id;
+	}
+
+	public void setId(Long id) {
+		this.id = id;
+	}
+
+	public String getKey() {
+		return key;
+	}
+
+	public void setKey(String key) {
+		this.key = key;
+	}
+
+	public String getValue() {
+		return value;
+	}
+
+	public void setValue(String value) {
+		this.value = value;
+	}
+
+}

File src/log4j.properties

-# A default log4j configuration for log4j users.
-#
-# To use this configuration, deploy it into your application's WEB-INF/classes
-# directory.  You are also encouraged to edit it as you like.
-
-# Configure the console as our one appender
-log4j.appender.A1=org.apache.log4j.ConsoleAppender
-log4j.appender.A1.layout=org.apache.log4j.PatternLayout
-log4j.appender.A1.layout.ConversionPattern=%d{HH:mm:ss,SSS} %-5p [%c] - %m%n
-
-# tighten logging on the DataNucleus Categories
-log4j.category.DataNucleus.JDO=WARN, A1
-log4j.category.DataNucleus.Persistence=WARN, A1
-log4j.category.DataNucleus.Cache=WARN, A1
-log4j.category.DataNucleus.MetaData=WARN, A1
-log4j.category.DataNucleus.General=WARN, A1
-log4j.category.DataNucleus.Utility=WARN, A1
-log4j.category.DataNucleus.Transaction=WARN, A1
-log4j.category.DataNucleus.Datastore=WARN, A1
-log4j.category.DataNucleus.ClassLoading=WARN, A1
-log4j.category.DataNucleus.Plugin=WARN, A1
-log4j.category.DataNucleus.ValueGeneration=WARN, A1
-log4j.category.DataNucleus.Enhancer=WARN, A1
-log4j.category.DataNucleus.SchemaTool=WARN, A1
+# Configure the console as our one appender
+log4j.appender.A1=org.apache.log4j.ConsoleAppender
+
+log4j.appender.A1.layout=org.apache.log4j.PatternLayout
+
+log4j.appender.A1.layout.ConversionPattern=%d{HH\u003Amm\u003Ass,SSS} %-5p [%c] - %m%n
+
+# tighten logging on the DataNucleus Categories
+log4j.category.DataNucleus.JDO=WARN, A1
+
+log4j.category.DataNucleus.Persistence=WARN, A1
+
+log4j.category.DataNucleus.Cache=WARN, A1
+
+log4j.category.DataNucleus.MetaData=WARN, A1
+
+log4j.category.DataNucleus.General=WARN, A1
+
+log4j.category.DataNucleus.Utility=WARN, A1
+
+log4j.category.DataNucleus.Transaction=WARN, A1
+
+log4j.category.DataNucleus.Datastore=WARN, A1
+
+log4j.category.DataNucleus.ClassLoading=WARN, A1
+
+log4j.category.DataNucleus.Plugin=WARN, A1
+
+log4j.category.DataNucleus.ValueGeneration=WARN, A1
+
+log4j.category.DataNucleus.Enhancer=WARN, A1
+
+log4j.category.DataNucleus.SchemaTool=WARN, A1
+

File war/WEB-INF/datastore-indexes.xml

 <?xml version="1.0" encoding="utf-8"?>
 <datastore-indexes autoGenerate="true">
-	<datastore-index kind="Userinfo" ancestor="false">
-		<property name="username" direction="asc" />
-	</datastore-index>
-	<datastore-index kind="Sysconf" ancestor="false">
-		<property name="key" direction="asc" />
-	</datastore-index>
 </datastore-indexes>

File war/WEB-INF/web.xml

 		<url-pattern>/mrchen_gae_blog</url-pattern>
 	</servlet-mapping>
 
+        <filter>
+            <filter-name>UrlRewriteFilter</filter-name>
+            <filter-class>org.tuckey.web.filters.urlrewrite.UrlRewriteFilter</filter-class>
+            <init-param>
+                <param-name>logLevel</param-name>
+                <param-value>WARN</param-value>
+            </init-param>
+        </filter>
+        <filter-mapping>
+            <filter-name>UrlRewriteFilter</filter-name>
+            <url-pattern>/*</url-pattern>
+        </filter-mapping>
+
 	<servlet>
 		<servlet-name>dispatcher</servlet-name>
 		<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>