servlet just displays null on black page and does not doPost().?

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
this is the code for the vm(which works):

<body class="lp">

<div class="module xsrf">
    <div class="mod-header">
    <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>


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 {

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?

1 answer

1 accepted

0 votes
Accepted answer

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

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.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published yesterday in Statuspage

194 years of downtime: looking back on incident data from 2018

Statuspage customers logged more than 194 years of collective incidents in 2018. That’s a whopping 87% increase from the  104 years logged in 2017 , and we aren’t even through December yet....

56 views 1 5
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you