How to detect submit button clicked in multiple submit buttons scenario in single Action class? [duplicate]

You can define two actions in struts.xml file and use action attribute of <s:submit> tag in order to submit to different actions http://struts.apache.org/docs/submit.html. In JSP: <s:submit value=”Search” action=”searchEmployeeAction”/> <s:submit value=”Add New” action=”addEmployeeAction”/> In struts.xml: <action name=”addEmployeeAction” method=”add” class=”example.EmployeeAction”> <result>/example/add.jsp</result> </action> <action name=”searchEmployeeAction” method=”search” class=”example.EmployeeAction”> <result>/example/search.jsp</result> </action> And in your action create two public String methods … Read more

HTML form action and onsubmit issues

You should stop the submit procedure by returning false on the onsubmit callback. <script> function checkRegistration(){ if(!form_valid){ alert(‘Given data is not correct’); return false; } return true; } </script> <form onsubmit=”return checkRegistration()”… Here you have a fully working example. The form will submit only when you write google into input, otherwise it will return an … Read more

There is no Action mapped for namespace [/] and action name [login] associated with context path [/Struts2Test]

Issues related to: There is no Action mapped for namespace and action name associated with context path If you use URL to call an action, make sure this URL is mapped to the Struts configuration. To troubleshoot the issue with URL mapping you can use config-browser plugin. Simply add this plugin to your project dependencies … Read more

jqgrid EditActionIconsColumn Events

The formatter:’actions’ is not yet good documented. The current version of jqGrid 3.8.2 support some options which you need. In lines 394-466 of the jquery.fmatter.js of the current version you can see more. What you need are onEdit, afterSave (on “Submit”) and delOptions.onclickSubmit parameters. To tell the truth I didn’t use the ‘actions’ formatter before … Read more

android pick images from gallery

Absolutely. Try this: Intent intent = new Intent(); intent.setType(“image/*”); intent.setAction(Intent.ACTION_GET_CONTENT); startActivityForResult(Intent.createChooser(intent, “Select Picture”), PICK_IMAGE); Don’t forget also to create the constant PICK_IMAGE, so you can recognize when the user comes back from the image gallery Activity: public static final int PICK_IMAGE = 1; @Override public void onActivityResult(int requestCode, int resultCode, Intent data) { if (requestCode … Read more

Differences between action and actionListener

actionListener Use actionListener if you want have a hook before the real business action get executed, e.g. to log it, and/or to set an additional property (by <f:setPropertyActionListener>), and/or to have access to the component which invoked the action (which is available by ActionEvent argument). So, purely for preparing purposes before the real business action … Read more

commandButton/commandLink/ajax action/listener method not invoked or input value not set/updated

Introduction Whenever an UICommand component (<h:commandXxx>, <p:commandXxx>, etc) fails to invoke the associated action method, or an UIInput component (<h:inputXxx>, <p:inputXxxx>, etc) fails to process the submitted values and/or update the model values, and you aren’t seeing any googlable exceptions and/or warnings in the server log, also not when you configure an ajax exception handler … Read more