Struts1.2.4 study experience! (4)

xiaoxiao2021-03-06  55

Fourth study: This study has been different from Struts1.1, that is, the Actionform class is more than just String type, which can be any data type. 1. Form entry (including bean nested). TestBean class, this class also contains a nested property (NESTED as an instance of a class), uses NESTED.BOOLEANPROPERTY to specify the position when setting the value for the BooleanProperty property attribute at the Nested class. The data is filled into TestBean and Nested.

Java code:

1

2 <% @ Taglib URI = "/ Tags / Struts-Bean" prefix = "bean"%>

3 <% @ Taglib URI = "/ Tags / Struts-HTML" prefix = "html"%>

4 <% @ Taglib Uri = "/ Tags / Struts-Logic" prefix = "logic"%>

5

6

7 Test struts-html property setters </ title></p> <p>8 </ hEAD></p> <p>9 <body></p> <p>10 <div align = "center"></p> <p>11 <H1> Test Struts-HTML Property Setters </ h1></p> <p>12 </ div></p> <p>.</p> <p>Press "save" to update, or "ca Zance" to</p> <p>Return to the main menu. </ p></p> <p>14 <html: form action = "/ html-setters-submit"></p> <p>15 <table border = "</p> <p>0 "width ="</p> <p>100%></p> <p>16 <TR></p> <p>17 <TH align = "center" colspan = "</p> <p>4 "> scalar</p> <p>Properties </ TH></p> <p>18 </ tr></p> <p>19 <TR></p> <p>20 <TH Align = "Right"> BooleanProperty </ TH></p> <p>21 <TD Align = "Left"></p> <p>22 <html: CheckBox property = "BooleanProperty" /></p> <p>23 </ td></p> <p>24 <TH Align = "Right"> NESTED.</p> <p>BooleanProperty </ th></p> <p>25 <TD align = "left"></p> <p>26 <html: checkbox property = "nested.booleanproperty" /></p> <p>27 </ td></p> <p>28 </ tr></p> <p>29 <TR></p> <p>30 <TH Align = "Right"> DoubleProperty </ TH></p> <p>31 <TD Align = "Left"></p> <p>32 <html: Text Property = "doubleproperty" size = "</p> <p>32 "/></p> <p>33 </ td></p> <p>34 <TH Align = "Right"> NESTED.</p> <p>DoubleProperty </ th></p> <p>35 <TD align = "left"></p> <p>36 <HTML: Text Property = "NESTED.</p> <p>DoubleProperty "size ="</p> <p>32 "/></p> <p>37 </ td></p> <p>38 </ tr></p> <p>39 <TR></p> <p>40 <th align = "right"> floatproperty </ tH></p> <p>41 <td align = "left"></p> <p>42 <HTML: Text Property = "floatproperty" size = "</p> <p>32 "/></p> <p>43 </ td></p> <p>44 <TH Align = "Right"> NESTED.</p> <p>FLOATPROPERTY </ TH></p> <p>45 <TD align = "left"></p> <p>46 <HTML: TEXT Property = "NESTED.</p> <p>FLOATPROPERTY "size ="</p> <p>32 "/></p> <p>47 </ td></p> <p>48 </ tr></p> <p>49 <TR></p> <p>50 <TH Align = "Right"> intproperty </ th></p> <p>51 <TD align = "left"></p> <p>52 <HTML: Text Property = "INTPROPERTY" SIZE = "</p> <p>32 "/></p> <p>53 </ td></p> <p>54 <trh align = "right"> nested.</p> <p>INTPROPERTY </ TH></p> <p>55 <TD align = "left"></p> <p>56 <HTML: Text Property = "NESTED.</p> <p>INTPROPERTY "size =" 32 "/></p> <p>57 </ td></p> <p>58 </ tr></p> <p>59 <TR></p> <p>60 <TH Align = "Right"> longproperty </ th></p> <p>61 <TD align = "left"></p> <p>62 <html: Text Property = "longproperty" size = "</p> <p>32 "/></p> <p>63 </ td></p> <p>64 <TH Align = "Right"> NESTED.</p> <p>LongProperty </ th></p> <p>65 <TD align = "left"></p> <p>66 <HTML: Text Property = "NESTED.</p> <p>LongProperty "size ="</p> <p>32 "/></p> <p>67 </ td></p> <p>68 </ tr></p> <p>69 <TR></p> <p>70 <TH Align = "Right"> StringProperty </ TH></p> <p>71 <TD Align = "Left"></p> <p>72 <HTML: Text Property = "StringProperty" Size = "</p> <p>32 "/></p> <p>73 </ td></p> <p>74 <TH Align = "Right"> NESTED.</p> <p>StringProperty </ th></p> <p>75 <TD align = "left"></p> <p>76 <HTML: Text Property = "NESTED.</p> <p>StringProperty "size ="</p> <p>32 "/></p> <p>77 </ td></p> <p>78 </ tr></p> <p>79 <TR></p> <p>80 <trh align = "center" colspan = "</p> <p>4 "> indexed</p> <p>Properties </ TH></p> <p>81 </ TR></p> <p>82 <TR></p> <p>83 <TH Align = "Right"> intIndexed</p> <p>[</p> <p>0</p> <p>] </ tH></p> <p>84 <TD align = "left"></p> <p>85 <html: Text Property = "INTINDEXED</p> <p>[</p> <p>0</p> <p>] "SIZE ="</p> <p>32 "/></p> <p>86 </ td></p> <p>87 <TH Align = "Right"> NESTED.</p> <p>Intindexed [</p> <p>0</p> <p>] </ tH></p> <p>88 <TD Align = "Left"></p> <p>89 <HTML: Text Property = "NESTED.</p> <p>Intindexed</p> <p>[</p> <p>0</p> <p>] "SIZE ="</p> <p>32 "/></p> <p>90 </ td></p> <p>91 </ TR></p> <p>92 <TR></p> <p>93 <TH Align = "Right"> intIndexed</p> <p>[</p> <p>1</p> <p>] </ tH></p> <p>94 <td align = "left"></p> <p>95 <html: Text Property = "INTINDEXED</p> <p>[</p> <p>1</p> <p>] "SIZE ="</p> <p>32 "/></p> <p>96 </ td></p> <p>97 <TH Align = "Right"> NESTED.</p> <p>Intindexed</p> <p>[</p> <p>1</p> <p>] </ tH></p> <p>98 <TD Align = "Left"></p> <p>99 <HTML: Text Property = "NESTED.</p> <p>Intindexed</p> <p>[</p> <p>1</p> <p>] "SIZE ="</p> <p>32 "/></p> <p>100 </ td></p> <p>101 </ tr></p> <p>102 <TR></p> <p>103 <TH Align = "Right"> StringIndexed</p> <p>[</p> <p>0</p> <p>] </ tH></p> <p>104 <TD Align = "Left"></p> <p>105 <HTML: Text Property = "StringIndexed</p> <p>[</p> <p>0</p> <p>] "SIZE ="</p> <p>32 "/></p> <p>106 </ td></p> <p>107 <TH Align = "Right"> NESTED.</p> <p>StringIndexed</p> <p>[</p> <p>0</p> <p>] </ tH></p> <p>108 <TD Align = "Left"></p> <p>109 <HTML: TEXT Property = "NESTED.</p> <p>StringIndexed</p> <p>[</p> <p>0</p> <p>] "SIZE ="</p> <p>32 "/></p> <p>110 </ td></p> <p>111 </ TR></p> <p>112 <TR></p> <p>113 <TH Align = "Right"> StringIndexed</p> <p>[</p> <p>1</p> <p>] </ tH></p> <p>114 <TD Align = "Left"></p> <p>115 <HTML: Text Property = "StringIndexed</p> <p>[</p> <p>1</p> <p>] "SIZE ="</p> <p>32 "/></p> <p>116 </ td></p> <p>117 <TH Align = "Right"> NESTED.STRINDEXED</p> <p>[</p> <p>1</p> <p>] </ tH></p> <p>118 <TD align = "left"></p> <p>119 <html: Text Property = "NESTED.</p> <p>StringIndexed</p> <p>[</p> <p>1</p> <p>] "SIZE ="</p> <p>32 "/></p> <p>120 </ td></p> <p>121 </ TR></p> <p>122 <TR></p> <p>123 <TD> </ TD></p> <p>124 <TD align = "Right"></p> <p>125 <html: Submit> Save </ html: submit></p> <p>126 </ td></p> <p>127 <TD align = "left"></p> <p>128 <HTML: Reset> Reset </ html: reset></p> <p>129 <HTML: Cancel> Cancel </ HTML: Cancel></p> <p>130 </ td></p> <p>131 <TD> </ TD></p> <p>132 </ tr></p> <p>133 </ TABLE></p> <p>134 </ html: form></p> <p>135 </ body></p> <p>136 </ html: html></p> <p>137</p> <p>138</p> <p>Corresponding TestBean</p> <p>Java code:</p> <p>1</p> <p>2</p> <p>/ * 3 * $ header: /Home/cvs/jakarta-struts/src/examples/org/apache/tests/webapp/exercise/testbean.java ,v 1.4 2004/03/14 06:23:52 SRAEBURN EXP $ 4 * $ Revision: 1.4 $ 5 * $ DATE: 2004/03/14 06:23:52 $ 6 * 7 * Copyright 1999-2004 The Apache Software Foundation. 8 * 9 * licensed Under The Apache License, Version 2.0 (The " "); 10 * You may not use this file exceptin compliance with the license. 11 * You may obtain a copy of the license at 12 * 13 * http://www.apache.org/licenses/license-2.0 14 * 15 * Unless required by applicable law or agreed to in writing, software 16 * distributed under the License is distributed on an "AS IS" BASIS, 17 * WITHOUT WARRANTIES oR CONDITIONS OF ANY KIND, either express or implied. 18 * See the License for the specific language governing permissions and 19 * limiteds under the license. 20 * / 21</p> <p>twenty two</p> <p>twenty three</p> <p>Package org.</p> <p>Apache.</p> <p>Struts.</p> <p>WebApp.</p> <p>EXERCISE;</p> <p>twenty four</p> <p>25</p> <p>26</p> <p>Import Java.</p> <p>Util.</p> <p>ArrayList;</p> <p>27</p> <p>Import Java.</p> <p>Util.</p> <p>COLLECTION;</p> <p>Twist</p> <p>Import Java.</p> <p>Util.</p> <p>Hashmap;</p> <p>29</p> <p>Import Java.</p> <p>Util.</p> <p>List;</p> <p>30</p> <p>Import Java.</p> <p>Util.</p> <p>Map;</p> <p>31</p> <p>Import Java.</p> <p>Util.</p> <p>Vector;</p> <p>32</p> <p>Import Javax.</p> <p>servlet.</p> <p>HTTP.</p> <p>HTTPSERVLETREQUEST;</p> <p>33</p> <p>Import org.</p> <p>Apache.</p> <p>Struts.</p> <p>Action.</p> <p>Actionform;</p> <p>34</p> <p>Import org.</p> <p>Apache.</p> <p>Struts.</p> <p>Action.</p> <p>Actionmapping;</p> <p>35</p> <p>Import org.</p> <p>Apache.</p> <p>Struts.</p> <p>Util.</p> <p>Labelvaluebean;</p> <p>36</p> <p>37</p> <p>38</p> <p>/ ** 39 * General Purpose Test Bean for struts Custom Tag Tests. 40 * 41 * @version $ Revision: 1.4 $ $ DATE: 2004/03/14 06:23:52 $ 42 * /</p> <p>43</p> <p>44</p> <p>public</p> <p>Class testbean</p> <p>Extends an actionform</p> <p>{</p> <p>...}</p> <p>45</p> <p>46</p> <p>47</p> <p>/ / -------------------------------------------------------------------------------------------- ------------- Properties</p> <p>48</p> <p>49</p> <p>50</p> <p>/ ** 51 * a Collection Property WHERE The Elements of the Collection Are 52 * of Type <code> LabelValueBean </ code>. 53 * /</p> <p>54</p> <p>Private</p> <p>Collection beancollection =</p> <p>NULL;</p> <p>55</p> <p>56</p> <p>public</p> <p>Collection GetBeancollection</p> <p>(</p> <p>)</p> <p>{</p> <p>...}</p> <p>57</p> <p>IF</p> <p>(beancollection ==</p> <p>NULL</p> <p>)</p> <p>{</p> <p>...}</p> <p>58</p> <p>Vector entries =</p> <p>New</p> <p>Vector</p> <p>(</p> <p>10</p> <p>);</p> <p>59</p> <p>60 entries.</p> <p>Add</p> <p>(</p> <p>New labelvaluebean</p> <p>("</p> <p>Label</p> <p>0 "," Value</p> <p>0 "</p> <p>)</p> <p>);</p> <p>61 Entries.</p> <p>Add</p> <p>(</p> <p>New labelvaluebean</p> <p>("</p> <p>Label</p> <p>1 "," Value</p> <p>1"</p> <p>)</p> <p>);</p> <p>.</p> <p>Add</p> <p>(</p> <p>New labelvaluebean</p> <p>("</p> <p>Label</p> <p>2 "," Value</p> <p>2"</p> <p>)</p> <p>);</p> <p>.</p> <p>Add</p> <p>(</p> <p>New labelvaluebean</p> <p>("</p> <p>Label</p> <p>3 "," Value</p> <p>3 "</p> <p>)</p> <p>);</p> <p>STRIES.</p> <p>Add</p> <p>(</p> <p>New labelvaluebean</p> <p>("</p> <p>Label</p> <p>4 "," Value</p> <p>4 "</p> <p>)</p> <p>);</p> <p>65 entries.</p> <p>Add</p> <p>(</p> <p>New labelvaluebean</p> <p>("</p> <p>Label</p> <p>5 "," Value</p> <p>5 "</p> <p>)</p> <p>);</p> <p>.</p> <p>Add</p> <p>(</p> <p>New labelvaluebean</p> <p>("</p> <p>Label</p> <p>6 "," Value</p> <p>6 "</p> <p>)</p> <p>);</p> <p>.</p> <p>Add</p> <p>(</p> <p>New labelvaluebean</p> <p>("</p> <p>Label</p> <p>7 "," Value</p> <p>7 "</p> <p>)</p> <p>);</p> <p>.</p> <p>Add</p> <p>(</p> <p>New labelvaluebean</p> <p>("</p> <p>Label</p> <p>8 "," Value</p> <p>8"</p> <p>)</p> <p>);</p> <p>.</p> <p>Add</p> <p>(</p> <p>New labelvaluebean</p> <p>("</p> <p>Label</p> <p>9 "," Value</p> <p>9"</p> <p>)</p> <p>);</p> <p>70</p> <p>7111;</p> <p>72</p> <p>}</p> <p>73</p> <p>74</p> <p>Return</p> <p>(Beancollection)</p> <p>);</p> <p>75</p> <p>}</p> <p>76</p> <p>77</p> <p>public</p> <p>Void setBeancollection</p> <p>(</p> <p>Collection Beancollection</p> <p>)</p> <p>{</p> <p>...}</p> <p>78 THIS.</p> <p>Beancollection = Beancollection;</p> <p>79</p> <p>}</p> <p>80</p> <p>81</p> <p>82</p> <p>/ ** 83 * a multiple-string select element useing a bean collection. 84 * / 85</p> <p>Private</p> <p>String</p> <p>[</p> <p>] beancollectionSelect =</p> <p>{"Value</p> <p>1 "," Value</p> <p>3 ",</p> <p>86 "Value</p> <p>5 "</p> <p>}</p> <p>87</p> <p>88</p> <p>public</p> <p>String</p> <p>[</p> <p>] GetBeancollectionSelect</p> <p>(</p> <p>)</p> <p>{</p> <p>...}</p> <p>89</p> <p>Return</p> <p>.</p> <p>BeancollectionSelect</p> <p>);</p> <p>90</p> <p>}</p> <p>91</p> <p>92</p> <p>public</p> <p>Void setBeancollectionSelect</p> <p>(</p> <p>String beancollectionSelect</p> <p>[</p> <p>]</p> <p>)</p> <p>{</p> <p>...}</p> <p>93 this.</p> <p>BeancollectionSelect = BeancollectionSelect;</p> <p>94</p> <p>}</p> <p>95</p> <p>96</p> <p>97</p> <p>/ ** 98 * a Boolean Property whose Initial value is true. 99 * /</p> <p>100</p> <p>Private</p> <p>Boolean booleanproperty =</p> <p>True;</p> <p>101</p> <p>102</p> <p>public</p> <p>Boolean getBooleanProperty</p> <p>(</p> <p>)</p> <p>{</p> <p>...}</p> <p>103</p> <p>Return</p> <p>(BooleanProperty</p> <p>);</p> <p>104</p> <p>}</p> <p>105</p> <p>106</p> <p>public</p> <p>Void setBooleanproperty</p> <p>(</p> <p>Boolean Booleanproperty</p> <p>)</p> <p>{</p> <p>...}</p> <p>THIS.</p> <p>Booleanproperty = BooleanProperty;</p> <p>108</p> <p>}</p> <p>109</p> <p>110</p> <p>111</p> <p>/ ** 112 * a multiple-string select element sale a collection. 113 * /</p> <p>114</p> <p>Private</p> <p>String</p> <p>[</p> <p>] CollectionSelect =</p> <p>{"Value</p> <p>2 "," Value</p> <p>4 ",</p> <p>115 "Value</p> <p>6 "</p> <p>}</p> <p>116</p> <p>117</p> <p>public</p> <p>String</p> <p>[</p> <p>] getCollectionSelect</p> <p>(</p> <p>)</p> <p>{</p> <p>...}</p> <p>118</p> <p>Return</p> <p>.</p> <p>Collectionselect</p> <p>);</p> <p>119</p> <p>}</p> <p>120</p> <p>121</p> <p>public</p> <p>Void setCollectionSelect</p> <p>(</p> <p>String CollectionSelect</p> <p>[</p> <p>]</p> <p>)</p> <p>{</p> <p>...}</p> <p>122.</p> <p>CollectionSelect = CollectionSelect;</p> <p>123</p> <p>}</p> <p>124</p> <p>125</p> <p>126</p> <p>/ ** 127 * a Double Property. 128 * /</p> <p>129</p> <p>Private</p> <p>Double DoubleProperty =</p> <p>321.</p> <p>0;</p> <p>130</p> <p>131</p> <p>public</p> <p>Double getDoubleproperty</p> <p>(</p> <p>)</p> <p>{</p> <p>...}</p> <p>132</p> <p>Return</p> <p>.</p> <p>DoubleProperty</p> <p>);</p> <p>133</p> <p>}</p> <p>134</p> <p>135</p> <p>public</p> <p>Void setDoubleproperty</p> <p>Double DoubleProperty</p> <p>)</p> <p>{</p> <p>...}</p> <p>136 this.</p> <p>DoubleProperty = doubleproperty;</p> <p>137</p> <p>}</p> <p>138</p> <p>139</p> <p>140</p> <p>/ ** 141 * a Boolean Property whose Initial value is false 142 * /</p> <p>143</p> <p>Private</p> <p>Boolean FalseProperty =</p> <p>False;</p> <p>144</p> <p>145</p> <p>public</p> <p>Boolean getfalseproperty</p> <p>(</p> <p>)</p> <p>{</p> <p>...}</p> <p>146</p> <p>Return</p> <p>(FalseProperty</p> <p>);</p> <p>147</p> <p>}</p> <p>148</p> <p>149</p> <p>public</p> <p>Void setfalseproperty</p> <p>(</p> <p>Boolean FalseProperty</p> <p>)</p> <p>{</p> <p>...}</p> <p>150 this.</p> <p>FalseProperty = falseproperty;</p> <p>151</p> <p>}</p> <p>152</p> <p>153</p> <p>154</p> <p>/ ** 155 * a float proty. 156 * /</p> <p>157</p> <p>Private float floatproperty =</p> <p>(Float)</p> <p>)</p> <p>123.</p> <p>0;</p> <p>158</p> <p>159</p> <p>Public Float getFloatProperty</p> <p>(</p> <p>)</p> <p>{</p> <p>...}</p> <p>160</p> <p>Return</p> <p>.</p> <p>FloatProperty</p> <p>);</p> <p>161</p> <p>}</p> <p>162</p> <p>163</p> <p>public</p> <p>Void setFloatProperty</p> <p>(Float FloatProperty</p> <p>)</p> <p>{</p> <p>...}</p> <p>THIS.</p> <p>FLOATPROPERTY = floatproperty;</p> <p>165</p> <p>}</p> <p>166</p> <p>167</p> <p>168</p> <p>/ ** 169 * Integer Arrays That Are Accessed as an Array As Well as Indexed. 170 * /</p> <p>171</p> <p>Private</p> <p>Int IntaRray</p> <p>[</p> <p>] =</p> <p>{</p> <p>0,</p> <p>10,</p> <p>20,</p> <p>30,</p> <p>40</p> <p>}</p> <p>172</p> <p>173</p> <p>public</p> <p>int</p> <p>[</p> <p>] GetInTarray</p> <p>(</p> <p>)</p> <p>{</p> <p>...}</p> <p>174</p> <p>Return</p> <p>.</p> <p>IntaRray</p> <p>);</p> <p>175</p> <p>}</p> <p>176</p> <p>177</p> <p>public</p> <p>Void SetInTarray</p> <p>(</p> <p>Int IntaRray</p> <p>[</p> <p>]</p> <p>)</p> <p>{</p> <p>...}</p> <p>178 this.</p> <p>INTARRAY = INTARRAY;</p> <p>179</p> <p>}</p> <p>180</p> <p>181</p> <p>Private</p> <p>Int intindexed</p> <p>[</p> <p>] =</p> <p>{</p> <p>0,</p> <p>10,</p> <p>20,</p> <p>30,</p> <p>40</p> <p>}</p> <p>182</p> <p>183</p> <p>public</p> <p>Int getIntIndexed</p> <p>(</p> <p>Int index</p> <p>)</p> <p>{</p> <p>...}</p> <p>184</p> <p>Return</p> <p>(intIndexed)</p> <p>[index</p> <p>]</p> <p>);</p> <p>185</p> <p>}</p> <p>186</p> <p>187</p> <p>public</p> <p>Void setInTindexed</p> <p>(</p> <p>Int index,</p> <p>Int Value</p> <p>)</p> <p>{</p> <p>...}</p> <p>188 INTINDEXED</p> <p>[index</p> <p>] = Value;</p> <p>189</p> <p>}</p> <p>190</p> <p>191</p> <p>192</p> <p>Private</p> <p>Int IntMultiBox</p> <p>[</p> <p>] =</p> <p>New</p> <p>int</p> <p>[</p> <p>0</p> <p>];</p> <p>193</p> <p>194</p> <p>public</p> <p>int</p> <p>[</p> <p>] GetInTmultiBox</p> <p>(</p> <p>)</p> <p>{</p> <p>...}</p> <p>195</p> <p>Return</p> <p>(this.IntMultiBox</p> <p>);</p> <p>196</p> <p>}</p> <p>197</p> <p>198</p> <p>public</p> <p>Void setInTmultiBox</p> <p>(</p> <p>Int IntMultiBox</p> <p>[</p> <p>]</p> <p>)</p> <p>{</p> <p>...}</p> <p>199 THIS.</p> <p>INTMULTIBOX = INTMULTIBOX;</p> <p>200</p> <p>}</p> <p>201</p> <p>202</p> <p>/ ** 203 * an in turner property. 204 * /</p> <p>205</p> <p>Private</p> <p>INT INTPROPERTY =</p> <p>123;</p> <p>206</p> <p>207</p> <p>public</p> <p>Int getIntproperty</p> <p>(</p> <p>)</p> <p>{</p> <p>...}</p> <p>208</p> <p>Return</p> <p>.</p> <p>INTPROPERTY</p> <p>);</p> <p>209</p> <p>}</p> <p>210</p> <p>211</p> <p>public</p> <p>Void setInTproperty</p> <p>(</p> <p>Int Intproperty</p> <p>)</p> <p>{</p> <p>...}</p> <p>THIS.</p> <p>INTPROPERTY = INTPROPERTY;</p> <p>213</p> <p>}</p> <p>214</p> <p>215</p> <p>216</p> <p>/ ** 217 * a long proty. 218 * /</p> <p>219</p> <p>PRIVATE long longproperty =</p> <p>321;</p> <p>220</p> <p>221</p> <p>Public Long GetlongProperty</p> <p>(</p> <p>)</p> <p>{</p> <p>...}</p> <p>222</p> <p>Return</p> <p>.</p> <p>Longproperty</p> <p>);</p> <p>223</p> <p>}</p> <p>224</p> <p>225</p> <p>public</p> <p>Void setlongproperty</p> <p>(long longproperty)</p> <p>)</p> <p>{</p> <p>...}</p> <p>THIS.</p> <p>Longproperty = longproperty;</p> <p>227</p> <p>}</p> <p>228</p> <p>229</p> <p>230</p> <p>/ ** 231 * a multiple-string select element. 232 * /</p> <p>233</p> <p>Private</p> <p>String</p> <p>[</p> <p>] Multipleselect =</p> <p>{"Multiple</p> <p>3 "," Multiple</p> <p>5 ",</p> <p>234 "Multiple</p> <p>7 "</p> <p>}</p> <p>235</p> <p>236</p> <p>public</p> <p>String</p> <p>[</p> <p>] getMultiPleselect</p> <p>(</p> <p>)</p> <p>{</p> <p>...}</p> <p>237</p> <p>Return</p> <p>.</p> <p>MultiPleSelect</p> <p>);</p> <p>238</p> <p>}</p> <p>239</p> <p>240</p> <p>public</p> <p>Void setMultiPleselect</p> <p>(</p> <p>String Multipleselect</p> <p>[</p> <p>]</p> <p>)</p> <p>{</p> <p>...}</p> <p>THIS.</p> <p>Multipleselect = MultipleElectr;</p> <p>242</p> <p>}</p> <p>243</p> <p>244</p> <p>245</p> <p>/ ** 246 * a Nested Reference to another test bean (populate as needed). 247 * /</p> <p>248</p> <p>Private TestBean Nested =</p> <p>NULL;</p> <p>249</p> <p>250</p> <p>Public TestBean GetNested</p> <p>(</p> <p>)</p> <p>{</p> <p>...}</p> <p>251</p> <p>IF</p> <p>(nested ==</p> <p>NULL</p> <p>)</p> <p>252 nested =</p> <p>New TestBean</p> <p>(</p> <p>);</p> <p>253</p> <p>Return</p> <p>(Nested)</p> <p>);</p> <p>254</p> <p>}</p> <p>255</p> <p>256</p> <p>257</p> <p>/ ** 258 * a String Property with an initial value of null. 259 * / 260</p> <p>Private</p> <p>String nullproperty =</p> <p>NULL;</p> <p>261</p> <p>262</p> <p>public</p> <p>String getnullproperty</p> <p>(</p> <p>)</p> <p>{</p> <p>...}</p> <p>263</p> <p>Return</p> <p>.</p> <p>NullProperty</p> <p>);</p> <p>264</p> <p>}</p> <p>265</p> <p>266</p> <p>public</p> <p>Void SetNullProperty</p> <p>(</p> <p>String Nullproperty</p> <p>)</p> <p>{</p> <p>...}</p> <p>267 this.</p> <p>nullproperty = nullproperty;</p> <p>268</p> <p>}</p> <p>269</p> <p>270</p> <p>271</p> <p>/ ** 272 * a short property. 273 * /</p> <p>274</p> <p>Private Short shortproperty =</p> <p>(Short)</p> <p>)</p> <p>987;</p> <p>275</p> <p>276</p> <p>Public Short GetshortProperty</p> <p>(</p> <p>)</p> <p>{</p> <p>...}</p> <p>277</p> <p>Return</p> <p>.</p> <p>Shortproperty</p> <p>);</p> <p>278</p> <p>}</p> <p>279</p> <p>280</p> <p>public</p> <p>Void setshortproperty</p> <p>(Short shortproperty</p> <p>)</p> <p>{</p> <p>...}</p> <p>THIS.</p> <p>Shortproperty = shortproperty;</p> <p>282</p> <p>}</p> <p>283</p> <p>284</p> <p>285</p> <p>/ ** 286 * a Single-string value for a select element. 287 * /</p> <p>288</p> <p>Private</p> <p>STRING SINGLESELECT = "SINGLE</p> <p>5 ";</p> <p>289</p> <p>290</p> <p>public</p> <p>String getsingleselect</p> <p>(</p> <p>)</p> <p>{</p> <p>...}</p> <p>291</p> <p>Return</p> <p>.</p> <p>Singleselect</p> <p>);</p> <p>292</p> <p>}</p> <p>293</p> <p>294</p> <p>public</p> <p>Void setsingleselect</p> <p>(</p> <p>String SingleselectElectr</p> <p>)</p> <p>{</p> <p>...}</p> <p>THIS.</p> <p>SINGLESELECT = SINGLESELECT;</p> <p>296</p> <p>}</p> <p>297</p> <p>298</p> <p>299</p> <p>/ ** 300 * String Arrays That Are Accessed as an Array As Well as Indexed. 301 * /</p> <p>302</p> <p>Private</p> <p>String StringArray</p> <p>[</p> <p>] =</p> <p>303</p> <p>{"</p> <p>String</p> <p>0 ","</p> <p>String</p> <p>1", "</p> <p>String</p> <p>2", "</p> <p>String</p> <p>3 ","</p> <p>String</p> <p>4 "</p> <p>}</p> <p>304</p> <p>305</p> <p>public</p> <p>String</p> <p>[</p> <p>] GetStringArray</p> <p>(</p> <p>)</p> <p>{</p> <p>...}</p> <p>306</p> <p>Return</p> <p>.</p> <p>StringArray</p> <p>);</p> <p>307</p> <p>}</p> <p>308</p> <p>309</p> <p>public</p> <p>Void setStringArray</p> <p>(</p> <p>String StringArray</p> <p>[</p> <p>]</p> <p>)</p> <p>{</p> <p>...}</p> <p>310 THIS.</p> <p>StringArray = StringArray;</p> <p>311</p> <p>}</p> <p>312</p> <p>313</p> <p>Private</p> <p>String stringIndexed</p> <p>[</p> <p>] =</p> <p>314</p> <p>{"</p> <p>String</p> <p>0 ","</p> <p>String</p> <p>1 "," String</p> <p>2", "</p> <p>String</p> <p>3 ","</p> <p>String</p> <p>4 "</p> <p>}</p> <p>315</p> <p>316</p> <p>public</p> <p>String getStringIndexed</p> <p>(</p> <p>Int index</p> <p>)</p> <p>{</p> <p>...}</p> <p>317</p> <p>Return</p> <p>(StringIndexed)</p> <p>[index</p> <p>]</p> <p>);</p> <p>318</p> <p>}</p> <p>319</p> <p>320</p> <p>public</p> <p>Void setStringIndexed</p> <p>(</p> <p>Int index,</p> <p>String Value</p> <p>)</p> <p>{</p> <p>...}</p> <p>321 StringIndexed</p> <p>[index</p> <p>] = Value;</p> <p>322</p> <p>}</p> <p>323</p> <p>324</p> <p>325</p> <p>Private</p> <p>String StringMultiBox</p> <p>[</p> <p>] =</p> <p>New</p> <p>String</p> <p>[</p> <p>0</p> <p>];</p> <p>326</p> <p>327</p> <p>public</p> <p>String</p> <p>[</p> <p>] GetStringMultiBox</p> <p>(</p> <p>)</p> <p>{</p> <p>...}</p> <p>328</p> <p>Return</p> <p>.</p> <p>StringMultiBox</p> <p>);</p> <p>329</p> <p>}</p> <p>330</p> <p>331</p> <p>public</p> <p>Void SetStringMultiBox</p> <p>(</p> <p>String StringMultiBox</p> <p>[</p> <p>]</p> <p>)</p> <p>{</p> <p>...}</p> <p>332 this.</p> <p>Stringmultibox = stringmultibox;</p> <p>333</p> <p>}</p> <p>334</p> <p>335</p> <p>/ ** 336 * a string property. 337 * /</p> <p>338</p> <p>Private</p> <p>String StringProperty = "this is a string";</p> <p>339</p> <p>340</p> <p>public</p> <p>String GetStringProperty</p> <p>(</p> <p>)</p> <p>{</p> <p>...}</p> <p>341</p> <p>Return</p> <p>.</p> <p>StringProperty</p> <p>);</p> <p>342</p> <p>}</p> <p>343</p> <p>344</p> <p>public</p> <p>Void setStringProperty</p> <p>(</p> <p>String StringProperty</p> <p>)</p> <p>{</p> <p>...}</p> <p>345 this.</p> <p>StringProperty = StringProperty;</p> <p>346</p> <p>}</p> <p>347</p> <p>348</p> <p>/ ** 349 * an Empty string property. 350 * /</p> <p>351</p> <p>Private</p> <p>String emptystringproperty = "";</p> <p>352</p> <p>353</p> <p>public</p> <p>String getEmptystringProperty</p> <p>(</p> <p>)</p> <p>{</p> <p>...}</p> <p>354</p> <p>Return</p> <p>.</p> <p>EMPTYSTRINGPROPERTY</p> <p>);</p> <p>355</p> <p>}</p> <p>356</p> <p>357</p> <p>public</p> <p>Void SeteemptystringProperty</p> <p>(</p> <p>String EmptyStringProperty</p> <p>)</p> <p>{</p> <p>...}</p> <p>358 this.</p> <p>EmptystringProperty = EmptystringProperty;</p> <p>359</p> <p>}</p> <p>360</p> <p>361</p> <p>362</p> <p>/ ** 363 * a SINGLE-STRING VALUE for a Select Element Based on Resource Strings. 364 * /</p> <p>365</p> <p>Private</p> <p>String resourceesselect = "resources</p> <p>2";</p> <p>366</p> <p>367</p> <p>public</p> <p>String getResourcesSselectelect</p> <p>(</p> <p>)</p> <p>{</p> <p>...}</p> <p>368</p> <p>Return</p> <p>.</p> <p>ResourcesSselect);</p> <p>369</p> <p>}</p> <p>370</p> <p>371</p> <p>public</p> <p>Void setResourcesSselectelect</p> <p>(</p> <p>String ResourcesSselectElect</p> <p>)</p> <p>{</p> <p>...}</p> <p>THIS.</p> <p>Resourcesselect = resource;</p> <p>373</p> <p>}</p> <p>374</p> <p>375</p> <p>376</p> <p>/ ** 377 * a Property That Allows a Null Value But is stock used in a select. 378 * /</p> <p>379</p> <p>Private</p> <p>String withnulls =</p> <p>NULL;</p> <p>380</p> <p>381</p> <p>public</p> <p>String getwithnulls</p> <p>(</p> <p>)</p> <p>{</p> <p>...}</p> <p>382</p> <p>Return</p> <p>.</p> <p>Withnulls</p> <p>);</p> <p>383</p> <p>}</p> <p>384</p> <p>385</p> <p>public</p> <p>Void setwithnulls</p> <p>(</p> <p>String withnulls</p> <p>)</p> <p>{</p> <p>...}</p> <p>386 this.</p> <p>Withnulls = WithnUlls;</p> <p>387</p> <p>}</p> <p>388</p> <p>389</p> <p>390</p> <p>/ ** 391 * a List property. 392 * /</p> <p>393</p> <p>Private</p> <p>List ListProperty =</p> <p>NULL;</p> <p>394</p> <p>395</p> <p>public</p> <p>List getListProperty</p> <p>(</p> <p>)</p> <p>{</p> <p>...}</p> <p>396</p> <p>IF</p> <p>(ListProperty ==</p> <p>NULL</p> <p>)</p> <p>{</p> <p>...}</p> <p>397 ListProperty =</p> <p>New</p> <p>ArrayList</p> <p>(</p> <p>);</p> <p>398 ListProperty.</p> <p>Add</p> <p>("Dummy"</p> <p>);</p> <p>399</p> <p>}</p> <p>400</p> <p>Return ListProperty;</p> <p>401</p> <p>}</p> <p>402</p> <p>403</p> <p>public</p> <p>Void setListProperty</p> <p>(</p> <p>List ListProperty</p> <p>)</p> <p>{</p> <p>...}</p> <p>404 this.</p> <p>ListProperty = listproperty;</p> <p>405</p> <p>}</p> <p>406</p> <p>407</p> <p>/ ** 408 * an Empty List Property. 409 * /</p> <p>410</p> <p>Private</p> <p>List emptyListproperty =</p> <p>NULL;</p> <p>411</p> <p>412</p> <p>public</p> <p>List getemptylistproperty</p> <p>(</p> <p>)</p> <p>{</p> <p>...}</p> <p>413</p> <p>IF</p> <p>(EmptyListProperty ==</p> <p>NULL</p> <p>)</p> <p>{</p> <p>...}</p> <p>414 EMPTYLISTPROPERTY =</p> <p>New</p> <p>ArrayList</p> <p>(</p> <p>);</p> <p>415</p> <p>}</p> <p>416</p> <p>Return EmptyListProperty;</p> <p>417</p> <p>}</p> <p>418</p> <p>419</p> <p>public</p> <p>Void setEmptyListProperty</p> <p>(</p> <p>List EmptyListProperty</p> <p>)</p> <p>{</p> <p>...}</p> <p>420 this.</p> <p>EmptyListProperty = EmptyListProperty;</p> <p>421</p> <p>}</p> <p>422</p> <p>423</p> <p>424</p> <p>/ ** 425 * a Map property. 426 * /</p> <p>427</p> <p>Private</p> <p>Map mapproperty =</p> <p>NULL;</p> <p>428</p> <p>429</p> <p>public</p> <p>Map getMAPPROPERTY</p> <p>(</p> <p>)</p> <p>{</p> <p>...}</p> <p>430</p> <p>IF</p> <p>(mapproperty == NULL</p> <p>)</p> <p>{</p> <p>...}</p> <p>431 mapproperty =</p> <p>New</p> <p>Hashmap</p> <p>(</p> <p>);</p> <p>432 MAPPROPERTY.</p> <p>PUT</p> <p>("Dummy", "DUMMY"</p> <p>);</p> <p>433</p> <p>}</p> <p>434</p> <p>Return mapproperty;</p> <p>435</p> <p>}</p> <p>436</p> <p>437</p> <p>public</p> <p>Void SetMApproperty</p> <p>(</p> <p>Map mapproperty</p> <p>)</p> <p>{</p> <p>...}</p> <p>438 this.</p> <p>MAPPROPERTY = MAPPROPERTY;</p> <p>439</p> <p>}</p> <p>440</p> <p>441</p> <p>/ ** 442 * an Empty map Property. 443 * /</p> <p>444</p> <p>Private</p> <p>Map EmptyMApproperty =</p> <p>NULL;</p> <p>445</p> <p>446</p> <p>public</p> <p>Map getemptymappproperty</p> <p>(</p> <p>)</p> <p>{</p> <p>...}</p> <p>447</p> <p>IF</p> <p>(EmptyMApproperty ==</p> <p>NULL</p> <p>)</p> <p>{</p> <p>...}</p> <p>448 EMPTYMAPPROPERTY =</p> <p>New</p> <p>Hashmap</p> <p>(</p> <p>);</p> <p>449</p> <p>}</p> <p>450</p> <p>Return EmptyMapproperty;</p> <p>451</p> <p>}</p> <p>452</p> <p>453</p> <p>public</p> <p>Void setemptyMApproperty</p> <p>(</p> <p>Map EmptyMApproperty</p> <p>)</p> <p>{</p> <p>...}</p> <p>THIS.</p> <p>EmptyMappproperty = EmptyMappProperty;</p> <p>455</p> <p>}</p> <p>456</p> <p>457</p> <p>458</p> <p>/ / -------------------------------------------------------------------------------------------- --------- Public Methods</p> <p>459</p> <p>460</p> <p>461</p> <p>/ ** 462 * RESET The Properties That Will Be Received As Input. 463 * /</p> <p>464</p> <p>public</p> <p>Void RESET</p> <p>(ActionMapping Mapping, HttpServletRequest Request</p> <p>)</p> <p>{</p> <p>...}</p> <p>465</p> <p>466 BooleanProperty =</p> <p>False;</p> <p>467 CollectionSelect =</p> <p>New</p> <p>String</p> <p>[</p> <p>0</p> <p>];</p> <p>468 INTMULTIBOX =</p> <p>New</p> <p>int</p> <p>[</p> <p>0</p> <p>];</p> <p>469 MULTIPLESELECT =</p> <p>New</p> <p>String</p> <p>[</p> <p>0</p> <p>];</p> <p>470 stringmultiBox =</p> <p>New</p> <p>String</p> <p>[</p> <p>0</p> <p>];</p> <p>471</p> <p>IF</p> <p>(Nested! =</p> <p>NULL</p> <p>)</p> <p>472 nested.</p> <p>RESET</p> <p>(Mapping, REQUEST</p> <p>);</p> <p>473</p> <p>474</p> <p>}</p> <p>475</p> <p>476</p> <p>477</p> <p>}</p> <p>478</p></div><div class="text-center mt-3 text-grey"> 转载请注明原文地址:https://www.9cbs.com/read-113260.html</div><div class="plugin d-flex justify-content-center mt-3"></div><hr><div class="row"><div class="col-lg-12 text-muted mt-2"><i class="icon-tags mr-2"></i><span class="badge border border-secondary mr-2"><h2 class="h6 mb-0 small"><a class="text-secondary" href="tag-2.html">9cbs</a></h2></span></div></div></div></div><div class="card card-postlist border-white shadow"><div class="card-body"><div class="card-title"><div class="d-flex justify-content-between"><div><b>New Post</b>(<span class="posts">0</span>) </div><div></div></div></div><ul class="postlist list-unstyled"> </ul></div></div><div class="d-none threadlist"><input type="checkbox" name="modtid" value="113260" checked /></div></div></div></div></div><footer class="text-muted small bg-dark py-4 mt-3" id="footer"><div class="container"><div class="row"><div class="col">CopyRight © 2020 All Rights Reserved </div><div class="col text-right">Processed: <b>0.041</b>, SQL: <b>9</b></div></div></div></footer><script src="./lang/en-us/lang.js?2.2.0"></script><script src="view/js/jquery.min.js?2.2.0"></script><script src="view/js/popper.min.js?2.2.0"></script><script src="view/js/bootstrap.min.js?2.2.0"></script><script src="view/js/xiuno.js?2.2.0"></script><script src="view/js/bootstrap-plugin.js?2.2.0"></script><script src="view/js/async.min.js?2.2.0"></script><script src="view/js/form.js?2.2.0"></script><script> var debug = DEBUG = 0; var url_rewrite_on = 1; var url_path = './'; var forumarr = {"1":"Tech"}; var fid = 1; var uid = 0; var gid = 0; xn.options.water_image_url = 'view/img/water-small.png'; </script><script src="view/js/wellcms.js?2.2.0"></script><a class="scroll-to-top rounded" href="javascript:void(0);"><i class="icon-angle-up"></i></a><a class="scroll-to-bottom rounded" href="javascript:void(0);" style="display: inline;"><i class="icon-angle-down"></i></a></body></html><script> var forum_url = 'list-1.html'; var safe_token = 'AuDMHpP3oAdIsASXeeT73A81F35891BeiMZmMrqvyIdHYJHzWshIzcM9a7xyGSU_2FPeqKY_2BhEWu5tTZ9w3wGRNQ_3D_3D'; var body = $('body'); body.on('submit', '#form', function() { var jthis = $(this); var jsubmit = jthis.find('#submit'); jthis.reset(); jsubmit.button('loading'); var postdata = jthis.serializeObject(); $.xpost(jthis.attr('action'), postdata, function(code, message) { if(code == 0) { location.reload(); } else { $.alert(message); jsubmit.button('reset'); } }); return false; }); function resize_image() { var jmessagelist = $('div.message'); var first_width = jmessagelist.width(); jmessagelist.each(function() { var jdiv = $(this); var maxwidth = jdiv.attr('isfirst') ? first_width : jdiv.width(); var jmessage_width = Math.min(jdiv.width(), maxwidth); jdiv.find('img, embed, iframe, video').each(function() { var jimg = $(this); var img_width = this.org_width; var img_height = this.org_height; if(!img_width) { var img_width = jimg.attr('width'); var img_height = jimg.attr('height'); this.org_width = img_width; this.org_height = img_height; } if(img_width > jmessage_width) { if(this.tagName == 'IMG') { jimg.width(jmessage_width); jimg.css('height', 'auto'); jimg.css('cursor', 'pointer'); jimg.on('click', function() { }); } else { jimg.width(jmessage_width); var height = (img_height / img_width) * jimg.width(); jimg.height(height); } } }); }); } function resize_table() { $('div.message').each(function() { var jdiv = $(this); jdiv.find('table').addClass('table').wrap('<div class="table-responsive"></div>'); }); } $(function() { resize_image(); resize_table(); $(window).on('resize', resize_image); }); var jmessage = $('#message'); jmessage.on('focus', function() {if(jmessage.t) { clearTimeout(jmessage.t); jmessage.t = null; } jmessage.css('height', '6rem'); }); jmessage.on('blur', function() {jmessage.t = setTimeout(function() { jmessage.css('height', '2.5rem');}, 1000); }); $('#nav li[data-active="fid-1"]').addClass('active'); </script>