You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by ch...@kattare.com on 2005/12/11 19:12:54 UTC

problem with forms

HI,
I have an action form, an action and a couple of jsp pages bound
together in tiles.  I'm trying to access a property of the action form
from the jsp and get the following error generated:
javax.servlet.jsp.JspException: Cannot find bean under name
org.apache.struts.taglib.html.BEAN
        at
org.apache.struts.taglib.html.SelectTag.calculateMatchValues(SelectTag.java:240)
The action can access the form bean fine.  What do I need to do for the
jsp to pick it up?
chhum


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: problem with forms

Posted by Ed Griebel <ed...@gmail.com>.
You have a trailing slash on the html:form, so the form element is
closed right there and therefore not including the select. Try this
instead:
 <html:form action="/core/surveys/data_match" >
<div id="displayOptionsContainer">
...
</div>
</td></tr>
</table>
</html:form>

On 12/11/05, chhum@kattare.com <ch...@kattare.com> wrote:
> Sure
>                                 <html:form action="/core/surveys/data_match" />
>                                 <div id="displayOptionsContainer">
>                                         <h3>Display Options</h3>
>                                         <div id="displayOptions">
>                                                 <table>
>                                                         <tr>
>                                                                 <td class="fieldName">Compensation</td>
>
>                                                                 <td colspan="2"><html:select property="data">
>
>             <html:option value="basic_salary">Base Salary</html:option>
>
>             <html:option value="total_cash">Total Cash</html:option>
>
>             <html:option value="total_comp">Total Compensation</html:option>
>
>           </html:select></td>
>
>                                                         </tr>
>
>
> The exception gets thrown on the <html:select> property but I assume
> this is just because its the first  one
>
> Quoting Richard Yee <ry...@cruzio.com>:
>
> > Can you send the JSP code in which you are trying to access the
> > bean?
> >
> > -R
> >
> > chhum@kattare.com wrote:
> > > I think so
> > > I think so.  I have this in the jsp
> > > <html:form action="/core/surveys/data_match" />
> > >
> > > this writes out as
> > > <form name="dataMatchForm" method="post"
> > > action="/prpi/core/surveys/data_match.do"></form>
> > >
> > > In struts.config
> > >    <form-bean name="dataMatchForm"
> > > type="com.conissaunce.prpi.surveys.AsstMngmtComp.dataMatchForm"/>
> > >
> > > Action path is
> > >   <action path="/core/surveys/data_match"
> > > type="com.conissaunce.prpi.surveys.AsstMngmtComp.dataMatchAction"
> > > name="dataMatchForm" scope="request" validate="true"
> > > input="/core/surveys/data_match"/>
> > >
> > >
> > >
> > >
> > > Quoting Richard Yee <ry...@cruzio.com>:
> > >
> > >
> > >> Does the JSP have a html:form tag in it that has the action
> > attribute
> > >>
> > >> set to an action mapping that has the action form as the value of
> > the
> > >>
> > >> 'name' parameter? Otherwise, what scope is the action form in?
> > >>
> > >> -Richard
> > >>
> > >>
> > >> chhum@kattare.com wrote:
> > >>
> > >>> HI,
> > >>> I have an action form, an action and a couple of jsp pages bound
> > >>> together in tiles.  I'm trying to access a property of the
> > action
> > >>>
> > >> form
> > >>
> > >>> from the jsp and get the following error generated:
> > >>> javax.servlet.jsp.JspException: Cannot find bean under name
> > >>> org.apache.struts.taglib.html.BEAN
> > >>>         at
> > >>>
> > >>>
> > >
> >
> org.apache.struts.taglib.html.SelectTag.calculateMatchValues(SelectTag.java:240)
> > >
> > >>> The action can access the form bean fine.  What do I need to do
> > for
> > >>>
> > >> the
> > >>
> > >>> jsp to pick it up?
>
> > >>> chhum
> > >>>
> > >>>
> > >>>
> > >>>
> > >>
> > ---------------------------------------------------------------------
> > >>
> > >>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > >>> For additional commands, e-mail: user-help@struts.apache.org
> > >>>
> > >>>
> > >>>
> > >>>
> > >>
> > ---------------------------------------------------------------------
> > >> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > >> For additional commands, e-mail: user-help@struts.apache.org
> > >>
> > >>
> > >
> > >
> > >
> > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > > For additional commands, e-mail: user-help@struts.apache.org
> > >
> > >
> > >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: problem with forms

Posted by ch...@kattare.com.
Goodness I’m a twit.  Thank you!
chhum


Quoting Wendy Smoak <ws...@gmail.com>:

> On 12/11/05, chhum@kattare.com <ch...@kattare.com> wrote:
> 
> > I think so.  I have this in the jsp
> > <html:form action="/core/surveys/data_match" />
> >
> > this writes out as
> > <form name="dataMatchForm" method="post"
> > action="/prpi/core/surveys/data_match.do"></form>
> 
> An empty form?  Try putting the <html:select> tag inside the
> <html:form>.  The select tag will look to the enclosing form tag to
> find the form bean.
> 
> --
> Wendy
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: problem with forms

Posted by Wendy Smoak <ws...@gmail.com>.
On 12/11/05, chhum@kattare.com <ch...@kattare.com> wrote:

> I think so.  I have this in the jsp
> <html:form action="/core/surveys/data_match" />
>
> this writes out as
> <form name="dataMatchForm" method="post"
> action="/prpi/core/surveys/data_match.do"></form>

An empty form?  Try putting the <html:select> tag inside the
<html:form>.  The select tag will look to the enclosing form tag to
find the form bean.

--
Wendy

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: problem with forms

Posted by ch...@kattare.com.
Sure
				<html:form action="/core/surveys/data_match" />
				<div id="displayOptionsContainer">
					<h3>Display Options</h3>
					<div id="displayOptions">
						<table>
							<tr>
								<td class="fieldName">Compensation</td>
							
								<td colspan="2"><html:select property="data">
                                                                       
            <html:option value="basic_salary">Base Salary</html:option>
                                                                       
            <html:option value="total_cash">Total Cash</html:option>
                                                                       
            <html:option value="total_comp">Total Compensation</html:option>
                                                                       
          </html:select></td>                                          
                                  
							</tr>


The exception gets thrown on the <html:select> property but I assume
this is just because its the first  one

Quoting Richard Yee <ry...@cruzio.com>:

> Can you send the JSP code in which you are trying to access the
> bean?
> 
> -R
> 
> chhum@kattare.com wrote:
> > I think so
> > I think so.  I have this in the jsp
> > <html:form action="/core/surveys/data_match" />
> >
> > this writes out as 
> > <form name="dataMatchForm" method="post"
> > action="/prpi/core/surveys/data_match.do"></form>
> >
> > In struts.config
> >    <form-bean name="dataMatchForm"
> > type="com.conissaunce.prpi.surveys.AsstMngmtComp.dataMatchForm"/>
> >
> > Action path is
> >   <action path="/core/surveys/data_match"
> > type="com.conissaunce.prpi.surveys.AsstMngmtComp.dataMatchAction"
> > name="dataMatchForm" scope="request" validate="true"
> > input="/core/surveys/data_match"/>
> >
> >
> >
> >
> > Quoting Richard Yee <ry...@cruzio.com>:
> >
> >   
> >> Does the JSP have a html:form tag in it that has the action
> attribute
> >>
> >> set to an action mapping that has the action form as the value of
> the
> >>
> >> 'name' parameter? Otherwise, what scope is the action form in?
> >>
> >> -Richard
> >>
> >>
> >> chhum@kattare.com wrote:
> >>     
> >>> HI,
> >>> I have an action form, an action and a couple of jsp pages bound
> >>> together in tiles.  I'm trying to access a property of the
> action
> >>>       
> >> form
> >>     
> >>> from the jsp and get the following error generated:
> >>> javax.servlet.jsp.JspException: Cannot find bean under name
> >>> org.apache.struts.taglib.html.BEAN
> >>>         at
> >>>
> >>>       
> >
>
org.apache.struts.taglib.html.SelectTag.calculateMatchValues(SelectTag.java:240)
> >   
> >>> The action can access the form bean fine.  What do I need to do
> for
> >>>       
> >> the
> >>     
> >>> jsp to pick it up?

> >>> chhum
> >>>
> >>>
> >>>
> >>>       
> >>
> ---------------------------------------------------------------------
> >>     
> >>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >>> For additional commands, e-mail: user-help@struts.apache.org
> >>>
> >>>
> >>>   
> >>>       
> >>
> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >> For additional commands, e-mail: user-help@struts.apache.org
> >>
> >>     
> >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
> >   
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: problem with forms

Posted by Richard Yee <ry...@cruzio.com>.
Can you send the JSP code in which you are trying to access the bean?

-R

chhum@kattare.com wrote:
> I think so
> I think so.  I have this in the jsp
> <html:form action="/core/surveys/data_match" />
>
> this writes out as 
> <form name="dataMatchForm" method="post"
> action="/prpi/core/surveys/data_match.do"></form>
>
> In struts.config
>    <form-bean name="dataMatchForm"
> type="com.conissaunce.prpi.surveys.AsstMngmtComp.dataMatchForm"/>
>
> Action path is
>   <action path="/core/surveys/data_match"
> type="com.conissaunce.prpi.surveys.AsstMngmtComp.dataMatchAction"
> name="dataMatchForm" scope="request" validate="true"
> input="/core/surveys/data_match"/>
>
>
>
>
> Quoting Richard Yee <ry...@cruzio.com>:
>
>   
>> Does the JSP have a html:form tag in it that has the action attribute
>>
>> set to an action mapping that has the action form as the value of the
>>
>> 'name' parameter? Otherwise, what scope is the action form in?
>>
>> -Richard
>>
>>
>> chhum@kattare.com wrote:
>>     
>>> HI,
>>> I have an action form, an action and a couple of jsp pages bound
>>> together in tiles.  I'm trying to access a property of the action
>>>       
>> form
>>     
>>> from the jsp and get the following error generated:
>>> javax.servlet.jsp.JspException: Cannot find bean under name
>>> org.apache.struts.taglib.html.BEAN
>>>         at
>>>
>>>       
> org.apache.struts.taglib.html.SelectTag.calculateMatchValues(SelectTag.java:240)
>   
>>> The action can access the form bean fine.  What do I need to do for
>>>       
>> the
>>     
>>> jsp to pick it up?
>>> chhum
>>>
>>>
>>>
>>>       
>> ---------------------------------------------------------------------
>>     
>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>> For additional commands, e-mail: user-help@struts.apache.org
>>>
>>>
>>>   
>>>       
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>     
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
>   


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: problem with forms

Posted by ch...@kattare.com.
I think so
I think so.  I have this in the jsp
<html:form action="/core/surveys/data_match" />

this writes out as 
<form name="dataMatchForm" method="post"
action="/prpi/core/surveys/data_match.do"></form>

In struts.config
   <form-bean name="dataMatchForm"
type="com.conissaunce.prpi.surveys.AsstMngmtComp.dataMatchForm"/>

Action path is
  <action path="/core/surveys/data_match"
type="com.conissaunce.prpi.surveys.AsstMngmtComp.dataMatchAction"
name="dataMatchForm" scope="request" validate="true"
input="/core/surveys/data_match"/>




Quoting Richard Yee <ry...@cruzio.com>:

> Does the JSP have a html:form tag in it that has the action attribute
> 
> set to an action mapping that has the action form as the value of the
> 
> 'name' parameter? Otherwise, what scope is the action form in?
> 
> -Richard
> 
> 
> chhum@kattare.com wrote:
> > HI,
> > I have an action form, an action and a couple of jsp pages bound
> > together in tiles.  I'm trying to access a property of the action
> form
> > from the jsp and get the following error generated:
> > javax.servlet.jsp.JspException: Cannot find bean under name
> > org.apache.struts.taglib.html.BEAN
> >         at
> >
>
org.apache.struts.taglib.html.SelectTag.calculateMatchValues(SelectTag.java:240)
> > The action can access the form bean fine.  What do I need to do for
> the
> > jsp to pick it up?
> > chhum
> >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
> >   
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: problem with forms

Posted by Richard Yee <ry...@cruzio.com>.
Does the JSP have a html:form tag in it that has the action attribute 
set to an action mapping that has the action form as the value of the 
'name' parameter? Otherwise, what scope is the action form in?

-Richard


chhum@kattare.com wrote:
> HI,
> I have an action form, an action and a couple of jsp pages bound
> together in tiles.  I'm trying to access a property of the action form
> from the jsp and get the following error generated:
> javax.servlet.jsp.JspException: Cannot find bean under name
> org.apache.struts.taglib.html.BEAN
>         at
> org.apache.struts.taglib.html.SelectTag.calculateMatchValues(SelectTag.java:240)
> The action can access the form bean fine.  What do I need to do for the
> jsp to pick it up?
> chhum
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
>   


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org