I have a jsp page with some java code and jsp functions. Please find the code below.
<%
try {
client.removeOAuthApplicationData(consumerkey);
String message = resourceBundle.getString("app.removed.successfully");
CarbonUIMessage.sendCarbonUIMessage(message,CarbonUIMessage.INFO, request);
} catch (Exception e) {
String message = resourceBundle.getString("error.while.removing.app");
CarbonUIMessage.sendCarbonUIMessage(message, CarbonUIMessage.ERROR, request,e);
forwardTo ="../admin/error.jsp";
}
%>
<script type="text/javascript">
function forward() {
alert('forward');
location.href = "<%=forwardTo%>";
}
function createAppOnclick() {
alert('testtt');
}
</script>
<script type="text/javascript">
createAppOnclick();
forward();
</script>
I need to call createAppOnclick function once the java code finishes executing. Once I execute this it calls first the createAppOnclick function. I am bit new to javascript and jsp and appreciate your help.
Thanks