Meaningless Drivel is fun!*
The moose likes Struts and the fly likes s:doubleselect exception/ error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "s:doubleselect exception/ error" Watch "s:doubleselect exception/ error" New topic
Author

s:doubleselect exception/ error

Y Jadhav
Ranch Hand

Joined: Oct 02, 2008
Posts: 37
Expression parameters.formName is undefined on line 76, column 43 in template/simple/doubleselect.ftl.
The problematic instruction:
----------
==> ${parameters.formName} [on line 76, column 41 in template/simple/doubleselect.ftl]
in include "/${parameters.templateDir}/simple/doubleselect.ftl" [on line 3, column 1 in template/xhtml/doubleselect.ftl]
----------

Java backtrace for programmers:
----------
freemarker.core.InvalidReferenceException: Expression parameters.formName is undefined on line 76, column 43 in template/simple/doubleselect.ftl.
at freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:124)
at freemarker.core.Expression.getStringValue(Expression.java:118)
at freemarker.core.Expression.getStringValue(Expression.java:93)
at freemarker.core.DollarVariable.accept(DollarVariable.java:76)
at freemarker.core.Environment.visit(Environment.java:196)
at freemarker.core.MixedContent.accept(MixedContent.java:92)

Code for Double list is:

<s oubleselect label="Select Item"
headerValue="--- Please Select ---"
headerKey="1" list="{'Color','Fruits'}"
doubleName="dishes"
doubleList="top == 'Color' ? {'Black','Green','White',
'Yellow','Red','Pink'} : { 'Apple','Banana','Grapes','Mango'}" />
Tom Rispoli
Ranch Hand

Joined: Aug 29, 2008
Posts: 349
Is your s oubleselect tag nested inside of an s:form tag?
Y Jadhav
Ranch Hand

Joined: Oct 02, 2008
Posts: 37
Thanks TOM!
Yes it is nested inside form tag

<s:form action="addUser" method="post" id="addUser">

<tr>
<td colspan="2">
Login
</td>

</tr>

<tr>
<td colspan="2">
<s:actionerror />
<s:fielderror />
</td>

</tr>

<s:textfield name="fname" label="First name" size="20"/>
<s:textfield name="lname" label="Last name" size="20"/>
<s:textarea name="addline1" label="Address Line1 " cols="20" rows="1" />
<s:textarea name="addline1" label="Address Line1 " cols="20" rows="1" />

<s:select label="Select Country" name="countryname"
headerKey="1" headerValue="-- Please Select --"
list="#{'01':'India','02':'USA','03':'UK','04':'UAE',
'05':'Pakistan','06':'SriLanka','07':'Dubai','08':'Philipines'}"
/>

<s:select label="Select State"
name="statename" headerKey="1"
headerValue="-- Please Select --"
list="#{'01':'Maharashtra','02':'MadhyaPradesh','03':'Jammu-Kashmir','04':'Gujarat',
'05':'Kerala','06':'Tamilnadu'}"
/>

<s:select label="Select Religion"
name="religionname"
headerKey="1" headerValue="-- Please Select --"
list="#{'01':'Hindu','02':'Muslim','03':'Sikh','04':'Christian',
'05':'Buddhist','06':'Parasi'}"
/>

<s:textfield name="emailadd1" label="E-mail Address" size="20"/>
<s:radio label="(Receive Notification)" name="fruitsname" list="#{'01':'Yes','02':'No'}" />

<s oubleselect label="Select Item"
headerValue="--- Please Select ---"
headerKey="1" list="{'Color','Fruits'}"
doubleName="dishes"
doubleList="top == 'Color' ? {'Black','Green','White',
'Yellow','Red','Pink'} : { 'Apple','Banana','Grapes','Mango'}" />

<s:submit value="Submit" align="center"/>



</s:form>
Tom Rispoli
Ranch Hand

Joined: Aug 29, 2008
Posts: 349
interesting, the API says the formName attribute of the double select tag isn't required but it appears that it is crashing for you if it isn't populated. I've never used it so I can't say, but it may be a bug in struts2. Did you override the doubleselect.ftl for any of your themes? If you didn't then I would suggest supplying the form name attribute to the tag to see if that will fix it.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: s:doubleselect exception/ error
 
Similar Threads
s:doubleselect exception/ error
How to use Struts 2 UI Tags in GAE?
Nesting ognl expressions?
Question related to s:doubleselect
Strut2 + doubleselect Tag