2
* $Header: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/nested/logic/NestedMessagesNotPresentTag.java,v 1.8 2004/03/14 06:23:45 sraeburn Exp $
4
* $Date: 2004/03/14 06:23:45 $
6
* Copyright 1999-2004 The Apache Software Foundation.
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
12
* http://www.apache.org/licenses/LICENSE-2.0
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.
20
package org.apache.struts.taglib.nested.logic;
22
import javax.servlet.http.HttpServletRequest;
23
import javax.servlet.jsp.JspException;
25
import org.apache.struts.taglib.logic.MessagesNotPresentTag;
26
import org.apache.struts.taglib.nested.NestedPropertySupport;
27
import org.apache.struts.taglib.nested.NestedPropertyHelper;
30
* NestedMessagesNotPresentTag.
33
* @version $Revision: 1.8 $ $Date: 2004/03/14 06:23:45 $
35
public class NestedMessagesNotPresentTag extends MessagesNotPresentTag
36
implements NestedPropertySupport {
39
* Overriding method of the heart of the matter. Gets the relative property
40
* and leaves the rest up to the original tag implementation. Sweet.
41
* @return int JSP continuation directive.
42
* This is in the hands of the super class.
44
public int doStartTag() throws JspException {
45
// get the original properties
46
originalName = getName();
47
originalProperty = getProperty();
50
HttpServletRequest request = (HttpServletRequest)pageContext.getRequest();
52
NestedPropertyHelper.setNestedProperties(request, this);
54
// let the super do it's thing
55
return super.doStartTag();
59
* Complete the processing of the tag. The nested tags here will restore
60
* all the original value for the tag itself and the nesting context.
61
* @return int to describe the next step for the JSP processor
62
* @throws JspException for the bad things JSP's do
64
public int doEndTag() throws JspException {
65
// do the super's ending part
66
int i = super.doEndTag();
68
// reset the properties
69
setName(originalName);
70
setProperty(originalProperty);
77
* Release the tag's resources and reset the values.
79
public void release() {
81
// reset the originals
83
originalProperty = null;
86
/* the usual private member variables */
87
private String originalName = null;
88
private String originalProperty = null;