Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/396.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jquery-ui/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java Wicket中包含大量参数的html页面_Java_Html_Wicket_Parameter Passing - Fatal编程技术网

Java Wicket中包含大量参数的html页面

Java Wicket中包含大量参数的html页面,java,html,wicket,parameter-passing,Java,Html,Wicket,Parameter Passing,我用Wicket来实现这个程序 我有一个html页面,它最多需要10个参数,以便从上一个页面检索一些现有值 然而,所有这些参数不会在任何情况下都得到输入。有时只需要传入1个值,而有时需要传入10个值 在创建页面时,我实际上可以执行以下操作: setResponsePage(new htmlPage("string", null, null, null, null, null, null, null, null, null)); 及 但这是一种不好的做法吗?有更好的方法吗?看看Page

我用Wicket来实现这个程序

我有一个html页面,它最多需要10个参数,以便从上一个页面检索一些现有值

然而,所有这些参数不会在任何情况下都得到输入。有时只需要传入1个值,而有时需要传入10个值

在创建页面时,我实际上可以执行以下操作:

    setResponsePage(new htmlPage("string", null, null, null, null, null, null, null, null, null)); 


但这是一种不好的做法吗?有更好的方法吗?

看看
PageParameters
为了清晰地实现这一点,我决定将一个对象作为参数传递,并调用它的方法。现在看起来一定干净了。
   setResponsePage(new htmlPage("string", "string2", "string3", "string4", "string5", "string6", "string7", "string8", "string9", "string10"));