URL « Web Service « Spring Q&A





1. Unable to get Mapping in Spring 2.56 for REST style urls to work    stackoverflow.com

I am trying to develop a REST style application with Spring but the url mapping is not working as I expected. in web.xml I have

 <servlet-mapping>
    <servlet-name>UrlParsing</servlet-name>
 ...

2. Is there a way to map an URL to another URL in Spring?    stackoverflow.com

In Struts 1 you could have, in struts-config.xml, a declaration like:

<action path="/first" forward="/second.do">
Is something similar also possible in Spring, or can I map an URL only to a controller? I am ...

3. Trying to create REST-ful URLs with mulitple dots in the "filename" part - Spring 3.0 MVC    stackoverflow.com

I'm using Spring MVC (3.0) with annotation-driven controllers. I would like to create REST-ful URLs for resources and be able to not require (but still optionally allow) file extension on the ...

4. Spring Map a file to a Url / URI    stackoverflow.com

I have a spring webservice for which I have the schema in a directory as:

  • WebRoot/DataContract/person.xsd
  • WebRoot/DataContract/sub-person.xsd
Where sub-person.xsd is included in person.xsd that is: in Person.xsd:
<xsd:import     namespace="http://www.mynamespace.org/xml/sub-person" 
  ...

5. How do I create a Spring 3 + Tiles 2 webapp using REST-ful URLs?    stackoverflow.com

I'm having a heck of a time resolving URLs with Spring 3.0 MVC. I'm just building a HelloWorld to try out how to build a RESTful webapp in Spring, nothing theoretically ...

6. java spring restful-url with semi-colon    stackoverflow.com

I am currently working on a project that requires the use of a semi-colon in our restful-url scheme. As you can imagine, we're having issues pulling this off - the underlying Java ...

7. How do I get RESTful URLS in Spring 3 MVC?    stackoverflow.com

I'm having a frustrating time with Spring 3 MVC trying to build RESTful web services. I want RESTful URLs, e.g. "my.domain.com/items", not "my.domain.com/items.do" or anything else that includes an extension. My ...

8. Spring MVC: RESTful URLs + Freemarker + Tiles + Spring macros - can these work together?    stackoverflow.com

I want to use RESTful URLs in Spring MVC 3.0.3, e.g. the following in my web.xml:

<servlet>
    <servlet-name>addictedWebServices</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
</servlet>

<servlet-mapping>
    ...

9. RESTful URLs with Spring 3    stackoverflow.com

How do I get nice-looking URLs in Spring (without a UrlRewriteFilter)? Does Spring 3 have any convenient way of getting nice-looking URLs (like, annotations, or something)? For example: /springmvc/hello instead of /springmvc/hello_world.html.





10. RESTful URLs: "Impractical" Requests, and Requiring One of Two Request Parameters    stackoverflow.com

I have a RESTful URL that requires either the offset or the prefix request parameter (but not both).

GET /users?offset=0&count=20
GET /users?prefix=J&count=20
What's the best way to enforce this rule? Spring has the @RequestParam ...

11. Spring MVC: Correct Annotation of Controller Method for RESTful URI including ';'    stackoverflow.com

Designing my RESTful API, I would like use following URI

http://[HOST]/[PLANET]/[LAT];[LONG]
e.g.
http://myserver/earth/50.2;29.1
What is the appropiate annotation of a such a method in Spring MVC? Is this the following one ok?
@RequestMapping(value = "/{planet}/{lat};{long}", method ...

12. Spring REST URL Encoding Scheme: %20 or + Which one?    stackoverflow.com

I made a Spring REST application where you can perform CRUD operations based on HTTP methods of POST, PUT, GET, DELETE. I have the typical URI template of

http://host/root/{id}/{name}/{address} and etc.
We ...

13. spring rest post?    stackoverflow.com

@ModelAttribute("user")
@RequestMapping(value = "/", method = RequestMethod.POST)
public User saveUser( @RequestBody User user ) throws IOException {
        logger.debug(user);
        return ...

14. how to add an image on jasper inside spring mvc web application    stackoverflow.com

i want to add several image to my PDF report, here is my views.xml

<bean id="form_b" class="org.springframework.web.servlet.view.jasperreports.JasperReportsPdfView"
    p:url="/WEB-INF/jasper/form_b.jasper">
    <property name="headers">
       ...

15. Match the "Rest of the URL" using Spring 3 RequestMapping Annotation    stackoverflow.com

In Spring 3, is there a way to capture rest/of/the/url in the following URL:

/myapp/foo/bar/rest/of/the/url
by using a @RequestMapping annotation like this:
@RequestMapping(value="{appname}/{path1}/{path2}/{remainder}")
public String myRequestMethod(
    @PathVariable("appname") String appName, 
   ...

16. Java using Spring restful URL    stackoverflow.com

I am using Java with Spring framework. I have a multiaction controller which is having lots of service methods, and I want to to create restful URLs like as following: http://server.com/url/events/multiActionMethod1 ...





17. Is possible to get web application full url from Spring service that is invoked by task?    stackoverflow.com

I have service which is not invoked by user request, but by task. Now I need to send email from this task, and email contains link to my web application, how ...

18. spring 3 mvc requestmapping dynamic param problem    stackoverflow.com

I have the following code which works fine with http://localhost:8080/HelloWorldSpring3/forms/helloworld but i want to have url have some thing like this http://localhost:8080/HelloWorldSpring3/forms/helloworld/locname_here/locid_here I found that adding this @RequestMapping("/helloworld/**") will work ...

19. Problem returning views from multiple URLs    stackoverflow.com

I am building a web app using Spring MVC and I am having a problem. Currently, if I login and go to the homepage of the webapp then it displays the user ...

20. Calling Spring Service (import java.net.URL.* package) POST its calling but getting java.io.FileNotFoundException on response    stackoverflow.com

I'm trying to setup a basic call to a Spring service using the URL package so that I can do it through a POST rather than get. Client code (the code calling ...

21. RESTful URL doesn't appear to be mapping right to url Using Spring MVC    stackoverflow.com

I am having trouble getting my url-mapping correct. My Controller looks like this...

@Controller
@RequestMapping(value = "/rest/report")
public class ReportController extends CatalogManagementBaseController { 
...
@RequestMapping(method = RequestMethod.GET) 
public @ResponseBody String test(Model model) throws Exception{
  ...

22. Spring 3: RESTful ContentNegotiatingViewResolver    stackoverflow.com

Case 1

<bean id="viewResolver" class="org.springframework.web.servlet.view.UrlBasedViewResolver">
   <property name="viewClass" value="org.springframework.web.servlet.view.JstlView"/>
   <property name="prefix" value="/WEB-INF/views/"/>
   <property name="suffix" value=".jsp"/>
</bean>
Case 2
    <bean id="users" class="org.springframework.web.servlet.view.xml.MarshallingView">
      ...

23. spring mvc RESTfull url    stackoverflow.com

I´m new in spring-mvc. So, i´m trying to use RESTFull urls ( i think that's the correct name) For example, i want use a url like this: http://localhost:8080/sommer/Users/edit/1 it means i ...

24. Add prefix to URLs of all the controller classes in the package    stackoverflow.com

I am developing a RESTful service using Spring 3.0 running on Tomcat Apache 6.0 environment. The Spring DispatcherServlet is configured at "/spring/*". The Spring servlet handles multiple clients and has many ...

25. Spring REST multiple controllers for one URL but different http methods    stackoverflow.com

I currently have one controller that handles both GET and POST for URL groups:

@Controller
public class RestGroups {

...

    @RequestMapping(method = RequestMethod.GET, value = "/groups")
    @ResponseBody
  ...

26. Spring MVC Problem mapping URLs to Controllers    stackoverflow.com

I am developing a web app using Spring MVC. I have two controllers: QuestionController and TodoController - both extend MultiActionController and both have a list() method defined. I have defined the mapping in ...

27. Spring MVC - Mapping Controller to URLs using Annotations    stackoverflow.com

I am having ongoing problems configuring my Spring Controller to map to specific URLs, and I have it down to a fairly simple scenario, that I think should be working: I am ...

28. Including a URL as a parameter in a Java Spring REST web request    stackoverflow.com

I have a REST web service that I would like to take a URL as a parameter Something along the lines of:

Example call: http://myserver.com/myService/http://www.website.com/files/myfile.docx
The original server mapping was:
 @RequestMapping(value="/myService/{url}", method=RequestMethod.GET)
Obviously calling this ...

29. Preffered method for REST-style URL's?    stackoverflow.com

I am creating a web application that incorporates REST-style services and I wanted some clarification as to the preferred (standard) method of how the POST requests should be accepted by my ...

30. Spring RestTemplate throws IllegalArgumentException: not a valid HTTP URL    stackoverflow.com

java.lang.IllegalArgumentException: [https://localhost/pcap/search?stime=20110930%2E000000&etime=20110930%2E235959&bpf=tcp
Here is the call I made using Spring RestFul Template:
final PcapSearchResponse pcapSearchResult = restTemplate.postForObject(
    nPulseApiUris.get(2), null, PcapSearchResponse.class, sTime, eTime, bpf);
I don't understand ...

31. Post to different URL from a spring controller    stackoverflow.com

I need to post the same request to a different webhook URL what I am getting in my spring controller so that the same operation can be performed on the both ...

32. Webservice End Point URL Load in spring-config.xml    forum.springsource.org

Webservice End Point URL Load in spring-config.xml Here I have a scenario. I have one webservice deployed in 2 indentical linux box in a load balanced env [say L1 and L2 ...

33. Change RestTemplate URL encoding    forum.springsource.org

Change RestTemplate URL encoding Hello I need to send a REST call which have UTF-8 URL encoding, and I have problem figuring out how to do that with the RestTemplate. From ...

34. @RequestMapping - Wiring a service interface implementation based on URL mapping    forum.springsource.org

@RequestMapping - Wiring a service interface implementation based on URL mapping Hi folks, I am curious to know if you can wire a service interface implementation using Annotations based on a ...

35. best practices for web app (including URL routing) ?    forum.springsource.org

hi i was wondering about best practices for a typical web app with the following sample constraints: anyone can browse the landing page, populated with a dynamic selection of new user ...

36. Spring 3 MVC + RESTful url + Internationalization    forum.springsource.org

Hello, I would like to know if it's possible using internationalization (with Resources messages Bundles) and RESTful url to make url like these : http://localhost:8080/en/index -> locale en and http://localhost:8080/fr/index -> ...

37. POX Message URL Endpoint mapping    forum.springsource.org

Hi, I have implemented a simple AbstractMarshallingPayloadEndpoint using Castor. The service interprets a POX message. Currently I am using the PayloadRootQNameEndpointMapping to map the request to the endpoint by checking the ...

38. REST-style URLs with Spring MVC    forum.springsource.org

Hey all, We've been frustrated with Spring MVC's limited ability to support RESTful URLs so have come up with a solution using an implementation of Spring MVC's HandlerMapping interface. http://www.carbonfive.com/community/...pring_mvc.html Combined ...

39. URL Based Endpoint Mapping    forum.springsource.org

URL Based Endpoint Mapping Hi, I am new to spring-ws but it looks great so far. I think I can replace a lot of custom code by the framework. Anyhow I ...

40. Hiding the URL when calling onto a service    forum.springsource.org

Colleagues, I have a quick question about Spring Web Services. I have a client to whom we are implementing WS. My question is, using Spring WS, how can we hide the ...

41. Multiple JVMs, One Service URL    forum.springsource.org

Multiple JVMs, One Service URL Hi. I have 2 or more Spring applications using one MBean Server. However, each Spring application creates its own ConnectorServerFactoryBean with a different service URL for ...

42. How to retrieve all the urls handled by my web application?    forum.springsource.org

How to retrieve all the urls handled by my web application? In my web application I use BeanNameUrlHandlerMapping class to manage urlMapping (the name of every controller starts with a "/"). ...

43. Url of the Endpoint with SimpleWsdl11Definition    forum.springsource.org

Url of the Endpoint with SimpleWsdl11Definition Hi, I want to create (ant test) a web service with from an existing wsdl with spring-ws (1.5.5) and tomcat (6.0). I have defined some ...

44. Finding generated WSDL url    forum.springsource.org

Finding generated WSDL url I am new to Spring WS and am dumbfounded where I can find the generated wsdl for my web service. I set up the servlet in the ...

45. WsdlDefinitionHandlerAdapter doesn't use "typical" WSDL url    forum.springsource.org

WsdlDefinitionHandlerAdapter doesn't use "typical" WSDL url I noticed that the URL that WsdlDefinitionHandlerAdapter uses to return a WSDL isn't the "typical" format I'm used to seeing. Usually, the strategy I've seen ...

46. ws-addressing replies to a new url but only synchronous, request completes after rely    forum.springsource.org

Jun 6th, 2009, 01:43 AM #1 Raymondorock View Profile View Forum Posts Private Message Junior Member Join Date Jun 2009 Posts 3 ws-addressing replies to a new url but only synchronous, ...

47. Spring 3 REST @MVC URL parsing    forum.springsource.org

I am trying to use @RequestMapping to bind a PathVariable from a URI to a hierarchical path. For example, with the URI '/collection/some/relative/path' and the pattern '/collection/{target}', {target} would match 'some/relative/path' ...

48. Issue in RESTful URL with Special Characters    forum.springsource.org

Issue in RESTful URL with Special Characters Hi, I'm using Spring 3.3 RESTful services. When I get the '/' character in the URL path values, the controller considers it as a ...

49. Conventions for REST urls+actions?    forum.springsource.org

Conventions for REST urls+actions? Hi, Minor question, but curious if anyone has any suggestions or conventions they use on this: I'm using the REST support in Spring MVC M3, which is ...

50. Observation on REST urls, RequestMapping, and ModelAttribute    forum.springsource.org

Observation on REST urls, RequestMapping, and ModelAttribute I can provide code if it will help explain the issues I'm seeing, but I'll try to explain it first: I'm using Spring 3.0 ...

51. Passing arrays in Restful urls    forum.springsource.org

Passing arrays in Restful urls I am writing my first RestFul web service using Spring 3.0.0.M4 and I can't figure out the best way (or best practice) to pass multiple values ...

52. How to find out the containing webapp url    forum.springsource.org

Hello, I have a webapp that have plain servlets as front end and spring for middle tier. Is there a way to find out from spring which is the url where ...

53. Locale Resolution and Base URL in Service Layer    forum.springsource.org

Locale Resolution and Base URL in Service Layer Hello all, I have a class in my service layer that's supposed to send velocity-based emails to registered users according to locale. The ...

54. Binding a service to a specific url    forum.springsource.org

Binding a service to a specific url Hi All, I would like to bind a service port to a specific url, so that the operation bound for a port only can ...

55. Modify the URL of WSDL file    forum.springsource.org

Hello, I have discovered Spring-WS recently and I would like to use it in my new project. Unfortunatly I have a technical problem with the URL of WSDL file. Indeed, I ...

56. Changing to REST, preventing unwanted URL calls    forum.springsource.org

57. URL to invoke webservice    forum.springsource.org

URL to invoke webservice Hello Folks, I am relatively new to Spring WebServices and would like to know what url to use to invoke my webservice. The wsdl is auto generated ...

58. Constructing RESTful URLs for form action    forum.springsource.org

Given some typical search form where the user enters an orderId to view, I can't construct this form action when submitting a form: Code: /myapp/orders/${orderId) Because the user is typing in ...

59. use form-login by default but http-basic for rest urls    forum.springsource.org

I would like to use form-login for my html pages, but http-basic for my rest endpoints. Code: