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 7871013
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T01:47:08+00:00 2026-06-03T01:47:08+00:00

I am new to spring framework….while searching on google..I found few examples which has

  • 0

I am new to spring framework….while searching on google..I found few examples which has @RequestMapping annoted at the class level and few examples showing it at menthod level

When to use class level RequestMapping and menthod level RequestMapping annotation…can anybody explain me difference between class level RequestMapping and method level RequestMapping ..??

so I am little bit confused about their application at :

a) Class level

b) Method level

Also I found some @Requestmapping with type :GET/Post,whereas some examples doesn’t have type parameter.

Which approach is better ..??

Is newer versions(>Spring 2.5) don’t need parameter type for request mapping ???

  • 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-03T01:47:09+00:00Added an answer on June 3, 2026 at 1:47 am

    A controller must be marked as @Controller at the class level. The @RequestMapping annotation can be applied at both class and method level. If it is, method annotations will be interpreted as relative URLs (relative to the class-level URL). However, method level annotations must be present, otherwise the method won’t be mapped.

    In annotations, parameters can be marked as optional with default values. The method parameter is such a case: it defaults to GET, but can be explicitly set to POST or something else.

    See:

    • @RequestMapping
    • 16.3 Implementing Controllers
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The Spring Framework has two similar classes: JdbcTemplate is the old, Java 1.4 class,
i AM NEW TO Spring Framework . Can any body explain me difference between
I am new to the Spring Framework. With Spring Core course recently taken, what
I'm pretty new to the Spring Framework, I've been playing around with it and
I am relatively new to the Spring Framework and Spring security. I have used
Almost every new Java-web-project is using a modern MVC-framework such as Struts or Spring
I'm new to Spring Security. How do I add an event listener which will
I'm quite new to Spring Framework. Could someone please help me understand the spring
I'm new to both JSF and Spring Framework and I'm trying to figure out
I'm pretty new to the Spring framework and web applications, though I'm experienced with

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.