Getting a GET request param into an @ViewScoped bean

后端 未结 2 1371
难免孤独
难免孤独 2021-01-14 12:13

I have a (request-scoped) list from which the user may select a \"PQ\" (list of links). When clicked or otherwise entered into the browser the main page for each PQ shall be

2条回答
  •  日久生厌
    2021-01-14 12:38

    There is a better way to get id from url. Just use it in @PostConstruct init() method to get "id" from url:

    FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get("id");
    

    You can still use ViewScoped and @PostConstruct.

提交回复
热议问题