Hi, atlassian I want to execute POST request to servlet in order to execute doPost function. So and I use http://localhost:8080/plugins/servlet/my-servlet for my servlet page. Also I'm using .vm file to display login and password on the issue page, it displayed fine, and when I write my host (http://localhost:8080/plugins/servlet/my-servlet) in form action value it works perfectly. But i don't want to hardcode it, so and I'm using this javascript method to get url. But it not works. How can I use my servlet host in action value? Sorry for bad english :-)
<script language="JavaScript">
function get_servlet_host () {
var host = location.protocol + "//" + location.host + "/plugins/servlet/my-servlet";
return host.toString();
}
</script>
<form action="javascript:get_servlet_host()" method="post" target="_blank">
<label for="username">Username:</label>
<input type="text" id="username" name="username"<br>
<label for="password">Password:</label>
<input type="password" id="password" name="password"<br>
<input type="submit" value="Login">
</form>
Thanks,
Mamikon
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.