1 13 14 package org.ejbca.ui.web.admin.approval; 15 16 import javax.faces.application.Application; 17 import javax.faces.context.FacesContext; 18 import javax.faces.el.ValueBinding; 19 import javax.servlet.http.HttpServletRequest ; 20 21 28 public class ApproveActionRequestBean { 29 private int uniqueId; 30 31 32 33 public ApproveActionRequestBean() { 34 FacesContext ctx = FacesContext.getCurrentInstance(); 35 36 try{ 37 String param = ((HttpServletRequest ) ctx.getExternalContext().getRequest()).getParameter("uniqueId"); 38 if(param != null){ 39 uniqueId = Integer.parseInt(((HttpServletRequest ) ctx.getExternalContext().getRequest()).getParameter("uniqueId")); 40 Application app = ctx.getApplication(); 41 ValueBinding binding = app.createValueBinding("#{approvalActionSession}"); 42 Object value = binding.getValue(ctx); 43 ((ApproveActionSessionBean) value).setUniqueId(uniqueId); 44 } 45 }catch(NumberFormatException e){ 46 47 } 48 } 49 50 public int getUniqueId() { 51 return uniqueId; 52 } 53 54 public void setUniqueId(int uniqueId) { 55 this.uniqueId = uniqueId; 56 } 57 58 59 } 60 | Popular Tags |