Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

s:doubleselect exception/ error

 
Y Jadhav
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 349
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is your s oubleselect tag nested inside of an s:form tag?
 
Y Jadhav
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 349
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic