KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > ejbca > ui > web > admin > approval > ApproveActionRequestBean


1 /*************************************************************************
2  * *
3  * EJBCA: The OpenSource Certificate Authority *
4  * *
5  * This software is free software; you can redistribute it and/or *
6  * modify it under the terms of the GNU Lesser General Public *
7  * License as published by the Free Software Foundation; either *
8  * version 2.1 of the License, or any later version. *
9  * *
10  * See terms of license at gnu.org. *
11  * *
12  *************************************************************************/

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 JavaDoc;
20
21 /**
22  * Bean to set the right Approve Request Data when calling the approveaction.jsf page
23  * from javascript
24  *
25  * @author Philip Vendil
26  * @version $Id: ApproveActionRequestBean.java,v 1.2 2006/09/05 09:23:28 anatom Exp $
27  */

28 public class ApproveActionRequestBean {
29   private int uniqueId;
30
31   
32   
33   public ApproveActionRequestBean() {
34       FacesContext ctx = FacesContext.getCurrentInstance();
35           
36       try{
37         String JavaDoc param = ((HttpServletRequest JavaDoc) ctx.getExternalContext().getRequest()).getParameter("uniqueId");
38         if(param != null){
39             uniqueId = Integer.parseInt(((HttpServletRequest JavaDoc) ctx.getExternalContext().getRequest()).getParameter("uniqueId"));
40             Application app = ctx.getApplication();
41             ValueBinding binding = app.createValueBinding("#{approvalActionSession}");
42             Object JavaDoc value = binding.getValue(ctx);
43             ((ApproveActionSessionBean) value).setUniqueId(uniqueId);
44         }
45       }catch(NumberFormatException JavaDoc 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