Plugin JiraWebActionSupport using doDefault disable doExecute?

Hello,

I’m actually writting a custom import plugin with the SDK and I reach the following :
1 - I made a JiraWebActionSupport URL to gather some “user” informations (velocity HTML form with visual effects JS inside the input.vm) => the submit aui-button trig correctly the action class doExecute() and then returnComplete to a second JiraWebActionSupport URL (“page2”)
2 - the second class contains doDefault() which is correctly run before returning “input”
3 - the page2 HTML form is correctly displayed with fields initialized with page1 values (filled from the doDefault)
4 - the submit aui-button DO NOT trig the doExecute() webAction but seems to submit the HTML form ??
(the page2 form is then reinitialized without any parameters from the doDefault() and without running the doExecute())

So what kind of submit does the page 2 aui-button ?

And is it possible to make it trig the doExecute() action in the java class ?

Regards,
Olivier.

Hi @OlivierCOQUILLARD,

Can you confirm what URL was provided to the action attribute on the <form> element on the second page?

The JiraWebActionSupport class will follow webwork’s standard ActionSupport flow:

  • Assuming your action is exposed at the /my/Action.jspa URL, going to that URL will invoke the ActionSupport#execute() method.
  • By default, this will cause the action’s doExecute() method to be invoked.
  • If you hit /my/Action!default.jspa, the action’s doDefault() method would be invoked rather than doExecute().
  • If you hit /my/Action!customCommand.jspa, the action’s doCustomCommand() method would be invoked rather than doExecute().
  • Whenever the doExecute() command is run, the action’s doValidation() method will get called beforehand. If the action’s invalidInput() method returns false, the doExecute() method will not be called.

It’s possible that either an “error” or “input” string value is being returned when you submit your form. It’s also possible that a “success” string value is being returned. Be sure you have a template set up for each of those message types, otherwise you’ll probably receive an HTTP 404.

Cheers,
Daz

2 Likes

Hi daz,

after further tests, and code reviews, my issue was due to a miss copy paste in the page2 input.vm file.

<form action="ImporterJiraAction.jspa" instead of <form action="ImportPrjConfAction.jspa" which produce the wrong trig of page1 instead of page2.

thanks for your answer and the details about the ActionSupport behaviour which will help me in my next functionnal steps.

Regards,
Olivier.