提交 0151e81d 编写于 作者: 黄勇

【F】提供数据源工厂接口,可配置相应的连接池实现

上级 45556dee
......@@ -75,6 +75,11 @@
<artifactId>smart-plugin-i18n</artifactId>
<version>${smart.version}</version>
</dependency>
<dependency>
<groupId>org.smart4j</groupId>
<artifactId>smart-plugin-c3p0</artifactId>
<version>${smart.version}</version>
</dependency>
</dependencies>
<build>
......@@ -116,17 +121,4 @@
</plugins>
</build>
<repositories>
<!-- OSC Public -->
<repository>
<id>osc</id>
<url>http://maven.oschina.net/content/groups/public/</url>
</repository>
<!-- OSC Thirdparty -->
<repository>
<id>osc_thirdparty</id>
<url>http://maven.oschina.net/content/repositories/thirdparty/</url>
</repository>
</repositories>
</project>
\ No newline at end of file
......@@ -6,6 +6,7 @@ import org.smart4j.framework.mvc.annotation.Request;
import org.smart4j.framework.mvc.bean.Params;
import org.smart4j.framework.mvc.bean.Result;
import org.smart4j.framework.mvc.bean.View;
import org.smart4j.framework.util.StringUtil;
import org.smart4j.framework.util.WebUtil;
import org.smart4j.sample.Constant;
import org.smart4j.security.SmartSecurityHelper;
......@@ -32,7 +33,7 @@ public class SystemAction {
String captcha = params.getString("captcha");
String sessionCaptcha = DataContext.Session.get(Constant.CAPTCHA);
if (!sessionCaptcha.equals(captcha)) {
if (StringUtil.isNotEmpty(sessionCaptcha) && !sessionCaptcha.equals(captcha)) {
return new Result(false).data("captcha_error");
}
......
app.package=org.smart4j.sample
app.home_page=/login
ds.factory=org.smart4j.plugin.c3p0.C3P0DataSourceFactory
jdbc.type=mysql
jdbc.driver=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://localhost:3306/sample
......@@ -13,4 +15,4 @@ security.realms=custom
security.custom.class=org.smart4j.sample.SmartSecurity
security.cache=true
sample.upload_path=/www/upload/
\ No newline at end of file
sample.upload_path=/www/upload/
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册