Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts 2 Remote Div Problem

 
Kabron Kline
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to build a JSP page that contains a DIV which can be dynamically updated via AJAX whenever a navigation tab is selected. For this, I am using Struts 2.1.8.1 with included dojo plugin.

In my JSP head element, I have the following:

Here is the DIV element defined on the same JSP:

Inside Struts.xml, here is what I have defined for QueueView action (note that there are no special parameters being set for struts.xml):

Here is the action class for QueueView:

I am taking this approach because I want to be able to set the href attribute on the div element via javascript according to what action needs to be called (will be set in the DOM when navigation tab buttons are clicked). At this point, all that happens when the page loads is the div displays with the text, "Initial Content" but the AJAX request is never made to the action. I know this because I have set debug break points in the action class, and they have not been hit.

Can somebody help point me in the right direction?



 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If it's not a timer, why are you using autoStart? Did you try it without it?
 
Kabron Kline
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
David Newton wrote:If it's not a timer, why are you using autoStart? Did you try it without it?


I did try that already and it doesn't seem to make a difference.
 
Kabron Kline
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is a directory listing of my WEB-INF/lib directory:


Note that all JAR files were obtained from the official Struts website for Struts 2.1.8.1.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any JavaScript errors in Firebug?
 
Kabron Kline
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As far as I can tell, Firebug is not reporting any JS errors. I am developing this project as a prototype for an internal application that will run in IE6/7 (neither of which are reporting JS errors).
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is the generated URL correct?
 
Kabron Kline
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Generated URL is relative and appears to be correct:


(Where "contextroot" is the name of the application)
 
Kabron Kline
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also, here is my taglib statement:

 
Kabron Kline
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
After working through some example tonight at home, I'm not having any problems getting Ajax to work on Tomcat 6. I'm using WebSphere 6.1 at work and it has been producing odd system log messages. I think my problem has something to do with Websphere, I'll follow up tomorrow.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't even know if the filter compatibility flag is available in WebFear 6, but check for it anyway. It's a known issue.
 
Kabron Kline
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It definitely looks like an issue with WebSphere 6.1.0.2. I set "com.ibm.ws.webcontainer.invokefilterscompatibility" to true in the container settings, but that didn't produce any results. I'm also seeing the following after every request:



This thread describes the same problem with the strange log message, but it doesn't address non-functional Ajax functionality:

http://www.coderanch.com/t/485837/Struts/Application-Frameworks/Struts-Reponse-already-committed-errors

Per some recommendations I've read, I'm going to install Fix Pack 5 for WebSphere 6.1.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic