Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Struts and the fly likes Struts 2.2.3 Ajax page load issue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts 2.2.3 Ajax page load issue" Watch "Struts 2.2.3 Ajax page load issue" New topic
Author

Struts 2.2.3 Ajax page load issue

V. Oliver Smith
Greenhorn

Joined: Nov 15, 2011
Posts: 11
I am using the AJAX-DOJO plugin with Struts 2.2.3 with the following code snippet:

<td> <s:url id="chdFltr3_url" action="loadChildFilterData"/>
<sx:div showLoadingText="false"
id="CAUSE_CODES_3" href="%{chdFltr3_url}" theme="ajax" listenTopics="show_childCodes3" formId="childFilterData">
</sx:div>
</td>

On page load I get the message where the s:url tag element is specified:

Error loading '/toga_reports/loadChildFilterData.action' (404 Not Found)

I have an html button that responds to an onclick event and calls the following

dojo.event.topic.publish("show_childCodes2");

When I click the button, I don't get the 404 Not found message and I'm able to access my configured Ajax action with no problem.

Does anyone know why it generates the message when the page is first loaded, and yet works fine when I click the button? What can I do to prevent the message from printing?

I appreciate any help
V. Oliver Smith
Greenhorn

Joined: Nov 15, 2011
Posts: 11
Minor correction:

The initial div is the following:

<td> <s:url id="chdFltr2_url" action="loadChildFilterData"/>
<sx:div showLoadingText="false"
id="CAUSE_CODES_2" href="%{chdFltr2_url}" theme="ajax" listenTopics="show_childCodes2" formId="childFilterData">
</sx:div>
</td>

in other words, the listen Topic is show_childCodes2, which matches the DOJO publish call. Just clarifying that is not the issue.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Struts 2.2.3 Ajax page load issue