jQuery in Action, 3rd edition
The moose likes Struts and the fly likes struts1.2 html:select tag not working Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "struts1.2 html:select tag not working" Watch "struts1.2 html:select tag not working" New topic

struts1.2 html:select tag not working

Shriyan San

Joined: Mar 15, 2005
Posts: 9
I have a problem with struts1.2 using html:select tags i'm getting

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

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

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.
alan do
Ranch Hand

Joined: Apr 14, 2005
Posts: 354
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?

-/a<br />certified slacker...yes, my last name is 'do' - <a href="http://www.luckycouple.com" target="_blank" rel="nofollow">luckycouple.com</a>
Shriyan San

Joined: Mar 15, 2005
Posts: 9
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

Joined: Mar 15, 2005
Posts: 9
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.
I agree. Here's the link: http://aspose.com/file-tools
subject: struts1.2 html:select tag not working
It's not a secret anymore!