I am working with javascript and here is what I am trying to do: 1. Send a get request which looks like "http://localhost:8080/myapp/verify.htm?verifyId=Agkvhs"
My requests reaches my verify.jsp in which I have javascript which does some special things and then should redirect to another url WITH the verifyId . My code looks like this:
function saveAndRedirect() {
var verifyId = "<%=request.getParameter("verifyId")%>";
var redirectUrl = "registrationVerify?verifyId=" + verifyId;
window.alert("Got value " + redirectUrl);
window.location = redirectUrl;
}
However this does not work. I have an alert which shows me the correct URL with the appended parameter as I expect. In my web.xml file I have a servlet mapping with the following:
<servlet-mapping>
<servlet-name>RegistrationVerificationServlet</servlet-name>
<url-pattern>/registrationVerify*</url-pattern>
</servlet-mapping>
This mapping was workign before I appended the verifyId to the URL, I could see my request beign redicted to the servlet, since I appended this param it is not working. Any ideas much appreciated!
If this is not the ideal way to do this, please let me know any alternative.
Thanks