01: /*************************************************************************
02: * *
03: * EJBCA: The OpenSource Certificate Authority *
04: * *
05: * This software is free software; you can redistribute it and/or *
06: * modify it under the terms of the GNU Lesser General Public *
07: * License as published by the Free Software Foundation; either *
08: * version 2.1 of the License, or any later version. *
09: * *
10: * See terms of license at gnu.org. *
11: * *
12: *************************************************************************/package org.ejbca.ui.web.admin.approval;
13:
14: import javax.faces.application.Application;
15: import javax.faces.context.FacesContext;
16: import javax.faces.el.ValueBinding;
17: import javax.servlet.http.HttpServletRequest;
18:
19: /**
20: * Bean to set the right Approve Request Data when calling the approveaction.jsf page
21: * from javascript
22: *
23: * @author Philip Vendil
24: * @version $Id: ApproveActionRequestBean.java,v 1.2 2006/09/05 09:23:28 anatom Exp $
25: */
26: public class ApproveActionRequestBean {
27: private int uniqueId;
28:
29: public ApproveActionRequestBean() {
30: FacesContext ctx = FacesContext.getCurrentInstance();
31:
32: try {
33: String param = ((HttpServletRequest) ctx
34: .getExternalContext().getRequest())
35: .getParameter("uniqueId");
36: if (param != null) {
37: uniqueId = Integer.parseInt(((HttpServletRequest) ctx
38: .getExternalContext().getRequest())
39: .getParameter("uniqueId"));
40: Application app = ctx.getApplication();
41: ValueBinding binding = app
42: .createValueBinding("#{approvalActionSession}");
43: Object value = binding.getValue(ctx);
44: ((ApproveActionSessionBean) value)
45: .setUniqueId(uniqueId);
46: }
47: } catch (NumberFormatException e) {
48:
49: }
50: }
51:
52: public int getUniqueId() {
53: return uniqueId;
54: }
55:
56: public void setUniqueId(int uniqueId) {
57: this.uniqueId = uniqueId;
58: }
59:
60: }
|