getValue() method of Input component returning null

Hi Folks,

I have a Password Component which models an encryption solution between the browser and the Java tier. What I did basically is :

1. This component is an Input component (meaning I render an HTML "input" element of "type" "password". ). Inside the constructor I have another HTML "input " element of type "hidden". My intent is that when this component is rendered it will render a java script which will encrypt the value typed for password (using some complicated logic ofcourse) and put that encrypted value into the hidden field and then will submit the form also.

Now my problem is that on the server side I want to get that encrypted value so that that I can decrypt it . For that I have kept a binding to the the component itself on my login page and inside the backng bean method processLogin(ActionEvent event) method one code snippet using HttpServletRequest is working whereas getValue method on that hidden input is returning null. What am I doing wrong here ?

//This code snippet doesn't work

String encryptedPassword = (String) this.getPasswordComp().getHiddenInput().getValue();

System.out.println("encryptedPassword = " + encryptedPassword);

//this is returning null

//This works

HttpServletRequest request = (HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest();

String encryptedValue = request.getParameter(this.getPasswordComp().getHiddenInput().getClientId(FacesContext.getCurrentInstance()));

System.out.println("encryptedValue = " + encryptedValue);

//This is returning the proper value

[1810 byte] By [subhrajyotia] at [2007-11-27 9:07:08]
# 1
Since you are using a custom component I imagine the issue is in your decode routines.However, I would strongly encourage you to abandon this solution to your problem and use SSL instead. It will be much more secure that way.
RaymondDeCampoa at 2007-7-12 21:43:28 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
Well what can be the problem in the decode routine ?
subhrajyotia at 2007-7-12 21:43:28 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
> Well what can be the problem in the decode routine ?The value on the hidden input is not set properly.
RaymondDeCampoa at 2007-7-12 21:43:28 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...