aspose file tools*
The moose likes Struts and the fly likes struts 2: ajax theme problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "struts 2: ajax theme problem" Watch "struts 2: ajax theme problem" New topic
Author

struts 2: ajax theme problem

vikas sharmaa
Ranch Hand

Joined: Jun 28, 2007
Posts: 191
i am creating 2 select boxes in struts 2 page. on selecting the first select box, the values in the second box will update using ajax theme. i have written the below jsp code:

i added struts2-dojo-plugin-2.1.6.jar and json-lib-2.1.jar to my lib folder for ajax support.



but i am getting the freemarker template error:

Expression parameters.parseContent is undefined on line 45, column 28 in template/ajax/head.ftl.


i added <sx:head parseContent="false"/> to resolve the error. but its still coming.

any help will be highly appreciated. thank you.
vikas sharmaa
Ranch Hand

Joined: Jun 28, 2007
Posts: 191
now, i have removed all the complexities from the above code. infact, just by including <s:head theme="ajax" /> tag under head tag the same error is coming:

Expression parameters.parseContent is undefined on line 45, column 28 in template/ajax/head.ftl.

please help me in resolving the error.

i guess, i am getting the error because of one of the three reasons:
1. i might not have included a required jar file to lib folder.
2. Or, there is some versioning issue.
3. Or, there is any settings to be done before using ajax theme?

please check the list of jars i have included in the lib folder:

commons-digester-2.0.jar
commons-fileupload-1.2.1.jar
commons-io-1.3.2.jar
commons-logging-1.0.4.jar
commons-logging-api-1.1.jar
commons-validator-1.3.1.jar
freemarker-2.3.15.jar
json-lib-2.1.jar
ognl-2.7.3.jar
struts2-convention-plugin-2.1.8.jar
struts2-core-2.1.8.jar
struts2-dojo-plugin-2.1.8.jar
struts2-sitemesh-plugin-2.1.8.jar
struts2-tiles-plugin-2.1.8.jar
tiles-api-2.0.6.jar
tiles-core-2.0.6.jar
tiles-jsp-2.0.6.jar
xwork-core-2.1.6.jar
vikas sharmaa
Ranch Hand

Joined: Jun 28, 2007
Posts: 191
The Dojo plugin will be deprecated on Struts 2.1

this is mentioned in the http://struts.apache.org/2.1.6/docs/ajax-and-javascript-recipes.html site. so, do we use any other plug-in for ajax theme support in struts 2.1.8 version. please suggest.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

The <s:head> tag shouldn't have an "ajax" theme in S2.1.

There's no direct replacement for the Dojo widgets as of yet. A few people are working on a jQuery plugin (I believe it's currently in the sandbox, so you could use it if you wanted) but I don't know what, if any, jQuery UI widgets it's currently using.

Personally, I do almost all JavaScript-type stuff manually without the use of a custom tag library. It gives me a lot more control over when, and how, my JavaScript is loaded.
vikas sharmaa
Ranch Hand

Joined: Jun 28, 2007
Posts: 191
thanks newton for the response. i guess then i should also use javascript instead.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: struts 2: ajax theme problem