01: /**
02: * Copyright 2006 Webmedia Group Ltd.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: **/package org.araneaframework.jsp.tag.uilib.form.element.text;
16:
17: import java.io.Writer;
18: import java.util.HashMap;
19: import java.util.Map;
20: import org.araneaframework.uilib.form.control.TextControl;
21:
22: /**
23: * Standard password input form element tag.
24: *
25: * @author Oleg Mürk
26: *
27: * @jsp.tag
28: * name = "passwordInput"
29: * body-content = "JSP"
30: * description = "Form password input field, represents UiLib "TextControl"."
31: */
32: public class FormPasswordInputHtmlTag extends BaseFormTextInputHtmlTag {
33: protected int doEndTag(Writer out) throws Exception {
34: // Type check
35: assertControlType("TextControl");
36:
37: TextControl.ViewModel viewModel = ((TextControl.ViewModel) controlViewModel);
38:
39: // Write
40: Map attributes = new HashMap();
41: attributes.put("maxLength", viewModel.getMaxLength());
42: writeTextInput(out, "password", false, attributes);
43:
44: // Continue
45: super.doEndTag(out);
46: return EVAL_PAGE;
47: }
48: }
|