~ubuntu-branches/ubuntu/trusty/libstruts1.2-java/trusty-proposed

« back to all changes in this revision

Viewing changes to src/share/org/apache/struts/taglib/nested/logic/NestedNotMatchTag.java

  • Committer: Bazaar Package Importer
  • Author(s): Arnaud Vandyck
  • Date: 2004-11-19 15:35:25 UTC
  • Revision ID: james.westby@ubuntu.com-20041119153525-mdu08a76z4zo67xt
Tags: upstream-1.2.4
ImportĀ upstreamĀ versionĀ 1.2.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * $Header: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/nested/logic/NestedNotMatchTag.java,v 1.7 2004/03/14 06:23:45 sraeburn Exp $
 
3
 * $Revision: 1.7 $
 
4
 * $Date: 2004/03/14 06:23:45 $
 
5
 *
 
6
 * Copyright 1999-2004 The Apache Software Foundation.
 
7
 * 
 
8
 * Licensed under the Apache License, Version 2.0 (the "License");
 
9
 * you may not use this file except in compliance with the License.
 
10
 * You may obtain a copy of the License at
 
11
 * 
 
12
 *      http://www.apache.org/licenses/LICENSE-2.0
 
13
 * 
 
14
 * Unless required by applicable law or agreed to in writing, software
 
15
 * distributed under the License is distributed on an "AS IS" BASIS,
 
16
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 
17
 * See the License for the specific language governing permissions and
 
18
 * limitations under the License.
 
19
 */
 
20
package org.apache.struts.taglib.nested.logic;
 
21
 
 
22
import javax.servlet.http.HttpServletRequest;
 
23
import javax.servlet.jsp.JspException;
 
24
 
 
25
import org.apache.struts.taglib.logic.NotMatchTag;
 
26
import org.apache.struts.taglib.nested.NestedNameSupport;
 
27
import org.apache.struts.taglib.nested.NestedPropertyHelper;
 
28
 
 
29
/**
 
30
 * NestedNotMatchTag.
 
31
 *
 
32
 * @since Struts 1.1
 
33
 * @version $Revision: 1.7 $ $Date: 2004/03/14 06:23:45 $
 
34
 */
 
35
public class NestedNotMatchTag extends NotMatchTag implements NestedNameSupport {
 
36
 
 
37
  /**
 
38
   * Overriding method of the heart of the matter. Gets the relative property
 
39
   * and leaves the rest up to the original tag implementation. Sweet.
 
40
   * @return int JSP continuation directive.
 
41
   *             This is in the hands of the super class.
 
42
   */
 
43
  public int doStartTag() throws JspException {
 
44
    // get the original properties
 
45
    originalName = getName();
 
46
    originalProperty = getProperty();
 
47
 
 
48
    // request
 
49
    HttpServletRequest request = (HttpServletRequest)pageContext.getRequest();
 
50
    // set the properties
 
51
    NestedPropertyHelper.setNestedProperties(request, this);
 
52
 
 
53
    // let the super do it's thing
 
54
    return super.doStartTag();
 
55
  }
 
56
 
 
57
  /**
 
58
   * Complete the processing of the tag. The nested tags here will restore
 
59
   * all the original value for the tag itself and the nesting context.
 
60
   * @return int to describe the next step for the JSP processor
 
61
   * @throws JspException for the bad things JSP's do
 
62
   */
 
63
  public int doEndTag() throws JspException {
 
64
    // do the super's ending part
 
65
    int i = super.doEndTag();
 
66
 
 
67
    // reset the properties
 
68
    setName(originalName);
 
69
    setProperty(originalProperty);
 
70
 
 
71
    // continue
 
72
    return i;
 
73
  }
 
74
 
 
75
  /**
 
76
   * Release the tag's resources and reset the values.
 
77
   */
 
78
  public void release() {
 
79
    super.release();
 
80
    // reset the originals
 
81
    originalName = null;
 
82
    originalProperty = null;
 
83
  }
 
84
 
 
85
  /* the usual private member variables */
 
86
  private String originalName = null;
 
87
  private String originalProperty = null;
 
88
}