File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes Ajax them Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Ajax them" Watch "Ajax them" New topic
Author

Ajax them

James Dutt
Greenhorn

Joined: Apr 16, 2009
Posts: 9
Hi, Can any one tell me all the required configuration to use AJAX theme in struts2. When I try to use, I get error message like head.ftl, many other ftls are missing. Where as if I use xhtml theme, everything works fine. But I need to use AJAX theme. Thanks.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Which version of Struts? Are you including the <s:head> tag or <sx:head> tag for S2.1+?

It'd help if you showed a minimal JSP that causes the issue. Other factors might include the filter mapping.
James Dutt
Greenhorn

Joined: Apr 16, 2009
Posts: 9
I am using Struts 2.1.6. I have <s:head> tag as <s:head theme="ajax" />. Should I use <sx:head> to have ajax theme?

In my My jsp i am trying to use ajax theme in the form tag also as shown below. I dono which is the right way.

<s:form id="Myform" action="HotelList" namespace="/"
method="post" theme="ajax">

I don't have "ajax" folder in WEB-INF\classes\template folder. in the error log it says it cannot find file head.ftl, some more .ftl in ajax folder.

Looks like i need a ajax folder with set of .ftl files. So if i know the basic configurations/requirements/setup to use AJAX theme, i will check my files/folders to make sure i have everything. Thanks for your time.


David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Yes, you need the <sx:head> tag: see the documentation here, where it states:
The docs wrote:To use the AJAX tags from 2.1 on you must:

* Include the Dojo Plugin distributed with Struts 2 in your /WEB-INF/lib folder.
* Add <%@ taglib prefix="sx" uri="/struts-dojo-tags" %> to your page.
* Include the (dojo) head tag on the page, which can be configured for performance or debugging purposes.

Have you met those requirements?

I'm also not sure if setting the form's theme to "ajax" will work as you believe it will; AFAIK using the <sx:submit> tag is the way to do that in S2.1. You may want to have a quick look at some of the existing documentation before proceeding much further.
James Dutt
Greenhorn

Joined: Apr 16, 2009
Posts: 9
Thanks a lot. Will do more research on it. This gives me some direction to move on. If you come across more on this, could you please post under this discussion. Appreciate it.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Ajax them
 
Similar Threads
autocompleter and datetimepicker not working in Struts 2
Ajax tag is not working in strus2.1.6 with eclipse editor
how to apply theme as ajax to the jsp form with struts2-core-2.1.6.jar used struts 2 application ?
Struts 2 Dojo autocompleter not working in Struts 2.0.14?
struts 2 theme ajax