You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Mick Knutson <mi...@gmail.com> on 2006/11/01 00:37:33 UTC
question about BackingBeans and POJO's
I am looking for a best practices for creating BackingBeans with sub
objects.
Such as, I want a UserBackingBean that has a User associated with it.
But I have done that, but use:
<h:inputText id="firstName"
value="#{UserBackingBean.user.firstName
}">
<f:validateLength minimum="2"
maximum="25" />
</h:inputText>
But this gives me this error:
15:22:49,656 ERROR [RendererUtils] Property not found - called by component
: {Component-Path : [Class: javax.faces.component.UIViewRoot,ViewId: /views/
istration/registration.jsp][Class: javax.faces.component.html.HtmlForm,Id:
_idJsp0][Class: javax.faces.component.html.HtmlOutputText,Id: _idJsp1]}
javax.faces.el.PropertyNotFoundException: Bean: java.lang.String, property:
firstName
at org.apache.myfaces.el.PropertyResolverImpl.getPropertyDescriptor(
PropertyResolverImpl.java:483)
at org.apache.myfaces.el.PropertyResolverImpl.getPropertyDescriptor(
PropertyResolverImpl.java:454)
at org.apache.myfaces.el.PropertyResolverImpl.getProperty(
PropertyResolverImpl.java:417)
at org.apache.myfaces.el.PropertyResolverImpl.getValue(
PropertyResolverImpl.java:82)
at org.apache.myfaces.el.ELParserHelper$MyPropertySuffix.evaluate(
ELParserHelper.java:532)
at org.apache.commons.el.ComplexValue.evaluate(ComplexValue.java
:145)
at org.apache.myfaces.el.ValueBindingImpl.getValue(
ValueBindingImpl.java:383)
at javax.faces.component.UIOutput.getValue(UIOutput.java:77)
at
org.apache.myfaces.shared_impl.renderkit.RendererUtils.getStringValue(
RendererUtils.java:217)
at
org.apache.myfaces.shared_impl.renderkit.html.HtmlTextRendererBase.renderOutput
(HtmlTextRendererBase.java:69)
at
org.apache.myfaces.shared_impl.renderkit.html.HtmlTextRendererBase.encodeEnd
(HtmlTextRendererBase.java:57)
at javax.faces.component.UIComponentBase.encodeEnd(
UIComponentBase.java:536)
at javax.faces.webapp.UIComponentTag.encodeEnd(UIComponentTag.java
:495)
at javax.faces.webapp.UIComponentTag.doEndTag(UIComponentTag.java
:363)
at
org.apache.jsp.views.registration.registration_jsp._jspx_meth_h_outputText_0
(registration_jsp.java:273)
at
org.apache.jsp.views.registration.registration_jsp._jspx_meth_h_form_0
(registration_jsp.java:211)
at
org.apache.jsp.views.registration.registration_jsp._jspx_meth_f_view_0
(registration_jsp.java:151)
at org.apache.jsp.views.registration.registration_jsp._jspService
(registration_jsp.java:109)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java
:97)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.jasper.servlet.JspServletWrapper.service(
JspServletWrapper.java:332)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(
JspServlet.java:314)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(
ApplicationFilterChain.java:173)
at org.apache.catalina.core.ApplicationDispatcher.invoke(
ApplicationDispatcher.java:672)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(
ApplicationDispatcher.java:463)
at org.apache.catalina.core.ApplicationDispatcher.doForward(
ApplicationDispatcher.java:398)
at org.apache.catalina.core.ApplicationDispatcher.forward(
ApplicationDispatcher.java:301)
at
org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(
ServletExternalContextImpl.java:416)
at org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(
JspViewHandlerImpl.java:234)
at org.apache.myfaces.lifecycle.LifecycleImpl.render(
LifecycleImpl.java:384)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(
ApplicationFilterChain.java:173)
at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(
ExtensionsFilter.java:144)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(
ApplicationFilterChain.java:173)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(
ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(
ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(
StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(
StandardContextValve.java:178)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(
SecurityAssociationValve.java:175)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(
JaccContextValve.java:74)
at org.apache.catalina.core.StandardHostValve.invoke(
StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(
ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(
StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(
CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(
Http11Processor.java:869)
at
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection
(Http11BaseProtocol.java:664)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(
PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(
MasterSlaveWorkerThread.java:112)
at java.lang.Thread.run(Thread.java:595)
15:22:49,671 ERROR [[jsp]] Servlet.service() for servlet jsp threw exception
javax.faces.el.PropertyNotFoundException: Bean: java.lang.String, property:
firstName
at org.apache.myfaces.el.PropertyResolverImpl.getPropertyDescriptor(
PropertyResolverImpl.java:483)
at org.apache.myfaces.el.PropertyResolverImpl.getPropertyDescriptor(
PropertyResolverImpl.java:454)
--
Thanks
DJ MICK
http://www.djmick.com
http://www.myspace.com/mickknutson
Re: question about BackingBeans and POJO's
Posted by Andrew Robinson <an...@gmail.com>.
Sounds like #{UserBackingBean.user} returns a string instead of a user object
Check your "getUser()" method in your backing bean.
On 10/31/06, Mick Knutson <mi...@gmail.com> wrote:
> I am looking for a best practices for creating BackingBeans with sub
> objects.
>
> Such as, I want a UserBackingBean that has a User associated with it.
>
>
> But I have done that, but use:
>
> <h:inputText id="firstName"
>
> value="#{UserBackingBean.user.firstName}">
> <f:validateLength minimum="2"
> maximum="25"
> />
> </h:inputText>
>
>
> But this gives me this error:
>
>
>
> 15:22:49,656 ERROR [RendererUtils] Property not found - called by component
> : {Component-Path : [Class:
> javax.faces.component.UIViewRoot ,ViewId: /views/
> istration/registration.jsp][Class:
> javax.faces.component.html.HtmlForm,Id: _idJsp0][Class:
> javax.faces.component.html.HtmlOutputText,Id: _idJsp1]}
> javax.faces.el.PropertyNotFoundException: Bean:
> java.lang.String , property: firstName
> at
> org.apache.myfaces.el.PropertyResolverImpl.getPropertyDescriptor(PropertyResolverImpl.java:483)
> at
> org.apache.myfaces.el.PropertyResolverImpl.getPropertyDescriptor(PropertyResolverImpl.java
> :454)
> at
> org.apache.myfaces.el.PropertyResolverImpl.getProperty(PropertyResolverImpl.java:417)
> at
> org.apache.myfaces.el.PropertyResolverImpl.getValue(PropertyResolverImpl.java:82)
> at
> org.apache.myfaces.el.ELParserHelper$MyPropertySuffix.evaluate
> (ELParserHelper.java:532)
> at
> org.apache.commons.el.ComplexValue.evaluate(ComplexValue.java:145)
> at
> org.apache.myfaces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:383)
> at javax.faces.component.UIOutput.getValue
> (UIOutput.java:77)
> at
> org.apache.myfaces.shared_impl.renderkit.RendererUtils.getStringValue(RendererUtils.java:217)
> at
> org.apache.myfaces.shared_impl.renderkit.html.HtmlTextRendererBase.renderOutput(
> HtmlTextRendererBase.java:69)
> at
> org.apache.myfaces.shared_impl.renderkit.html.HtmlTextRendererBase.encodeEnd(HtmlTextRendererBase.java:57)
> at
> javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java
> :536)
> at
> javax.faces.webapp.UIComponentTag.encodeEnd(UIComponentTag.java:495)
> at
> javax.faces.webapp.UIComponentTag.doEndTag(UIComponentTag.java:363)
> at
> org.apache.jsp.views.registration.registration_jsp._jspx_meth_h_outputText_0
> (registration_jsp.java:273)
> at
> org.apache.jsp.views.registration.registration_jsp._jspx_meth_h_form_0(registration_jsp.java:211)
> at
> org.apache.jsp.views.registration.registration_jsp._jspx_meth_f_view_0
> (registration_jsp.java:151)
> at
> org.apache.jsp.views.registration.registration_jsp._jspService(registration_jsp.java:109)
> at
> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
> at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
> at
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
> at
> org.apache.jasper.servlet.JspServlet.serviceJspFile(
> JspServlet.java:314)
> at
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
> at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
> (ApplicationFilterChain.java:252)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
> at
> org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java
> :672)
> at
> org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
> at
> org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
> at
> org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
> at
> org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:416)
> at
> org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:234)
> at
> org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:384)
> at javax.faces.webapp.FacesServlet.service
> (FacesServlet.java:138)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java
> :173)
> at
> org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:144)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
> at
> org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
> (ApplicationFilterChain.java:202)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
> at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java
> :213)
> at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
> at
> org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
> at
> org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
> at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
> at
> org.apache.catalina.valves.ErrorReportValve.invoke
> (ErrorReportValve.java:105)
> at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
> at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
> at
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
> at
> org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
> at
> org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket
> (PoolTcpEndpoint.java:527)
> at
> org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
> at java.lang.Thread.run(Thread.java:595)
> 15:22:49,671 ERROR [[jsp]] Servlet.service () for servlet jsp threw
> exception
> javax.faces.el.PropertyNotFoundException: Bean:
> java.lang.String, property: firstName
> at
> org.apache.myfaces.el.PropertyResolverImpl.getPropertyDescriptor(PropertyResolverImpl.java
> :483)
> at
> org.apache.myfaces.el.PropertyResolverImpl.getPropertyDescriptor(PropertyResolverImpl.java:454)
>
>
>
>
> --
>
> Thanks
>
> DJ MICK
> http://www.djmick.com
> http://www.myspace.com/mickknutson
Re: question about BackingBeans and POJO's
Posted by Jeff Bischoff <jb...@klkurz.com>.
Mick,
I don't see where you are initializing the "user" variable inside of
UserBackingBean. If user is null, then an el expression like
#{UserBackingBean.user.firstName} will give you serious problems. In
previous versions of Myfaces, this scenario threw no error messages yet
locked up the application. I don't know what behaviour it causes now.
Here's the other problem I see with this expression. You posted it as:
value="#{UserBackingBean.user.firstName
}"
Is this from the mail client, or is there really whitespace inside that
EL expression? Double check on the spelling and case of all variables.
Regards,
Jeff Bischoff
Kenneth L Kurz & Associates, Inc.
Mick Knutson wrote:
> What is the UserBackingBeanBeanInfo ???
>
> All I have is a simple UserBackingBeanBean with a set/get for public User
>
>
>
>
>
> On 10/31/06, Simon Kitching <si...@rhe.co.nz> wrote:
>>
>> Well,everything does seem to be right. However the original exception
>> does say:
>>
>> javax.faces.el.PropertyNotFoundException: Bean: java.lang.String ,
>> property: firstName
>> at
>> org.apache.myfaces.el.PropertyResolverImpl.getPropertyDescriptor(
>> PropertyResolverImpl.java:483)
>>
>> which seems to imply that getUser has returned a String object.
>>
>> The PropertyResolverImpl code is:
>> public static PropertyDescriptor getPropertyDescriptor(
>> BeanInfo beanInfo, String propertyName)
>> {
>> PropertyDescriptor[] propDescriptors =
>> beanInfo.getPropertyDescriptors();
>>
>> if (propDescriptors != null)
>> {
>> // TODO: cache this in classLoader safe way
>> for (int i = 0, len = propDescriptors.length; i < len; i++)
>> {
>> if (propDescriptors[i].getName().equals(propertyName))
>> return propDescriptors[i];
>> }
>> }
>>
>> throw new PropertyNotFoundException("Bean: "
>> + beanInfo.getBeanDescriptor().getBeanClass().getName()
>> + ", property: " + propertyName);
>> }
>>
>>
>> You don't happen to have a UserBackingBeanBeanInfo class around do you?
>>
>> As a wild guess, is the User class public? Maybe if it isn't, then
>> something in the java introspection or JSF el code is calling toString
>> on it to convert it to something that is accessable..
>>
>> I can't think what else might be causing your issue..
>>
>> Cheers,
>>
>> Simon
>>
>
>
>
Re: question about BackingBeans and POJO's
Posted by Marcio Ribeiro <mo...@gmail.com>.
Hey..
your looking at the wrong class!
The problem is at the User class.
It probably misses the getFirstName method!
Or you wrote it wrong.. take a good look!
Cheers
2006/10/31, Mick Knutson <mi...@gmail.com>:
>
> What is the UserBackingBeanBeanInfo ???
>
> All I have is a simple UserBackingBeanBean with a set/get for public User
>
>
>
>
>
> On 10/31/06, Simon Kitching <si...@rhe.co.nz> wrote:
> >
> > Well,everything does seem to be right. However the original exception
> > does say:
> >
> > javax.faces.el.PropertyNotFoundException: Bean: java.lang.String ,
> > property: firstName
> > at
> > org.apache.myfaces.el.PropertyResolverImpl.getPropertyDescriptor (
> > PropertyResolverImpl.java:483)
> >
> > which seems to imply that getUser has returned a String object.
> >
> > The PropertyResolverImpl code is:
> > public static PropertyDescriptor getPropertyDescriptor(
> > BeanInfo beanInfo, String propertyName)
> > {
> > PropertyDescriptor[] propDescriptors =
> > beanInfo.getPropertyDescriptors();
> >
> > if (propDescriptors != null)
> > {
> > // TODO: cache this in classLoader safe way
> > for (int i = 0, len = propDescriptors.length; i < len; i++)
> > {
> > if (propDescriptors[i].getName().equals(propertyName))
> > return propDescriptors[i];
> > }
> > }
> >
> > throw new PropertyNotFoundException("Bean: "
> > + beanInfo.getBeanDescriptor().getBeanClass().getName()
> > + ", property: " + propertyName);
> > }
> >
> >
> > You don't happen to have a UserBackingBeanBeanInfo class around do you?
> >
> > As a wild guess, is the User class public? Maybe if it isn't, then
> > something in the java introspection or JSF el code is calling toString
> > on it to convert it to something that is accessable..
> >
> > I can't think what else might be causing your issue..
> >
> > Cheers,
> >
> > Simon
> >
>
>
>
> --
>
> Thanks
>
> DJ MICK
> http://www.djmick.com
> http://www.myspace.com/mickknutson
>
Re: question about BackingBeans and POJO's
Posted by Mick Knutson <mi...@gmail.com>.
What is the UserBackingBeanBeanInfo ???
All I have is a simple UserBackingBeanBean with a set/get for public User
On 10/31/06, Simon Kitching <si...@rhe.co.nz> wrote:
>
> Well,everything does seem to be right. However the original exception
> does say:
>
> javax.faces.el.PropertyNotFoundException: Bean: java.lang.String ,
> property: firstName
> at
> org.apache.myfaces.el.PropertyResolverImpl.getPropertyDescriptor(
> PropertyResolverImpl.java:483)
>
> which seems to imply that getUser has returned a String object.
>
> The PropertyResolverImpl code is:
> public static PropertyDescriptor getPropertyDescriptor(
> BeanInfo beanInfo, String propertyName)
> {
> PropertyDescriptor[] propDescriptors =
> beanInfo.getPropertyDescriptors();
>
> if (propDescriptors != null)
> {
> // TODO: cache this in classLoader safe way
> for (int i = 0, len = propDescriptors.length; i < len; i++)
> {
> if (propDescriptors[i].getName().equals(propertyName))
> return propDescriptors[i];
> }
> }
>
> throw new PropertyNotFoundException("Bean: "
> + beanInfo.getBeanDescriptor().getBeanClass().getName()
> + ", property: " + propertyName);
> }
>
>
> You don't happen to have a UserBackingBeanBeanInfo class around do you?
>
> As a wild guess, is the User class public? Maybe if it isn't, then
> something in the java introspection or JSF el code is calling toString
> on it to convert it to something that is accessable..
>
> I can't think what else might be causing your issue..
>
> Cheers,
>
> Simon
>
--
Thanks
DJ MICK
http://www.djmick.com
http://www.myspace.com/mickknutson
Re: question about BackingBeans and POJO's
Posted by Simon Kitching <si...@rhe.co.nz>.
Well,everything does seem to be right. However the original exception
does say:
javax.faces.el.PropertyNotFoundException: Bean: java.lang.String ,
property: firstName
at
org.apache.myfaces.el.PropertyResolverImpl.getPropertyDescriptor(PropertyResolverImpl.java:483)
which seems to imply that getUser has returned a String object.
The PropertyResolverImpl code is:
public static PropertyDescriptor getPropertyDescriptor(
BeanInfo beanInfo, String propertyName)
{
PropertyDescriptor[] propDescriptors =
beanInfo.getPropertyDescriptors();
if (propDescriptors != null)
{
// TODO: cache this in classLoader safe way
for (int i = 0, len = propDescriptors.length; i < len; i++)
{
if (propDescriptors[i].getName().equals(propertyName))
return propDescriptors[i];
}
}
throw new PropertyNotFoundException("Bean: "
+ beanInfo.getBeanDescriptor().getBeanClass().getName()
+ ", property: " + propertyName);
}
You don't happen to have a UserBackingBeanBeanInfo class around do you?
As a wild guess, is the User class public? Maybe if it isn't, then
something in the java introspection or JSF el code is calling toString
on it to convert it to something that is accessable..
I can't think what else might be causing your issue..
Cheers,
Simon
Re: question about BackingBeans and POJO's
Posted by Mick Knutson <mi...@gmail.com>.
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Main TRO Registration</title>
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="-1">
<%-- standard the css and script --%>
<link rel="stylesheet" type="text/css"
href="/skins/default/css/styles.css"/>
<%-- Default DWR declarations --%>
<script type='text/javascript'
src='/tro/dwr/interface/UserBackingBean.js'></script>
<script type='text/javascript' src='/tro/dwr/engine.js'></script>
<script type='text/javascript' src='/tro/dwr/util.js'></script>
<script type='text/javascript' src='/skins/default/scripts/generic.js'>
</script>
</head>
<body>
<f:view>
<f:loadBundle basename="messages" var="messages"/>
<h:form>
<TABLE class="alternateRowColors">
<TBODY>
<TR>
<TD>
<h:outputText value="#{messages.label.firstName}"
/>:
</TD>
<TD>
<h:inputText id="firstName"
value="#{UserBackingBean.user.firstName
}">
<f:validateLength minimum="2"
maximum="25" />
</h:inputText>
</TD>
</TR>
<TR>
<TD>
<h:outputText value="#{messages.label.lastName}" />:
</TD>
<TD>
<h:inputText id="lastName"
value="#{UserBackingBean.user.lastName
}">
<f:validateLength minimum="2"
maximum="25" />
</h:inputText>
</TD>
</TR>
<h:commandButton action="register" value="#{
messages.label.button.register}" />
<br />
</h:form>
</body>
</html>
</f:view>
On 10/31/06, Mick Knutson <mi...@gmail.com> wrote:
>
> faces-config:
>
> <managed-bean>
> <managed-bean-name>UserBackingBean</managed-bean-name>
> <managed-bean-class>com.baselogic.tro.user.UserBackingBean</managed-bean-class>
>
> <managed-bean-scope>request</managed-bean-scope>
> </managed-bean>
>
> <managed-bean>
> <managed-bean-name>User</managed-bean-name>
> <managed-bean-class> com.baselogic.tro.user.User
> </managed-bean-class>
> <managed-bean-scope>request</managed-bean-scope>
> </managed-bean>
>
>
>
>
>
>
> On 10/31/06, Mick Knutson <mi...@gmail.com> wrote:
> >
> > UserBackingBean:
> >
> > private User user;
> >
> > public User getUser() {
> > return user;
> > }
> >
> > public void setUser(User user) {
> > this.user = user;
> > }
> >
> >
> >
> > User:
> >
> > public String getFirstName() {
> > return firstName;
> > }
> >
> > public void setFirstName(String firstName) {
> > this.firstName = firstName;
> > }
> >
> >
> >
> >
> >
> > On 10/31/06, Simon Kitching <si...@rhe.co.nz> wrote:
> > >
> > > Mick Knutson wrote:
> > > > I am looking for a best practices for creating BackingBeans with sub
> > > > objects.
> > > >
> > > > Such as, I want a UserBackingBean that has a User associated with
> > > it.
> > > >
> > > >
> > > > But I have done that, but use:
> > > >
> > > > <h:inputText id="firstName"
> > > >
> > > > value="#{UserBackingBean.user.firstName}">
> > > > <f:validateLength minimum="2"
> > > > maximum="25" />
> > > > </h:inputText>
> > > >
> > > The class that UserBackingBean refers to needs to define a method
> > > User getUser()
> > >
> > > The User class needs to define
> > > String getFirstName()
> > >
> > > Everything should then work fine. This is all standard JavaBeans
> > > conventions.
> > >
> > > Regards,
> > >
> > > Simon
> > >
> >
> >
> >
> > --
> >
> > Thanks
> >
> > DJ MICK
> > http://www.djmick.com
> > http://www.myspace.com/mickknutson
> >
>
>
>
> --
>
> Thanks
>
> DJ MICK
> http://www.djmick.com
> http://www.myspace.com/mickknutson
>
--
Thanks
DJ MICK
http://www.djmick.com
http://www.myspace.com/mickknutson
Re: question about BackingBeans and POJO's
Posted by Mick Knutson <mi...@gmail.com>.
faces-config:
<managed-bean>
<managed-bean-name>UserBackingBean</managed-bean-name>
<managed-bean-class>com.baselogic.tro.user.UserBackingBean
</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
<managed-bean>
<managed-bean-name>User</managed-bean-name>
<managed-bean-class>com.baselogic.tro.user.User</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
On 10/31/06, Mick Knutson <mi...@gmail.com> wrote:
>
> UserBackingBean:
>
> private User user;
>
> public User getUser() {
> return user;
> }
>
> public void setUser(User user) {
> this.user = user;
> }
>
>
>
> User:
>
> public String getFirstName() {
> return firstName;
> }
>
> public void setFirstName(String firstName) {
> this.firstName = firstName;
> }
>
>
>
>
>
> On 10/31/06, Simon Kitching <si...@rhe.co.nz> wrote:
> >
> > Mick Knutson wrote:
> > > I am looking for a best practices for creating BackingBeans with sub
> > > objects.
> > >
> > > Such as, I want a UserBackingBean that has a User associated with it.
> > >
> > >
> > > But I have done that, but use:
> > >
> > > <h:inputText id="firstName"
> > >
> > > value="#{UserBackingBean.user.firstName}">
> > > <f:validateLength minimum="2"
> > > maximum="25" />
> > > </h:inputText>
> > >
> > The class that UserBackingBean refers to needs to define a method
> > User getUser()
> >
> > The User class needs to define
> > String getFirstName()
> >
> > Everything should then work fine. This is all standard JavaBeans
> > conventions.
> >
> > Regards,
> >
> > Simon
> >
>
>
>
> --
>
> Thanks
>
> DJ MICK
> http://www.djmick.com
> http://www.myspace.com/mickknutson
>
--
Thanks
DJ MICK
http://www.djmick.com
http://www.myspace.com/mickknutson
Re: question about BackingBeans and POJO's
Posted by Mick Knutson <mi...@gmail.com>.
UserBackingBean:
private User user;
public User getUser() {
return user;
}
public void setUser(User user) {
this.user = user;
}
User:
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
On 10/31/06, Simon Kitching <si...@rhe.co.nz> wrote:
>
> Mick Knutson wrote:
> > I am looking for a best practices for creating BackingBeans with sub
> > objects.
> >
> > Such as, I want a UserBackingBean that has a User associated with it.
> >
> >
> > But I have done that, but use:
> >
> > <h:inputText id="firstName"
> >
> > value="#{UserBackingBean.user.firstName}">
> > <f:validateLength minimum="2"
> > maximum="25" />
> > </h:inputText>
> >
> The class that UserBackingBean refers to needs to define a method
> User getUser()
>
> The User class needs to define
> String getFirstName()
>
> Everything should then work fine. This is all standard JavaBeans
> conventions.
>
> Regards,
>
> Simon
>
--
Thanks
DJ MICK
http://www.djmick.com
http://www.myspace.com/mickknutson
Re: question about BackingBeans and POJO's
Posted by Simon Kitching <si...@rhe.co.nz>.
Mick Knutson wrote:
> I am looking for a best practices for creating BackingBeans with sub
> objects.
>
> Such as, I want a UserBackingBean that has a User associated with it.
>
>
> But I have done that, but use:
>
> <h:inputText id="firstName"
>
> value="#{UserBackingBean.user.firstName}">
> <f:validateLength minimum="2"
> maximum="25" />
> </h:inputText>
>
The class that UserBackingBean refers to needs to define a method
User getUser()
The User class needs to define
String getFirstName()
Everything should then work fine. This is all standard JavaBeans
conventions.
Regards,
Simon