f-angi
5/24/2016 - 10:48 AM

Sets an optional parameter in a friendly url

Sets an optional parameter in a friendly url

<routes>
	<route>
		<pattern>/cerca-polizza</pattern>
		<implicit-parameter name="view">polizza-search</implicit-parameter>
		<implicit-parameter name="p_p_id">DenunciaSinistroHIPortlet_WAR_denunciasinistrohiportlet</implicit-parameter>
		<implicit-parameter name="p_p_lifecycle">0</implicit-parameter>
	</route>

	<route>
		<pattern>/cerca-polizza/{draftId}</pattern>
		<generated-parameter name="draftId">{draftId}</generated-parameter>
		<implicit-parameter name="view">polizza-search</implicit-parameter>
		<implicit-parameter name="p_p_id">DenunciaSinistroHIPortlet_WAR_denunciasinistrohiportlet</implicit-parameter>
		<implicit-parameter name="p_p_lifecycle">0</implicit-parameter>
	</route>

</routes>
@Controller
@RequestMapping("VIEW")
@SessionAttributes("denuncia")
public class DenunciaController {
    @RenderMapping(params = {
        "view=polizza-search"
    })
    public String polizzaSearch(RenderRequest request, RenderResponse response, @ModelAttribute Denuncia denuncia, BindingResult bindingResult, Model model,
                    @RequestParam(required = false) final Long draftId) {

        if (draftId != null) {
            model.addAttribute("denuncia", denunciaDraftService.load(draftId));
        }
    }
                    
}