Reputation: 337
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
Reputation: 364
You can set required = false
in @RequestParam annotation.
Like this;)
@RequestParam("tipe_lst", required = false) String tipe_lst
Upvotes: 1