【发布时间】:2012-01-05 13:55:48
【问题描述】:
顺便提一下,我使用 Wicket 来实现这个程序。
我有一个 html 页面,它最多需要 10 个参数才能从上一页检索一些现有值。
但是,所有这些参数不会在每种情况下都得到它们的输入。有时只需要传入 1 个值,有时需要 10 个值。
在创建页面时,我实际上可以执行以下操作:
setResponsePage(new htmlPage("string", null, null, null, null, null, null, null, null, null));
和
setResponsePage(new htmlPage("string", "string2", "string3", "string4", "string5", "string6", "string7", "string8", "string9", "string10"));
但这是一种不好的做法吗?有没有更好的方法来做到这一点?
【问题讨论】:
-
我决定将一个对象作为参数传递并调用它的方法。它现在看起来必须更干净了。
标签: java html wicket parameter-passing