01: /*
02: * Copyright (c) 2002-2003 by OpenSymphony
03: * All rights reserved.
04: */
05: package com.opensymphony.webwork.views.jsp.ui;
06:
07: import com.opensymphony.webwork.components.Component;
08: import com.opensymphony.webwork.components.TextField;
09: import com.opensymphony.xwork.util.OgnlValueStack;
10:
11: import javax.servlet.http.HttpServletRequest;
12: import javax.servlet.http.HttpServletResponse;
13:
14: /**
15: * @see TextField
16: */
17: public class TextFieldTag extends AbstractUITag {
18: protected String maxlength;
19: protected String readonly;
20: protected String size;
21:
22: public Component getBean(OgnlValueStack stack,
23: HttpServletRequest req, HttpServletResponse res) {
24: return new TextField(stack, req, res);
25: }
26:
27: protected void populateParams() {
28: super .populateParams();
29:
30: TextField textField = ((TextField) component);
31: textField.setMaxlength(maxlength);
32: textField.setReadonly(readonly);
33: textField.setSize(size);
34: }
35:
36: /**
37: * @deprecated please use {@link #setMaxlength} instead
38: */
39: public void setMaxLength(String maxlength) {
40: this .maxlength = maxlength;
41: }
42:
43: public void setMaxlength(String maxlength) {
44: this .maxlength = maxlength;
45: }
46:
47: public void setReadonly(String readonly) {
48: this .readonly = readonly;
49: }
50:
51: public void setSize(String size) {
52: this.size = size;
53: }
54: }
|