1/*2 * $Id: JspAutotagRuntime.java 1360343 2012-07-11 18:35:52Z nlebas $3 *4 * Licensed to the Apache Software Foundation (ASF) under one5 * or more contributor license agreements. See the NOTICE file6 * distributed with this work for additional information7 * regarding copyright ownership. The ASF licenses this file8 * to you under the Apache License, Version 2.0 (the9 * "License"); you may not use this file except in compliance10 * with the License. You may obtain a copy of the License at11 *12 * http://www.apache.org/licenses/LICENSE-2.013 *14 * Unless required by applicable law or agreed to in writing,15 * software distributed under the License is distributed on an16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY17 * KIND, either express or implied. See the License for the18 * specific language governing permissions and limitations19 * under the License.20 */21package org.apache.tiles.request.jsp.autotag;
2223import javax.servlet.jsp.JspContext;
24import javax.servlet.jsp.PageContext;
25import javax.servlet.jsp.tagext.SimpleTagSupport;
26import org.apache.tiles.autotag.core.runtime.ModelBody;
27import org.apache.tiles.autotag.core.runtime.AutotagRuntime;
28import org.apache.tiles.request.Request;
29import org.apache.tiles.request.jsp.JspRequest;
3031/**32 * A Runtime for implementing JSP tag libraries.33 */34publicclassJspAutotagRuntimeextends SimpleTagSupport implements AutotagRuntime<Request> {
35/** {@inheritDoc} */36 @Override
37publicvoid doTag() {
38// do nothing like the parent implementation, 39// but don't throw exceptions either40 }
4142/** {@inheritDoc} */43 @Override
44publicRequest createRequest() {
45 JspContext pageContext = getJspContext();
46return JspRequest.createServletJspRequest(org.apache.tiles.request.jsp.JspUtil.getApplicationContext(pageContext),
47 (PageContext) pageContext);
48 }
4950/** {@inheritDoc} */51 @Override
52public ModelBody createModelBody() {
53returnnewJspModelBody(getJspBody(), getJspContext());
54 }
5556/** {@inheritDoc} */57 @Override
58public <T> T getParameter(String name, Class<T> type, T defaultValue) {
59thrownew UnsupportedOperationException("the parameters are injected into the tag itself, no need to fetch them");
60 }
61 }