Lines 3-9
Link Here
|
3 |
* |
3 |
* |
4 |
* The Apache Software License, Version 1.1 |
4 |
* The Apache Software License, Version 1.1 |
5 |
* |
5 |
* |
6 |
* Copyright (c) 1999 The Apache Software Foundation. All rights |
6 |
* Copyright (c) 1999 The Apache Software Foundation. All rights |
7 |
* reserved. |
7 |
* reserved. |
8 |
* |
8 |
* |
9 |
* Redistribution and use in source and binary forms, with or without |
9 |
* Redistribution and use in source and binary forms, with or without |
Lines 11-17
Link Here
|
11 |
* are met: |
11 |
* are met: |
12 |
* |
12 |
* |
13 |
* 1. Redistributions of source code must retain the above copyright |
13 |
* 1. Redistributions of source code must retain the above copyright |
14 |
* notice, this list of conditions and the following disclaimer. |
14 |
* notice, this list of conditions and the following disclaimer. |
15 |
* |
15 |
* |
16 |
* 2. Redistributions in binary form must reproduce the above copyright |
16 |
* 2. Redistributions in binary form must reproduce the above copyright |
17 |
* notice, this list of conditions and the following disclaimer in |
17 |
* notice, this list of conditions and the following disclaimer in |
Lines 19-33
Link Here
|
19 |
* distribution. |
19 |
* distribution. |
20 |
* |
20 |
* |
21 |
* 3. The end-user documentation included with the redistribution, if |
21 |
* 3. The end-user documentation included with the redistribution, if |
22 |
* any, must include the following acknowlegement: |
22 |
* any, must include the following acknowlegement: |
23 |
* "This product includes software developed by the |
23 |
* "This product includes software developed by the |
24 |
* Apache Software Foundation (http://www.apache.org/)." |
24 |
* Apache Software Foundation (http://www.apache.org/)." |
25 |
* Alternately, this acknowlegement may appear in the software itself, |
25 |
* Alternately, this acknowlegement may appear in the software itself, |
26 |
* if and wherever such third-party acknowlegements normally appear. |
26 |
* if and wherever such third-party acknowlegements normally appear. |
27 |
* |
27 |
* |
28 |
* 4. The names "The Jakarta Project", "Tomcat", and "Apache Software |
28 |
* 4. The names "The Jakarta Project", "Tomcat", and "Apache Software |
29 |
* Foundation" must not be used to endorse or promote products derived |
29 |
* Foundation" must not be used to endorse or promote products derived |
30 |
* from this software without prior written permission. For written |
30 |
* from this software without prior written permission. For written |
31 |
* permission, please contact apache@apache.org. |
31 |
* permission, please contact apache@apache.org. |
32 |
* |
32 |
* |
33 |
* 5. Products derived from this software may not be called "Apache" |
33 |
* 5. Products derived from this software may not be called "Apache" |
Lines 53-59
Link Here
|
53 |
* information on the Apache Software Foundation, please see |
53 |
* information on the Apache Software Foundation, please see |
54 |
* <http://www.apache.org/>. |
54 |
* <http://www.apache.org/>. |
55 |
* |
55 |
* |
56 |
*/ |
56 |
*/ |
57 |
package org.apache.taglibs.input; |
57 |
package org.apache.taglibs.input; |
58 |
|
58 |
|
59 |
import java.util.*; |
59 |
import java.util.*; |
Lines 102-110
Link Here
|
102 |
*/ |
102 |
*/ |
103 |
|
103 |
|
104 |
HashMap chosen = getChosen(); |
104 |
HashMap chosen = getChosen(); |
105 |
|
105 |
|
106 |
if ( value != null && chosen != null && chosen.containsKey( value ) ) { |
106 |
if ( value != null && chosen != null && chosen.containsKey( value ) ) { |
107 |
out.print( "selected=\"true\" " ); |
107 |
out.print( "selected=\"selected\" " ); |
108 |
} |
108 |
} |
109 |
|
109 |
|
110 |
// end the starting tag |
110 |
// end the starting tag |
Lines 115-121
Link Here
|
115 |
} |
115 |
} |
116 |
return EVAL_BODY_INCLUDE; |
116 |
return EVAL_BODY_INCLUDE; |
117 |
} |
117 |
} |
118 |
|
118 |
|
119 |
public int doEndTag() throws JspException { |
119 |
public int doEndTag() throws JspException { |
120 |
try { |
120 |
try { |
121 |
JspWriter out = pageContext.getOut(); |
121 |
JspWriter out = pageContext.getOut(); |
Lines 125-131
Link Here
|
125 |
throw new JspTagException(ex.getMessage()); |
125 |
throw new JspTagException(ex.getMessage()); |
126 |
} |
126 |
} |
127 |
} |
127 |
} |
128 |
|
128 |
|
129 |
protected HashMap getChosen() throws JspException { |
129 |
protected HashMap getChosen() throws JspException { |
130 |
Select selectTag = (Select) findAncestorWithClass( this, Select.class ); |
130 |
Select selectTag = (Select) findAncestorWithClass( this, Select.class ); |
131 |
if ( selectTag != null ) { |
131 |
if ( selectTag != null ) { |
Lines 139-145
Link Here
|
139 |
public void setValue(String x) { |
139 |
public void setValue(String x) { |
140 |
value = x; |
140 |
value = x; |
141 |
} |
141 |
} |
142 |
|
142 |
|
143 |
/** Getter for property value. |
143 |
/** Getter for property value. |
144 |
* @return Value of property value. |
144 |
* @return Value of property value. |
145 |
*/ |
145 |
*/ |
Lines 148-166
Link Here
|
148 |
public void setAttributes(Map x) { |
148 |
public void setAttributes(Map x) { |
149 |
attributes = x; |
149 |
attributes = x; |
150 |
} |
150 |
} |
151 |
|
151 |
|
152 |
/** Getter for property attributes. |
152 |
/** Getter for property attributes. |
153 |
* @return Value of property attributes. |
153 |
* @return Value of property attributes. |
154 |
*/ |
154 |
*/ |
155 |
public Map getAttributes() { return attributes; } |
155 |
public Map getAttributes() { return attributes; } |
156 |
|
156 |
|
157 |
public void setAttributesText( String x ) { |
157 |
public void setAttributesText( String x ) { |
158 |
attributesText = x; |
158 |
attributesText = x; |
159 |
} |
159 |
} |
160 |
|
160 |
|
161 |
/** Getter for property attributesText. |
161 |
/** Getter for property attributesText. |
162 |
* @return Value of property attributesText. |
162 |
* @return Value of property attributesText. |
163 |
*/ |
163 |
*/ |
164 |
public String getAttributesText() { return attributesText; } |
164 |
public String getAttributesText() { return attributesText; } |
165 |
|
165 |
|
166 |
} |
166 |
} |