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

  • SEARCH
  • Home
  • 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 7803229
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T01:30:33+00:00 2026-06-02T01:30:33+00:00

I’m having trouble with Spring MVC RequestMapping and I’m hoping someone can give me

  • 0

I’m having trouble with Spring MVC RequestMapping and I’m hoping someone can give me advice on how to proceed.

I’m working on a server that will be accessed by a legacy client. The client sends simple requests (see below) but cannot be changed in any way to accommodate the new server.

The client sends gets or posts of the form /dbintf?command=GETINFO,acctNum=111
The server is called dbintf and it returns a simple text response.

I would like to create a Spring controller for each command and annotate a single controller method with
a params mapping that is based on the command parameter. So the mapping in the GETINFOController would be:

@RequestMapping(params="command=GETINFO")
public String serviceRequest(....

However, I cannot get this to work. Here are some details of the service.

The servlet mapping in web.xml:

<servlet-mapping>
    <servlet-name>dbintf</servlet-name>
    <url-pattern>/</url-pattern>
</servlet-mapping>

The annotation scanning directives in intf-servlet.xml

<context:component-scan base-package="com.intf.controller" />   
<bean class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping"/>
<bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter"/>

I have been trying various combinations of things to try to get this scheme to work and I’ll boil this
trial-and-error work down to two examples:

This does not work. The response is: “The requested resource () is not available.”

@RequestMapping( params="command=GETINFO")
public class TESTController  {
    @RequestMapping( method = RequestMethod.GET)
    public String serviceRequest

If I change the url to add another level: /dbintf/test?command=GETINFO,acctNum=111
it works if I add a URL pattern to the handler method annotation.

@RequestMapping( params="command=GETINFO")
public class TESTController  {
    @RequestMapping( value="/test",method = RequestMethod.GET)
    public String serviceRequest

This makes me think that params mapping alone will not work. It appears that a URL
pattern must be part of any mapping scheme. For my case however, there is no
URL pattern available since the the client request URL is fixed as: dbintf?…..
My question: is it possible to use parameter based mapping alone and not
in conjunction with a pattern? If so, what am I missing?

Thanks in advance for any help or advice,
beeky

  • 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-06-02T01:30:36+00:00Added an answer on June 2, 2026 at 1:30 am

    I don’t see in your config where you are mapping your controllers to “/dbintf”? You’ve got your DispatcherServlet (assuming that “dbintf” servlet is your DispatcherServlet) mapped to just “/”, not “/dbintf”. Are you deploying your webapp so that it’s available at “/dbintf” relative to your container’s “/”? I guess what I’m trying to get at is that you may just need to add some config to your @RequestMapping’s:

    @RequestMapping(value="/dbintf", params="command=GETINFO")
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm having trouble keeping the paragraph square between the quote marks. In firefox the
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into
I am doing a simple coin flipping experiment for class that involves flipping a

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.