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

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 Join to answer
Community showcase
Louis De Jaeger
Posted Thursday in Off-topic

Friday fun: your best joke

Hi all Lets make this Friday fun really fun and post one (or more) of your best jokes! The joke can be about an Atlassian product, or just a really fun joke you want to share! I’m not the best j...

187 views 12 3
Join discussion

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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot