Commit 10a9bbeb authored by Liang Ding's avatar Liang Ding

修复加入 context path 后首页分页问题。

parent 4c678cf1
...@@ -35,6 +35,7 @@ import java.util.logging.Level; ...@@ -35,6 +35,7 @@ import java.util.logging.Level;
import java.util.logging.Logger; import java.util.logging.Logger;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import org.apache.commons.lang.StringUtils;
import org.b3log.latke.annotation.RequestProcessing; import org.b3log.latke.annotation.RequestProcessing;
import org.b3log.latke.annotation.RequestProcessor; import org.b3log.latke.annotation.RequestProcessor;
import org.b3log.latke.model.Pagination; import org.b3log.latke.model.Pagination;
...@@ -192,7 +193,7 @@ public final class IndexProcessor { ...@@ -192,7 +193,7 @@ public final class IndexProcessor {
* can not convert to an number * can not convert to an number
*/ */
private static int getCurrentPageNum(final String requestURI) { private static int getCurrentPageNum(final String requestURI) {
final String pageNumString = requestURI.substring((Latkes.getContextPath() + '/').length()); final String pageNumString = StringUtils.substringAfter(requestURI, "/");
return Requests.getCurrentPageNum(pageNumString); return Requests.getCurrentPageNum(pageNumString);
} }
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
# #
# Description: B3log Latke configurations. Configures the section "Server" carefully. # Description: B3log Latke configurations. Configures the section "Server" carefully.
# Version: 1.0.0.4, May 3, 2012 # Version: 1.0.0.5, May 31, 2012
# Author: Liang Ding # Author: Liang Ding
# #
...@@ -36,10 +36,12 @@ staticPath= ...@@ -36,10 +36,12 @@ staticPath=
#### Runtime Environment #### #### Runtime Environment ####
#runtimeEnv=LOCAL #runtimeEnv=LOCAL
runtimeEnv=GAE runtimeEnv=GAE
#### Cache Implementation #### #### Cache Implementation ####
# Note: If the runtime environment is LOCAL, the cache will be LOCAL always # Note: If the runtime environment is LOCAL, the cache will be LOCAL always
#cache=LOCAL #cache=LOCAL
cache=GAE cache=GAE
#### User Service Implementation #### #### User Service Implementation ####
# userService=GAE # userService=GAE
userService=LOCAL userService=LOCAL
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment