I have previously written a bash script that executes a java class, it does other checks before running that class.
when running it takes arguments; ./SyncIPs.cmd 10.0.1.45 and executes few commands.
I am trying to run this script in a jsp page using a html/javascript button. I have so far, two jsp files as follows:
portal.jsp:
<%
if(request.getParameter("submitted")==null)
{
if(check)
{
%><%@include file="Sync.jsp" %><%
}
else
{
%><%@include file="Sync.jsp" %><%
}
}
%>
Sync.jsp:
<%
if(request.getParameter("submit") == null)
{
%>
<div class=display>this is the Sync</div>
</div>
<br>
<form method="POST" action="/project/jsp/Portal.jsp" id=form2>
<input type=hidden name=sync>
<!---this is where I want my script to be run from,--->
<input type="button" value="" name="submit" action="run"
onClick="if(runOnSubmit()){getSomethingWithAjax
('Portal.jsp'+getAllFormElementsAndMakeIntoURI(true),
'','hereIsTheMainHeaderSpan',false,false);}">
<%
}//end if
%>
How do I get this script to run and get posted on the portal.jsp page?
You have to put some java code in your .jsp
NOTE: be aware of possible security issues