`
- 浏览:
343453 次
- 性别:
- 来自:
成都
-
Parameters in configuration results
- Parameters in configuration results
- Edit Page Browse Space Add Page Add News
- Added by Dariusz Wojtas, last edited by Dariusz Wojtas on Feb 03, 2007 (view change)
- Sometimes there is a need to redirect from one action to another, but you do not know the exact url or the destination url requires parameters that are only known in runtime.
-
- Struts 2 gives you easy to use solution for that problem.
-
- Parameters in action result definitions
- <struts>
- ....
- <package name="somePackage" namespace="/myNamespace" extends="struts-default">
- <action name="myAction" class="com.project.MyAction">
- <result name="success" type="redirect-action">otherAction?id=${id}result>
- <result name="back" type="redirect">${redirectURL}result>
- action>
-
- <action name="otherAction" class="com.project.MyOtherAction">
- ...
- action>
- package>
- ....
- struts>
- The only requirement is to declare the necessary properties in your action, in this case com.project.MyAction should define properties id and redirectURL with standard accessor methods.
-
- public class MyAction extends ActionSupport {
- private int id;
- private String redirectURL;
- ...
-
-
- public String execute() {
- ...
- if (someCondition) {
- this.redirectURL = "/the/target/page.action";
- return "back";
- }
-
- this.id = 123;
- return SUCCESS;
- }
-
- public int getId() { return this.id; }
- public void setId(int id) { this.id = id; }
- public String getRedirectURL() { return this.redirectURL; }
- public void setRedirectURL(String redirectURL) { this.redirectURL= redirectURL; }
- ...
- }
- In the above code if it returns SUCCESS then the browser will be forwarded to
- /<app-prefix>/myNamespace/otherAction.action?id=123
-
分享到:
Global site tag (gtag.js) - Google Analytics
相关推荐
- Workaround for the rare crash bug in Vista in atklumdisp.dll at address 0x730676ae. - Added trace debug information for BurnInTest startup and the 3D test. Release 5.3 build 1022 WIN32 release 12...
parameters and retrieval of results. My Batis can use simple XML or Annotations for configuration and map primitives, Map interfaces and Java POJOs (Plain Old Java Objects) to database records. 1.1.2 ...
Through simulation results, various strategies and schemes can be compared, optimized, and their relevant parameters determined. In the field of asynchronous motor control, the vector control ...
By systematically varying these parameters and evaluating the performance on the Corel image dataset, the authors identify an optimal configuration that yields the best classification results. ...
- SQL errors now shown in results panel instead of modal dialog (configurable) - Certain long strings visibility problem was fixed - Auto completion was fixed for CALL/EXEC keywords - Tables/...
However, in 11g Release 2, result caches are now shared across all instances in a RAC configuration. This change improves the scalability and availability of applications running in a RAC environment...
- Compliance with many JEDEC standard test methodologies ensures that the WLR systems adhere to industry standards, enhancing confidence in the results obtained. 5. **Rapid Test Routine Creation** ...
You can now customize list of keywords that you also use as object and column names, and which you don't want SQL Assistant to treat as keywords, for example, the default configuration includes ID and...
MySQL and basic configuration parameters. Chapter 5, Transactions, explains the four isolation levels of RDBMS and how to use MySQL for transactions. Chapter 6, Binary Logging, demonstrates how to ...
Exploring the Results A Note about Version Numbers Adding GNOME GNOME Macros gnome-config GNOME Makefile Variables autogen.sh Some Grumpy GNOME Examples 10. Graphics Graphics in the X Window System ...
The configuration of a CCD is illustrated in Figure 1-1. It consists of an electrode deposited on a dielectric film, which is formed on a semiconductor substrate. **1.1.1 CCD Structure** When a ...
3.1 Displaying Results |dbext-configure-results| 3.2 Script Variables |dbext-configure-variables| 3.3 Database Specific Options |dbext-configure-options| 3.4 DB2 Modes |dbext-configure-db2| 4. ...
Using Tunable OSPF Parameters 202 Naming an Area 204 Standard Area Design 205 Golden Rules of Standard Area Design 205 Backbone Area Design 205 Backbone Design Golden Rules 206 Stub Area Design 207 ...
A stack is an area of memory in which program procedure or function call addresses and parameters are temporarily stored. In Process To run in the same address space. In-process servers are loaded ...
2018-09-29: v.2.3.0_r71, Add -c parameters in supernode 2018-09-28: v.2.3.0_r71, Generate "master" version, freeze 2018-08-16: v.2.3.0_r54, Edge and supernode can reads a configuration file now ...
* initialization parameters (which come from the web.xml configuration file) * to create a single JDBC database connection, which is shared by all clients * of the servlet. ***/ public class Query...
MyBatis eliminates almost all of the JDBC code and manual setting of parameters and retrieval of results. MyBatis can use simple XML or Annotations for configuration and map primitives, Map ...
MyBatis eliminates almost all of the JDBC code and manual setting of parameters and retrieval of results. MyBatis can use simple XML or Annotations for configuration and map primitives, Map ...
In addition to the standard items, depending on the configuration and options selected, you may also receive: - Advanced adapters - Specialized test fixtures - Additional software licenses #### ...