• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

struts1.2 html:select tag not working

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a problem with struts1.2 using html:select tags i'm getting

org.apache.jasper.JasperException: Cannot find bean under name marketForm
error.
I have defined this in the struts-config.xml file
<form-beans>
<form-bean name="marketForm" type="com.chl.form.MarketForm" />
</form-beans>

my jsp code is this
<html:select property="marketId" styleClass="inputtext" name="marketForm" >
<html ptions collection="marketSession" property="marketId" labelProperty="marketId" />
</html:select>

i was trying this for past 2 days couldn't figure it out, but in struts 1.1 it works fine, what did i do wrong.
 
Ranch Hand
Posts: 354
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
if your html:select is already inside an html:form, which should be mapped to the action that is mapped to your form-bean already, why declare the 'name' attribute at all for the html:select?
 
Shriyan San
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well the problem is the action form is different bean object, i'm overiding the html select with diff bean object. Basically i'm trying to re-use the session objects in every single drop down.
Accoring the docs you can do it, however mine works only if the form action object mathces with the select object bean.
Anyway thanks for the reply. Hope i'll figure this out soon.
 
Shriyan San
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Found the soultion
go to http://struts.apache.org/faqs/newbie.html#noForm
and check this section
Can I use other beans or hashmaps with ActionForms?

Thanks anyway for the help.
 
Anything worth doing well is worth doing poorly first. Just look at this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic