-1

I want my page to be redirected to some other page on button click, whose action is mapped in struts.xml

How to achieve this?

Rish
  • 1,303
  • 9
  • 22
DebArghya Mondal
  • 71
  • 1
  • 1
  • 9
  • With what exactly are you having problems? – Aleksandr M Feb 09 '16 at 19:52
  • I need to somehow go to my action that is mapped in struts.xml on click of the back button. That action has other results mapped that will in turn redirect to the required jsp. – DebArghya Mondal Feb 09 '16 at 19:57
  • *on click of the back button* ? Browser back button? – Aleksandr M Feb 09 '16 at 20:09
  • 1
    Possible duplicate of [How to create an HTML button that acts like a link?](http://stackoverflow.com/questions/2906582/how-to-create-an-html-button-that-acts-like-a-link) – Aleksandr M Feb 11 '16 at 09:55
  • StackOverflow is a Q&A forum, not a code-writing service. Please post all the code you have written or tried so far and then specify your particular problem. – Rish Feb 11 '16 at 10:10

1 Answers1

2

Look at below solution

<button><a htref="/someAction.action">Back</a></button>

So whenever you will press the button then action will call and then it does its work.

If link inside button will not work you can try onclick event of jquery or javascript

I like to use jquery

So the code will look like.

<button id="backButtonClick">Back</button>

$("#backButtonClick").click(function(e){
   window.location.href="someAction.action";
});

Maybe this will help you.

Pratik Bhajankar
  • 1,144
  • 2
  • 14
  • 27