简体   繁体   English

如何在struts-config.xml中为操作设置默认参数值?

[英]How can I set default parameter value for an action in struts-config.xml?

How can I set default parameter value for an action in struts-config.xml? 如何在struts-config.xml中为操作设置默认参数值?

Such as: 如:

if action path="stamp" and parameter="language" -> 

the user can hit 用户可以点击

url <context-path>/stamp.do 

where in some default value is used such as 'en' for language parameter. 其中一些默认值用于语言参数,例如“ en”。

Haven't done this. 还没做 Doing some quick research, you can do it by using the dynamic action form. 做一些快速研究,您可以使用动态操作表单来完成。 You specify within your form beans the attributes of your forms and their initial values, then you use it as a normal form. 您可以在表单bean中指定表单的属性及其初始值,然后将其用作普通表单。 An example is found here: 在此处找到一个示例:

building controller components 建筑控制器组件

in the 4.3.1 section 在4.3.1节中

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM