KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > inversoft > verge > mvc > view > jsp > form > ImageTag


1 /*
2  * Copyright (c) 2003, Inversoft
3  *
4  * This software is distribuable under the GNU Lesser General Public License.
5  * For more information visit gnu.org.
6  */

7 package com.inversoft.verge.mvc.view.jsp.form;
8
9
10 import javax.servlet.jsp.JspException JavaDoc;
11
12 import org.apache.log4j.Logger;
13
14 import com.inversoft.verge.mvc.controller.form.config.ActionConfig;
15
16
17 /**
18  * This class is the image submit input tag
19  *
20  * @author Brian Pontarelli
21  */

22 public class ImageTag extends com.inversoft.verge.mvc.view.jsp.html.ImageTag {
23
24     /**
25      * This classes logger
26      */

27     private static final Logger logger = Logger.getLogger(ImageTag.class);
28
29
30     /**
31      * Ouputs an image input tag.
32      * @throws JspException If this tag is not inside a submit tag and the submit
33      * tag is not inside a form tag, or if a property name was not specified
34      */

35     public void initialize() throws JspException JavaDoc {
36
37         // Initialize the parent reference and the bean reference
38
super.initialize();
39
40         FormTag form = FormHelper.getFormTag(super.getFormParent());
41         ActionConfig actionConfig = form.getConfig().getActionConfig(localAction);
42         if (actionConfig == null) {
43             logger.error("Invalid action: " + getAction() + " for form: " +
44                 form.getName());
45             throw new JspException JavaDoc("Invalid action: " + getAction() + " for form: " +
46                 form.getName());
47         }
48     }
49
50     /**
51      * Outputs the extra information required by the container to decode the
52      * model and handle the MVC
53      */

54     public int doEndTag() throws JspException JavaDoc {
55         super.doEndTag();
56         FormHelper.outputControllerExtra(localName, localAction, pageContext);
57         return EVAL_PAGE;
58     }
59 }
60
Popular Tags