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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Portals and Portlets
Bookmark "Struts - JSR168 Ajax Portlet - Problem!" Watch "Struts - JSR168 Ajax Portlet - Problem!" New topic
Author

Struts - JSR168 Ajax Portlet - Problem!

Christopher Frankland
Ranch Hand

Joined: Jan 22, 2005
Posts: 42
Hi,

Ok, I really hope somebody can help with this as I have hit a brick wall. I have a JSR-168 Struts portlet that I am developing and I would like to implement AJAX functionality - simply to update an InnerHTML tag on the screen for now.

I have my jsp page set up, along with my struts action. The aim is to update the page during the 'onchange' event of my text input. Can somebody please review my code to let me know if I am missing anything? It would much appreciated. Thanks.

districtChart.jsp



WelcomeAction.java



struts-config.xml

Bill Fly
Greenhorn

Joined: Mar 16, 2003
Posts: 12
Christopher,
I have two comments about your Javascript code, although I am certainly not an expert.
First, in you createXMLHttpRequest function, the preferred method of creating a XMLHttpRequest is new XMLHttpRequest
before the use of the new ActiveXObject.
Secondly, quoting Head Rush Ajax on page 183, "Using the innerHTML property is not a good way to get and set the contents of an element.
It's not part of the DOM specification, and the W3C has deprecated it - future versions of browsers may not even support it. Worse than that,
some browsers don't support it now."

I recommend that you look at the Head Rush book or any Ajax book and find better code to replace text in a DOM, instead of using the innerHTML
property.

[ December 06, 2007: Message edited by: Bill Fly ]

[ December 06, 2007: Message edited by: Bill Fly ]

[ December 06, 2007: Message edited by: Bill Fly ]
[ December 06, 2007: Message edited by: Bill Fly ]
Paul Earnest
Greenhorn

Joined: Jun 18, 2008
Posts: 11
I am also facing the same problem. if you have found any solution for your posts, please let me know.
Thanks in advance,
Paul
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Struts - JSR168 Ajax Portlet - Problem!
 
Similar Threads
Frustration with struts part 2. Is it supposed to be this hard?
AJAX question - Struts portlet JSR 168
need help in web.xml
Ajax + struts
How to forward past index.jsp