user2963481
user2963481

Reputation: 2033

What is the default scope for bean in spring MVC?

I am working with SpringMVC .Every thing going good but I have some doubts

1)What is the default scope for SpringMVC

2)What is the differnce between @pathvarible,@RequestParam

Upvotes: 1

Views: 2067

Answers (1)

JB Nizet
JB Nizet

Reputation: 691635

The default scope is singleton.

Given the URL /foo/bar/1/bing?blam=zing, 1 could be a path variable value (it's part of the path), and zing could be a request parameter value:

@RequestMapping(value = "/foo/bar/{barId}/bing")
public void handle(@PathVariable("barId") Long barId, @RequestParam("blam") blamParameter) {
    ...
}

Upvotes: 3

Related Questions