java - GWT and SpringSecurity -


i've created 2 modules

  1. gwtappauth
  2. 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?

  1. run application in hosted mode
  2. try access gwtapp.html
  3. spring security redirects me gwtappauth.html
  4. 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

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -