java - GWT and SpringSecurity -
i've created 2 modules
- gwtappauth
- gwtapp
when try posting form gwtappauth
j_spring_security_check
nothing happened.
firebug shows in console
"failed load source for:http://127.0.0.1:8888/j_spring_security_check"
but if try after manually access gwtapp works. knows matter?
looks spring security doesn't redirect second (gwtapp).
how check it?
- run application in hosted mode
- try access gwtapp.html
- spring security redirects me gwtappauth.html
- press login button
in place if check firebug log can see
"post //127.0.0.1:8888/j_spring_security_check"
and response -
"failed load source for: http://127.0.0.1:8888/j_spring_security_check"
then next record -
"get //127.0.0.1:8888/gwt/gwtapp.html?gwt.codesvr=127.0.0.1:9997"
and fetching needed resources
can manually input
"//127.0.0.1:8888/gwt/gwtapp.html"
and have access gwtapp.html
i found out solution.
should use html form , submit button instead widgets provided gwt instance:
<form action="/j_spring_security_check" method="post"> <g:label> login </g:label> <g:textbox name="j_username" width="200" /> <g:label> password </g:label> <g:passwordtextbox name="j_password" width="200" /> <input name="submit" type="submit" value="login" /> </form>
or catch on form submit completed event in case using gwt formpanel widget:
public class loginformb extends composite { private static loginformbuibinder uibinder = gwt.create(loginformbuibinder.class); interface loginformbuibinder extends uibinder<widget, loginformb> {} @uifield formpanel formpanel; public loginformb() { formpanel.addsubmitcompletehandler(new submitcompletehandler() { @override public void onsubmitcomplete(submitcompleteevent arg0) { // redirect needed page redirect("needed url"); } }); initwidget(uibinder.createandbindui(this)); } public static native void redirect(string url)/*-{ $wnd.location = url; }-*/; }
Comments
Post a Comment