标签: spring-4-gwt

Session的空指针异常

spring4gwt在我的项目中使用.

我有以下登录服务实现:

@Service("loginService")
public class LoginServiceImpl extends RemoteServiceServlet implements LoginService {

    @Override
    @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
    public UserBean checkUser(String userName, String password) throws Exception {

        HttpSession httpSession = getThreadLocalRequest().getSession();

    }
}
Run Code Online (Sandbox Code Playgroud)

当我调用loginService.checkUser("test","test")(在托管模式下)时,我得到一个NullPointerException,因为getThreadLocalRequest()返回NULL而不是实际的会话.

我还没有尝试过网络模式.

为什么我会得到一个空会话?它与spring4gwt有关吗?

session gwt spring spring-4-gwt

2
推荐指数
1
解决办法
854
查看次数

标签 统计

gwt ×1

session ×1

spring ×1

spring-4-gwt ×1