user3505775
user3505775

Reputation: 337

catch the parameter post from view on same controller spring framework

I have a code in php language using codeigniter framework. I need to translate it into spring framework, but i little confuse to translate like send parameter into controller with the paramater like :

$tipe   = $this->input->post("tipe_lst");

because in spring we using:

@RequestParam("tipe_lst") String tipe_lst

how to catch the parameter on the same controller?, because the parameter is not always have a value, it can also null parameter, so if i use @requestparam, the result can be an error.

Upvotes: 0

Views: 29

Answers (1)

Mippy
Mippy

Reputation: 364

You can set required = false in @RequestParam annotation.
Like this;)

@RequestParam("tipe_lst", required = false) String tipe_lst

Upvotes: 1

Related Questions