Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6356739
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T23:01:36+00:00 2026-05-24T23:01:36+00:00

I want to implement Spring REST methods. I tried Get and it works: @RequestMapping(value

  • 0

I want to implement Spring REST methods. I tried Get and it works:

@RequestMapping(value = "{systemId}", method = RequestMethod.GET)
    public
    @ResponseBody
    Configuration getConfigurationInJSON(HttpServletResponse response, @PathVariable long systemId) throws IOException {
        if (configurationMap.containsKey(systemId)) {
            return configurationMap.get(systemId);
        } else {
            response.sendError(HttpServletResponse.SC_NOT_FOUND);
            return null;
        }
    }

However when I want to implement DELETE it doesn’t. My method is that:

@RequestMapping(value = "{systemId}", method = RequestMethod.DELETE)
    public void deleteConfiguration(HttpServletResponse response, @PathVariable long systemId) throws IOException {
        if (configurationMap.containsKey(systemId)) {
            configurationMap.remove(systemId);
            response.setStatus(HttpServletResponse.SC_FOUND);
        } else {
            response.sendError(HttpServletResponse.SC_NOT_FOUND);
        }

    }

My web.xml as follows:

mvc-dispatcher
org.springframework.web.servlet.DispatcherServlet
1

<servlet-mapping>
    <servlet-name>mvc-dispatcher</servlet-name>
    <url-pattern>/ui/*</url-pattern>
</servlet-mapping>

<context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>/WEB-INF/mvc-dispatcher-servlet.xml</param-value>
</context-param>

<listener>
    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>

Command that works when I try with Curl for GET:

curl http://localhost:8080/ui/webapp/conf/1

Command that doesn’t work when I try with Curl for DELETE:

curl -x delete http://localhost:8080/ui/webapp/conf/1

Second command gives that error after a time later at curl:

curl: (7) couldn't connect to host

There is no error at Tomcat side and at debug it doesn’t enter the delete method body.

Any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T23:01:37+00:00Added an answer on May 24, 2026 at 11:01 pm

    Try

    curl -X DELETE http://localhost:8080/ui/webapp/conf/1
    

    with uppercase DELETE and uppercase X

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We are currently using Spring MVC to implement REST web services. We now want
I have a j2ee web application running on Spring framework. I want to implement
given this class definition: public class Frame { IFrameStream CapturedFrom; } I want implement
I want to use to implement only REST service - a very simple one
I want to generate raw xml from a REST service using Spring. Something is
I want create a rest method(http put) that takes a list of string as
I want to implement spring security on a jersey Restful web service, both on
I'm creating a REST web service using spring and I need to implement login/logout
I want to implement Scrum, but I can't decide on a Sprint length. Ken
I want implement in my software solution an VBA editor but in c# 3.0.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.