Building URI for Spring MVC 3.0

4 messages Options
Embed this post
Permalink
webpost

Building URI for Spring MVC 3.0

Reply Threaded More More options
Print post
Permalink
Hi all,

    I am trying to build a URI to pass parameters using Restlet and Spring. I was trying to pass parameters as URI Templates like the following: @RequestMapping("/hotels/{hotelId}"). This would require me to create a request which i tried as follows:

client.get("http://localhost:8080/greet.json"+"/"+parameter1, new Callback()using Restlet 2.0, but this gives spring an error. Any help shall be appreciated.

Regaards,

Steven H.

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2414097
jlouvel

RE: Building URI for Spring MVC 3.0

Reply Threaded More More options
Print post
Permalink
Hi Steve,

Could you describe the exact error message that you get? Also, which version
of Restlet for GWT are you using? If you are using 2.0 M5, I recommend
trying a more recent 2.0 snapshot as we fixed a couple of major issues.

Best regards,
Jerome Louvel
--
Restlet ~ Founder and Lead developer ~ http://www.restlet.org
Noelios Technologies ~ Co-founder ~ http://www.noelios.com




-----Message d'origine-----
De : [hidden email] [mailto:[hidden email]]
Envoyé : mardi 3 novembre 2009 13:24
À : [hidden email]
Objet : Building URI for Spring MVC 3.0

Hi all,

    I am trying to build a URI to pass parameters using Restlet and Spring.
I was trying to pass parameters as URI Templates like the following:
@RequestMapping("/hotels/{hotelId}"). This would require me to create a
request which i tried as follows:

client.get("http://localhost:8080/greet.json"+"/"+parameter1, new
Callback()using Restlet 2.0, but this gives spring an error. Any help shall
be appreciated.

Regaards,

Steven H.

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=24140
97

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2414131
webpost

RE: Building URI for Spring MVC 3.0

Reply Threaded More More options
Print post
Permalink
with GWT on the client side I used restlet as follows: client.get("http://localhost:8080/greet.json"+"/"+"test", new Callback()

using spring I have my controller setup as follows:

@RequestMapping("/greet.*")
        public String list(@PathVariable String name, ModelMap modelMap) {
        log.info(">>>>GreetController");
  //getData(name);
        modelMap.put("hello","I am here");

        return "greet";
        }

With this I get the follwoing error message in hosted mode in eclipse:

[ERROR] Uncaught exception escaped
com.google.gwt.json.client.JSONException: com.google.gwt.core.client.JavaScriptException: (SyntaxError): Parse error
 line: 1
 sourceId: 864480016
        at com.google.gwt.json.client.JSONParser.parse(JSONParser.java:53)
        at com.example.client.RestSpringApp$1MyHandler$1.onEvent(RestSpringApp.java:128)
        at org.restlet.gwt.engine.http.HttpClientConverter$1.onEvent(HttpClientConverter.java:381)
        at org.restlet.gwt.engine.http.GwtHttpClientCall$2.onResponseReceived(GwtHttpClientCall.java:233)
        at com.google.gwt.http.client.Request.fireOnResponseReceivedImpl(Request.java:264)
        at com.google.gwt.http.client.Request.fireOnResponseReceivedAndCatch(Request.java:236)
        at com.google.gwt.http.client.Request.fireOnResponseReceived(Request.java:227)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
        at com.google.gwt.dev.shell.mac.MethodDispatch.invoke(MethodDispatch.java:71)
        at org.eclipse.swt.internal.carbon.OS.ReceiveNextEvent(Native Method)
        at org.eclipse.swt.widgets.Display.sleep(Display.java:3801)
        at com.google.gwt.dev.SwtHostedModeBase.sleep(SwtHostedModeBase.java:270)
        at com.google.gwt.dev.SwtHostedModeBase.processEvents(SwtHostedModeBase.java:265)
        at com.google.gwt.dev.HostedModeBase.pumpEventLoop(HostedModeBase.java:557)
        at com.google.gwt.dev.HostedModeBase.run(HostedModeBase.java:405)
        at com.google.gwt.dev.HostedMode.main(HostedMode.java:232)
Caused by: com.google.gwt.core.client.JavaScriptException: (SyntaxError): Parse error
 line: 1
 sourceId: 864480016
        at com.google.gwt.json.client.JSONParser.evaluate(Native Method)
        at com.google.gwt.json.client.JSONParser.parse(JSONParser.java:51)
        at com.example.client.RestSpringApp$1MyHandler$1.onEvent(RestSpringApp.java:128)
        at org.restlet.gwt.engine.http.HttpClientConverter$1.onEvent(HttpClientConverter.java:381)
        at org.restlet.gwt.engine.http.GwtHttpClientCall$2.onResponseReceived(GwtHttpClientCall.java:233)
        at com.google.gwt.http.client.Request.fireOnResponseReceivedImpl(Request.java:264)
        at com.google.gwt.http.client.Request.fireOnResponseReceivedAndCatch(Request.java:236)
        at com.google.gwt.http.client.Request.fireOnResponseReceived(Request.java:227)

and within the eclipse console I get this error:

Nov 4, 2009 2:42:16 AM org.springframework.web.servlet.DispatcherServlet noHandlerFound
WARNING: No mapping found for HTTP request with URI [/greet.json/test] in DispatcherServlet with name 'dispatcher'

any help would be appreciated

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2414277
jlouvel

RE: Building URI for Spring MVC 3.0

Reply Threaded More More options
Print post
Permalink
Hi there,

Doesn't it look like an issue on the server-side? I suggest contacting
Spring community for support as you appear to leverage Restlet only on the
client side.

Best regards,
Jerome Louvel
--
Restlet ~ Founder and Lead developer ~ http://www.restlet.org
Noelios Technologies ~ Co-founder ~ http://www.noelios.com


-----Message d'origine-----
De : [hidden email] [mailto:[hidden email]]
Envoyé : mercredi 4 novembre 2009 04:01
À : [hidden email]
Objet : RE: Building URI for Spring MVC 3.0

with GWT on the client side I used restlet as follows:
client.get("http://localhost:8080/greet.json"+"/"+"test", new Callback()

using spring I have my controller setup as follows:

@RequestMapping("/greet.*")
        public String list(@PathVariable String name, ModelMap modelMap) {
        log.info(">>>>GreetController");
  //getData(name);
        modelMap.put("hello","I am here");

        return "greet";
        }

With this I get the follwoing error message in hosted mode in eclipse:

[ERROR] Uncaught exception escaped
com.google.gwt.json.client.JSONException:
com.google.gwt.core.client.JavaScriptException: (SyntaxError): Parse error
 line: 1
 sourceId: 864480016
        at com.google.gwt.json.client.JSONParser.parse(JSONParser.java:53)
        at
com.example.client.RestSpringApp$1MyHandler$1.onEvent(RestSpringApp.java:128
)
        at
org.restlet.gwt.engine.http.HttpClientConverter$1.onEvent(HttpClientConverte
r.java:381)
        at
org.restlet.gwt.engine.http.GwtHttpClientCall$2.onResponseReceived(GwtHttpCl
ientCall.java:233)
        at
com.google.gwt.http.client.Request.fireOnResponseReceivedImpl(Request.java:2
64)
        at
com.google.gwt.http.client.Request.fireOnResponseReceivedAndCatch(Request.ja
va:236)
        at
com.google.gwt.http.client.Request.fireOnResponseReceived(Request.java:227)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at
com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
        at
com.google.gwt.dev.shell.mac.MethodDispatch.invoke(MethodDispatch.java:71)
        at org.eclipse.swt.internal.carbon.OS.ReceiveNextEvent(Native
Method)
        at org.eclipse.swt.widgets.Display.sleep(Display.java:3801)
        at
com.google.gwt.dev.SwtHostedModeBase.sleep(SwtHostedModeBase.java:270)
        at
com.google.gwt.dev.SwtHostedModeBase.processEvents(SwtHostedModeBase.java:26
5)
        at
com.google.gwt.dev.HostedModeBase.pumpEventLoop(HostedModeBase.java:557)
        at com.google.gwt.dev.HostedModeBase.run(HostedModeBase.java:405)
        at com.google.gwt.dev.HostedMode.main(HostedMode.java:232)
Caused by: com.google.gwt.core.client.JavaScriptException: (SyntaxError):
Parse error
 line: 1
 sourceId: 864480016
        at com.google.gwt.json.client.JSONParser.evaluate(Native Method)
        at com.google.gwt.json.client.JSONParser.parse(JSONParser.java:51)
        at
com.example.client.RestSpringApp$1MyHandler$1.onEvent(RestSpringApp.java:128
)
        at
org.restlet.gwt.engine.http.HttpClientConverter$1.onEvent(HttpClientConverte
r.java:381)
        at
org.restlet.gwt.engine.http.GwtHttpClientCall$2.onResponseReceived(GwtHttpCl
ientCall.java:233)
        at
com.google.gwt.http.client.Request.fireOnResponseReceivedImpl(Request.java:2
64)
        at
com.google.gwt.http.client.Request.fireOnResponseReceivedAndCatch(Request.ja
va:236)
        at
com.google.gwt.http.client.Request.fireOnResponseReceived(Request.java:227)

and within the eclipse console I get this error:

Nov 4, 2009 2:42:16 AM org.springframework.web.servlet.DispatcherServlet
noHandlerFound
WARNING: No mapping found for HTTP request with URI [/greet.json/test] in
DispatcherServlet with name 'dispatcher'

any help would be appreciated

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=24142
77

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2416454