@RequestParam Example in Spring MVC Framework

@RequestParam Example in Spring

In this tutorial, We will show about, @RequestParam Example in Spring MVC Framework.


package com.dineshkrish.spring;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

public class Welcome {

	@RequestMapping(value = "sayHello")
	public String sayHello(@RequestParam("name") String name) {
		return "Hello "+name;
	@RequestMapping(value = "sayBye")
	public String sayBye(@RequestParam("name") String name) {
		return "Good bye "+name;
	@RequestMapping(value = "authenticate")
	public boolean authenticate(@RequestParam("userName") String userName, @RequestParam("password") String password) {
		if(userName.equals(password)) {
			return true;
		return false;


1. Spring Web Annotation API JavaDocs
2. @RequestParam JavaDocs

Hello, folks, I am a founder of dineshkrish.com. I love Java and Open source technologies, If you find my tutorials are useful, please consider making donations to these charities.