I am building a JSF 2.0 Application using primfaces. I have a managed bean that has several objects for different scenarios. In this particular portion of the application I move from a data table to a managed bean with an identification number. I pull the information from the database and even have it in the log. However when I make it to the JSF xhtml page the object values are null and I can't seem to figure out why, any help would be great
the ManagedBean
@ManagedBean(name="editData")
@RequestScoped
public class EditProjects implements Serializable{
/**
*
*/
private static final long serialVersionUID = 8453455174655946403L;
private final Log LOG = LogFactory.getLog(this.getClass().getName());
//Editable projects
private MailerProject edit_mailer = new MailerProject();
private TVProject edit_tv = new TVProject();
private RadioProject edit_radio = new RadioProject();
private WebProject edit_web = new WebProject();
private CustomProject edit_other = new CustomProject();
public int getProjectForm() {
String jobNumber = FacesContext.getCurrentInstance().
getExternalContext().getRequestParameterMap().get("jobNumber");
for(Entry<String, String> entry : FacesContext.getCurrentInstance().
getExternalContext().getRequestParameterMap().entrySet()) {
LOG.debug("REQUEST MAP PARAMETERS: " + entry.getKey() + " : " + entry.getValue());
}
int result = Integer.parseInt(FacesContext.getCurrentInstance().
getExternalContext().getRequestParameterMap().get("medium"));
ProjectDao pdao = new ProjectDao();
DescriptionDao ddao = new DescriptionDao();
LOG.debug("IM IN HERE NOW");
LOG.debug("PROJECT NUMBER: " + jobNumber);
LOG.debug("MEDIUM ID: " + result);
/*
* 1 Mailer
* 2 Tv
* 3 Radio
* 4 Web
* 5 Custom
*
*/
switch(result){
case 1:
this.edit_mailer = ddao.fetchMailerDescription(jobNumber);
LOG.debug("::::: MAILER ::::: " + this.edit_mailer.toString());
break;
case 2:
this.edit_tv = pdao.fetchTvProject(jobNumber);
break;
case 3:
this.edit_radio = pdao.fetchRadioProject(jobNumber);
break;
case 4:
this.edit_web = (WebProject)pdao.fetchWebProject(jobNumber);
break;
case 5:
this.edit_other = (CustomProject)pdao.fetchCustomProject(jobNumber);
break;
default:
result = 0;
break;
}
return result;
}
public MailerProject getEdit_mailer() {
return edit_mailer;
}
public TVProject getEdit_tv() {
return edit_tv;
}
public RadioProject getEdit_radio() {
return edit_radio;
}
public WebProject getEdit_web() {
return edit_web;
}
public CustomProject getEdit_other() {
return edit_other;
}
public void setEdit_mailer(MailerProject edit_mailer) {
this.edit_mailer = edit_mailer;
}
public void setEdit_tv(TVProject edit_tv) {
this.edit_tv = edit_tv;
}
public void setEdit_radio(RadioProject edit_radio) {
this.edit_radio = edit_radio;
}
public void setEdit_web(WebProject edit_web) {
this.edit_web = edit_web;
}
public void setEdit_other(CustomProject edit_other) {
this.edit_other = edit_other;
}
}
The log data where the edit_mailer object gets loaded
[http-nio-8080-exec-10] TRACE com.RossProjectManagement.rpm.services.CreateProject 07-20-2015 22:06:17 â ENTERING: ProjectDao method fetchMailerDescription()
[http-nio-8080-exec-10] DEBUG com.RossProjectManagement.rpm.services.CreateProject 07-20-2015 22:06:17 â DESCRIPTION DAO: org.apache.tomcat.dbcp.dbcp2.DelegatingResultSet@4debce40
[http-nio-8080-exec-10] DEBUG com.RossProjectManagement.rpm.beans.EditProjects 07-20-2015 22:06:17 â ::::: MAILER ::::: Project Header: Project [projectId=0, jobNumber=REDJ15061005, openDate=2015-06-29, salesMan=RickD, status=NEW, jobType=SPEC, medium=1]
MailerProject [size=11X17, color=SPOT_COLOR, quantity=20,000, proofDue=2015-06-30, in_home=2015-07-13, press_deadline=2015-07-06, begin=2015-07-15, end=2015-07-20, hosted=true, calls_to=BDC, leads_to=RichardDavy42@gmail.com, postage=STANDARD, price=7500.0, data=CONQUEST, data_instructions=NONE, mail_house=JS DIRECT, notes=NONE]
[http-nio-8080-exec-4] TRACE com.RossProjectManagement.rpm.beans.Data 07-20-2015 22:06:17 â ENTERING: Data method projects
The output in an h:outputlabel in my jsf page:
Project Header: Project [projectId=0, jobNumber=null, openDate=null, salesMan=null, status=null, jobType=null, medium=0] MailerProject [size=null, color=null, quantity=null, proofDue=null, in_home=null, press_deadline=null, begin=null, end=null, hosted=false, calls_to=null, leads_to=null, postage=null, price=0.0, data=null, data_instructions=null, mail_house=null, notes=null]
Any Help would be greatly appreciated...
Aucun commentaire:
Enregistrer un commentaire