I am trying to execute code in a servlet but it doesnt execute anything in the doPost() method. Instead when the servlet is accessed it shows a blank page with "null" in its body.
this is how i call the vm(which works):
protected String doExecute() throws Exception
{
return MULTIPLEVERSION;
}
this is the code for the vm(which works):
<html> <head> <title>Warning</title> </head> <body class="lp"> <div class="module xsrf"> <div class="mod-header"> <h3>Warning</h3> </div> <div class="mod-content"> <div class="notify warn"> <span style="color:#cc0000;font-weight:bold;">Confirmation</span> <form name="multipleVersionForm" action="$theurl/plugins/servlet/aServlet" method="post" > <input id="projectId" type="hidden" value="$projectId" > <input id="versionName" type="hidden" value="$versionName" > <input id="theNewDate" type="hidden" value="$theNewDate" > <p>Do you wish to update 'SW Ready - 3 Weeks?'s Release date as well?</p> <p><input type="submit" value="Yes" ></input> <button onclick="history.go(-2);">No</button></p> </form> </div> </div> </div> </body> </html>
and when i hit the yes button it goes to .../plugins/servlet/aServlet (the Correct servlet) which is this:
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.getOutputStream().println("HI"); }
The Problem is that it is not executing the code in the doPost the page appears blank with only the word "null" in its body. Can anyone point out the problem?
Your doPost() is probably never getting executed. With my experiment I have found out that when the page is displayed, the action element of the form automatically has the correct url to the servlet. So, just keep the action element empty and see if it works
<form name="multipleVersionForm" action="" method="post" >
so i tried setting action to "" but that just gave me this error:
JIRA could not complete this action due to a missing form token.
You may have been away from your web browser for a while, which could have resulted in the expiry of your current form token. A new form token has been reissued.
JIRA administrators : Please refer to this page for details on disabling form token checking.
Problematic action : ExtendedEditVersionDetails.jspa
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Openup firebug and see the url where your submit getting posted, in other words look for the url that has been substituted in the action element.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.