I need Wicket to respond to a post request from AngularJS. 

I set up a page in wicket like this but the request parameters are always
empty

    @MountPath(value = "/api/my/rest/url")
    public class MyPostHandler extends SecureWebPage {

        public MyPostHandler () {
            final WebRequest webRequest = (WebRequest) getRequest();
            final HttpServletRequest rawRequest = (HttpServletRequest)
webRequest.getContainerRequest();

            if (rawRequest.getMethod().equalsIgnoreCase("POST")) {
                webRequest.getRequestParameters().getParameterNames();
//Returns an empty list
                webRequest.getPostParameters().getParameterNames();
//Returns an empty list
            }
        }
    }

The AngularJS code that is sending the POST request looks like this:

    $http.post('/api/my/rest/url', {some:"data", other:"stuff"});

Any idea what's going wrong here?
Thanks!



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Use-Wicket-as-a-REST-API-tp4660894.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to