struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lukasz Lenart <lukaszlen...@apache.org>
Subject Re: Creating Your Own Struts 2 Theme No Longer Works?
Date Tue, 16 Jul 2013 18:44:31 GMT
2013/7/16 bphillips@ku.edu <bphillips@ku.edu>:
> Thank you for looking at this issue.
>
> I removed the theme attribute from the form tag.  But when I add the theme
> attribute to the s:checkboxList tag I now get this error:

It must be there, <s:form/> with xhtml theme, only <s:checkboxlist/>
must use KUtheme theme

> Error reading included file template/KUTheme/controlheader.ftl
> The problematic instruction:
> ----------
> ==> include
> "/${parameters.templateDir}/${parameters.theme}/controlheader.ftl" [on line
> 1, column 1 in template/KUTheme/checkboxlist.ftl]
> ----------
>
> So it appears that since the checkboxlist.ftl has include statements to
> other .ftl files the path to the other .ftl files is no longer referencing
> the .ftl files in the struts2 core jar.
>
> Is this related to your other post on themes?  I know that this used to work
> in an earlier version of Struts 2.

Are you sure? I have just tested with 2.2.1 (removed xhtml theme from
<s:form/>) and get exactly the same exception as for 2.3.15
So basically, this works:

<s:form action="save" method="post" theme="xhtml">
<s:textfield key="personBean.firstName" />
<s:textfield key="personBean.lastName" />
<s:select key="personBean.sport" list="sports" />
<s:radio key="personBean.gender" list="genders" />
<s:select key="personBean.residency" list="states" listKey="stateAbbr"
listValue="stateName" />
<s:checkbox key="personBean.over21" />
<s:checkboxlist key="personBean.carModels" list="carModelsAvailable"
theme="KUtheme"/>
<s:submit key="submit" />
</s:form>

And to solve your problem, ${parameters.theme} must be replaced with
hardcoded value.


Regards
-- 
Ɓukasz
+ 48 606 323 122 http://www.lenart.org.pl/

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


Mime
View raw message