I have Jboss Seam application that connects to mssql 2005 database.
I used Seam Gen to generate the application
When I deployed it. I could open RequestEdit.xhtml page and insert data into the database.
But RequestList.xhtml page shows following error
Code:
javax.el.ELException: /RequestList.xhtml: Property 'requestId' not found on type org.apache.catalina
.connector.RequestFacade
at com.sun.facelets.compiler.TextInstruction.write(TextInstruction.java:48)
at com.sun.facelets.compiler.UIInstructions.encodeBegin(UIInstructions.java:39)
at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:280)
at org.ajax4jsf.renderkit.RendererBase.renderChildren(RendererBase.java:262)
at org.richfaces.renderkit.AbstractTableRenderer.encodeOneRow(AbstractTableRenderer.java:246)
at org.richfaces.renderkit.AbstractRowsRenderer.process(AbstractRowsRenderer.java:87)
at org.ajax4jsf.model.SequenceDataModel.walk(SequenceDataModel.java:101)
at org.ajax4jsf.component.UIDataAdaptor.walk(UIDataAdaptor.java:994)
at org.richfaces.renderkit.AbstractRowsRenderer.encodeRows(AbstractRowsRenderer.java:107)
at org.richfaces.renderkit.AbstractRowsRenderer.encodeRows(AbstractRowsRenderer.java:92)
at org.richfaces.renderkit.AbstractRowsRenderer.encodeChildren(AbstractRowsRenderer.java:139)
at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:812)
The code for Request.java
Code:
@Entity
@Table(name = "request")
public class Request implements java.io.Serializable {
private int requestId;
private Date createdDate;
private String createdUserId;
public Request() {
}
public Request(int requestId) {
this.requestId = requestId;
}
public Request(int requestId, Date createdDate, String createdUserId) {
this.requestId = requestId;
this.createdDate = createdDate;
this.createdUserId = createdUserId;
}
@Id
@GeneratedValue(strategy = IDENTITY)
@Column(name = "request_id", unique = true, nullable = false)
public int getRequestId() {
return this.requestId;
}
public void setRequestId(int requestId) {
this.requestId = requestId;
}
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "created_date", length = 23)
public Date getCreatedDate() {
return this.createdDate;
}
public void setCreatedDate(Date createdDate) {
this.createdDate = createdDate;
}
@Column(name = "created_user_id", length = 50)
@Length(max = 50)
public String getCreatedUserId() {
return this.createdUserId;
}
public void setCreatedUserId(String createdUserId) {
this.createdUserId = createdUserId;
}
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "updated_date", length = 23)
public Date getUpdatedDate() {
return this.updatedDate;
}
}
RequestHome.java
Code:
@Name("requestHome")
public class RequestHome extends EntityHome<Request> {
public void setRequestRequestId(Integer id) {
setId(id);
}
public Integer getRequestRequestId() {
return (Integer) getId();
}
@Override
protected Request createInstance() {
Request request = new Request();
return request;
}
public void wire() {
}
public boolean isWired() {
return true;
}
public Request getDefinedInstance() {
return isIdDefined() ? getInstance() : null;
}
}
RequestList.java
Code:
@Name("requestList")
public class RequestList extends EntityQuery<Object>{
/**
*
*/
private static final String[] RESTRICTIONS = {
"lower(request.createdUserId) like concat(lower(#{requestList.request.createdUserId}),'%')",
};
private Request request = new Request();
@Override
public String getEjbql() {
return "select request from Request request";
}
@Override
public Integer getMaxResults() {
return 25;
}
public Request getRequest() {
return request;
}
@Override
public List<String> getRestrictions() {
return Arrays.asList(RESTRICTIONS);
}
}
RequestList.xhtml
Code:
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:s="http://jboss.com/products/seam/taglib"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:rich="http://richfaces.org/rich"
template="layout/template.xhtml">
<ui:define name="body">
<h:messages globalOnly="true" styleClass="message" id="globalMessages"/>
<h:form id="requestSearch" styleClass="edit">
<rich:simpleTogglePanel label="Request search parameters" switchType="ajax">
<s:decorate template="layout/display.xhtml">
<ui:define name="label">createdUserId</ui:define>
<h:inputText id="createdUserId" value="#{requestList.request.createdUserId}"/>
</s:decorate>
</rich:simpleTogglePanel>
<div class="actionButtons">
<h:commandButton id="search" value="Search" action="/RequestList.xhtml"/>
</div>
</h:form>
<rich:panel>
<f:facet name="header">Request search results</f:facet>
<div class="results" id="requestList">
<h:outputText value="The request search returned no results."
rendered="#{empty requestList.resultList}"/>
<rich:dataTable id="requestList"
var="request"
value="#{requestList.resultList}"
rendered="#{not empty requestList.resultList}">
<h:column>
<f:facet name="header">
<s:link styleClass="columnHeader"
value="requestId #{requestList.order=='requestId asc' ? messages.down : ( requestList.order=='requestId des
c' ? messages.up : '' )}">
<f:param name="order" value="#{requestList.order=='requestId asc' ? 'requestId desc' : 'requestId asc'}"/>
</s:link>
</f:facet>
#{request.requestId}
</h:column>
<h:column>
<f:facet name="header">
<s:link styleClass="columnHeader"
value="createdDate #{requestList.order=='createdDate asc' ? messages.down : ( requestList.order=='createdDa
te desc' ? messages.up : '' )}">
<f:param name="order" value="#{requestList.order=='createdDate asc' ? 'createdDate desc' : 'createdDate asc'}"/>
</s:link>
</f:facet>
#{request.createdDate}
</h:column>
<h:column>
<f:facet name="header">
<s:link styleClass="columnHeader"
value="createdUserId #{requestList.order=='createdUserId asc' ? messages.down : ( requestList.order=='creat
edUserId desc' ? messages.up : '' )}">
<f:param name="order" value="#{requestList.order=='createdUserId asc' ? 'createdUserId desc' : 'createdUserId asc'}"/>
</s:link>
</f:facet>
#{request.createdUserId}
</h:column>
<h:column>
<f:facet name="header">action</f:facet>
<s:link view="/#{empty from ? 'Request' : from}.xhtml"
value="Select"
id="request">
<f:param name="requestRequestId"
value="#{request.requestId}"/>
</s:link>
</h:column>
</rich:dataTable>
</div>
</rich:panel>
<div class="tableControl">
<s:link view="/RequestList.xhtml"
rendered="#{requestList.previousExists}"
value="#{messages.left}#{messages.left} First Page"
id="firstPage">
<f:param name="firstResult" value="0"/>
</s:link>
<s:link view="/RequestList.xhtml"
rendered="#{requestList.previousExists}"
value="#{messages.left} Previous Page"
id="previousPage">
<f:param name="firstResult"
value="#{requestList.previousFirstResult}"/>
</s:link>
<s:link view="/RequestList.xhtml"
rendered="#{requestList.nextExists}"
value="Next Page #{messages.right}"
id="nextPage">
<f:param name="firstResult"
value="#{requestList.nextFirstResult}"/>
</s:link>
<s:link view="/RequestList.xhtml"
rendered="#{requestList.nextExists}"
value="Last Page #{messages.right}#{messages.right}"
id="lastPage">
<f:param name="firstResult"
value="#{requestList.lastFirstResult}"/>
</s:link>
</div>
<s:div styleClass="actionButtons" rendered="#{empty from}">
<s:button view="/RequestEdit.xhtml"
id="create"
value="Create request">
<f:param name="requestRequestId"/>
</s:button>
</s:div>
</ui:define>
</ui:composition>
RequestList.page.xml
Code:
<page xmlns="http://jboss.com/products/seam/pages"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://jboss.com/products/seam/pages http://jboss.com/products/seam/pages-2.0.xsd">
<param name="firstResult" value="#{requestList.firstResult}"/>
<param name="order" value="#{requestList.order}"/>
<param name="from"/>
<param name="createdUserId" value="#{requestList.request.createdUserId}"/>