Hi,
I am using Struts Bridge in J2, with AJAX components.
For regular links, using <html:link works out fine, however for Ajax, I have
a validate function:
function validate()
{
var idField= document.getElementById("taskid");
var url = "validate?id=" + escape(idField.value);
if (window.XMLHttpRequest) {
req = new XMLHttpRequest();
}
else {
req = new ActiveXObject("Microsoft.XMLHTTP");
}
req.open("GET", url, true);
req.onreadystatechange=callback;
req.send(null);
}
This validate function has a url that it uses. It works fine as a WebApp but
gives a javascript "Object Expected" error when ran in J2.I assume this is
because of the URL itself. How do I call this URL within this function? (Is
GET ok or does it need to be POST? - I do not wish to use POST as it will
limit my application, and plus this does not affect the server side
application state.)
My URI in web.xml is:
<servlet>
<servlet-name>validate</servlet-name>
<servlet-class>com.svvc.rap.ValidateServlet</servlet-class>
<url-pattern>*.do</url-pattern>
</servlet>
<servlet-mapping>
<servlet-name>validate</servlet-name>
<url-pattern>/validate</url-pattern>
</servlet-mapping>