2
* $Header: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/RewriteTag.java,v 1.20 2004/03/14 06:23:46 sraeburn Exp $
4
* $Date: 2004/03/14 06:23:46 $
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.
21
package org.apache.struts.taglib.html;
23
import java.net.MalformedURLException;
26
import javax.servlet.jsp.JspException;
28
import org.apache.struts.taglib.TagUtils;
31
* Generate a URL-encoded URI as a string.
33
* @version $Revision: 1.20 $ $Date: 2004/03/14 06:23:46 $
35
public class RewriteTag extends LinkTag {
38
// --------------------------------------------------------- Public Methods
42
* Render the appropriately encoded URI.
44
* @exception JspException if a JSP exception has occurred
46
public int doStartTag() throws JspException {
48
// Generate the hyperlink URL
49
Map params = TagUtils.getInstance().computeParameters
50
(pageContext, paramId, paramName, paramProperty, paramScope,
51
name, property, scope, transaction);
55
// Note that we're encoding the & character to & in XHTML mode only,
56
// otherwise the & is written as is to work in javascripts.
58
TagUtils.getInstance().computeURLWithCharEncoding(
71
} catch (MalformedURLException e) {
72
TagUtils.getInstance().saveException(pageContext, e);
73
throw new JspException
74
(messages.getMessage("rewrite.url", e.toString()));
77
TagUtils.getInstance().write(pageContext, url);
86
* Ignore the end of this tag.
88
* @exception JspException if a JSP exception has occurred
90
public int doEndTag() throws JspException {