I've been working with my JSF project and I have a new doubt. My xhtml code looks as follows
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:t="http://myfaces.apache.org/tomahawk">
<h:head>
<title>Facelet Title</title>
</h:head>
<h:body>
<h:form enctype="multipart/form-data" >
<h:selectOneMenu rendered="#{uploadVerifier.check(userVerifier.username)}" >
<f:selectItems value="#{uploadVerifier.options}" />
</h:selectOneMenu>
<br/>
<t:inputFileUpload required="true" value="#{uploadFile.upFile}" />
<br/>
<h:commandButton value="Validar"
action="#{uploadFile.upload(userVerifier.username)}"/>
</h:form>
</h:body>
</html>
The problem is that, everytime I hit the button it sends me a NullPointerException because it seems that userVerifier.username is not returning a value. This Bean value has a parameter from previous xhtml and even more weird because this value I use it in the h:selectOneMenu ...
What's missing here? Thanks in advance !
P.S. the uploadFile.upload(String param) is supposed to just print the value of param.