KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > fr > improve > struts > taglib > layout > expert > ExpertFieldTag


1 // Copyright 2005 Improve SA
2
//
3
// Licensed under the Apache License, Version 2.0 (the "License");
4
// you may not use this file except in compliance with the License.
5
// You may obtain a copy of the License at
6
//
7
// http://www.apache.org/licenses/LICENSE-2.0
8
//
9
// Unless required by applicable law or agreed to in writing, software
10
// distributed under the License is distributed on an "AS IS" BASIS,
11
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
// See the License for the specific language governing permissions and
13
// limitations under the License.
14

15 package fr.improve.struts.taglib.layout.expert;
16
17 import javax.servlet.jsp.JspException JavaDoc;
18 import javax.servlet.jsp.tagext.TagSupport JavaDoc;
19
20 /**
21  * Specify which input tags are used by the expert tag.
22  * @author Romain Maton
23  */

24 public class ExpertFieldTag extends TagSupport JavaDoc {
25     
26     protected String JavaDoc layoutId;
27     
28     public void setLayoutId(String JavaDoc layoutId) {
29         this.layoutId = layoutId;
30     }
31     
32     public String JavaDoc getLayoutId() {
33         return layoutId;
34     }
35     
36     public int doStartTag() throws JspException JavaDoc {
37         ExpertTag tag = (ExpertTag) findAncestorWithClass(this, ExpertTag.class);
38         if (tag==null) {
39             throw new JspException JavaDoc("<layout:expertField> should be nested in a <layout:expert> tag");
40         }
41         tag.doReferencer(this.layoutId);
42         return SKIP_BODY;
43     }
44 }
45
Popular Tags