问题
So, I have followed the tutorial for implementing simple login page over here https://varuntayur.wordpress.com/2012/01/25/session-management-in-gwt/
I tried communicating on the page itself, the author has been very helpful, but up to certain point.
The code is pretty long, so I've uploaded it here: http://1drv.ms/1GZQqFV
Please be so kind to check it out.
The error displayed is the following:
[WARN] 404 - POST /atlas_emergency_status_page/LoginService (127.0.0.1) 1405 bytes
Request headers
Host: 127.0.0.1:8888
Connection: keep-alive
Content-Length: 200
X-GWT-Module-Base: http://127.0.0.1:8888/atlas_emergency_status_page/
X-GWT-Permutation: 512BC5E71D8D41DD923CAA7193842B68
Origin: http://127.0.0.1:8888
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36
Content-Type: text/x-gwt-rpc; charset=UTF-8
Accept: */*
Referer: http://127.0.0.1:8888/ATLAS_Emergency_Status_Page.html
Accept-Encoding: gzip, deflate
Accept-Language: en-US,en;q=0.8,fr-CH;q=0.6,fr;q=0.4,ka;q=0.2,ru;q=0.2
Response headers
Content-Type: text/html;charset=ISO-8859-1
Cache-Control: must-revalidate,no-cache,no-store
Content-Length: 1405
EDIT
I heva found the error, in web.xml I mapped servlet as LoginServiceImpl, had to be LoginService.
But now, I have another problem, on clicking the login button, nothing happens and no error is displayed, which is even worse...
What could be the problem?
EDIT 2
I have added the logger to be able to better understand what's happening.
Here is the output of logger:
Wed Nov 04 17:11:44 GMT+100 2015 logger1 INFO: enbl = false
Wed Nov 04 17:11:44 GMT+100 2015 logger1 INFO: enbl = false
Wed Nov 04 17:11:44 GMT+100 2015 logger1 INFO: No sessionID
Wed Nov 04 17:11:46 GMT+100 2015 logger1 INFO: Called login
Wed Nov 04 17:11:46 GMT+100 2015 logger1 INFO: Configured login dialog box
Wed Nov 04 17:11:47 GMT+100 2015 logger1 INFO: username: password:
Wed Nov 04 17:11:47 GMT+100 2015 logger1 INFO: Success
Wed Nov 04 17:11:47 GMT+100 2015 com.google.gwt.logging.client.LogConfiguration SEVERE: (TypeError) __gwt$exception: <skipped>: Cannot read property 'allowNestedValues' of nullcom.google.gwt.core.client.JavaScriptException: (TypeError) __gwt$exception: <skipped>: Cannot read property 'allowNestedValues' of null
at Unknown.$get(atlas_emergency_status_page-0.js@18:2152)
at Unknown.$getLoggedIn(atlas_emergency_status_page-0.js@36:2227)
at Unknown.$onSuccess_0(atlas_emergency_status_page-0.js@88:1182)
at Unknown.onSuccess_0(atlas_emergency_status_page-0.js@3:1213)
at Unknown.onResponseReceived(atlas_emergency_status_page-0.js@34:15260)
at Unknown.$fireOnResponseReceived(atlas_emergency_status_page-0.js@14:7513)
at Unknown.onReadyStateChange(atlas_emergency_status_page-0.js@5:7718)
at Unknown.<anonymous>(atlas_emergency_status_page-0.js@13:18406)
at Unknown.apply_0(atlas_emergency_status_page-0.js@23:3688)
at Unknown.entry0(atlas_emergency_status_page-0.js@16:3755)
It seems to go into error after calling
public void onSuccess(UserDTO result) {
logger.log(Level.INFO, "Success");
and somewhere on this line I would say... logger.log(Level.INFO, "username from UserDTO: " + result.getName());
if (result.getLoggedIn()) {
Again, sorry for newbie questions, but this is way over my level...
来源:https://stackoverflow.com/questions/33487310/cannot-implement-login-in-gwt