• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

hazendaz / sitemesh2 / 59

22 Mar 2026 02:30AM UTC coverage: 40.347%. Remained the same
59

push

github

hazendaz
[mvn] Update maven wrapper

698 of 1891 branches covered (36.91%)

Branch coverage included in aggregate %.

1555 of 3693 relevant lines covered (42.11%)

0.42 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/main/java/com/opensymphony/sitemesh/compatability/OldDecorator2NewDecorator.java
1
/*
2
 * SPDX-License-Identifier: Apache-2.0
3
 * Copyright 2011-2026 Hazendaz
4
 */
5
package com.opensymphony.sitemesh.compatability;
6

7
import com.opensymphony.module.sitemesh.RequestConstants;
8
import com.opensymphony.sitemesh.Content;
9
import com.opensymphony.sitemesh.webapp.SiteMeshWebAppContext;
10
import com.opensymphony.sitemesh.webapp.decorator.BaseWebAppDecorator;
11

12
import jakarta.servlet.RequestDispatcher;
13
import jakarta.servlet.ServletContext;
14
import jakarta.servlet.ServletException;
15
import jakarta.servlet.http.HttpServletRequest;
16
import jakarta.servlet.http.HttpServletResponse;
17

18
import java.io.IOException;
19

20
/**
21
 * Adapts a SiteMesh 2 {@link com.opensymphony.module.sitemesh.Decorator} to a SiteMesh 3
22
 * {@link com.opensymphony.sitemesh.Decorator}.
23
 *
24
 * @author Joe Walnes
25
 *
26
 * @since SiteMesh 3
27
 */
28
public class OldDecorator2NewDecorator extends BaseWebAppDecorator implements RequestConstants {
29

30
    /** The old decorator. */
31
    private final com.opensymphony.module.sitemesh.Decorator oldDecorator;
32

33
    /**
34
     * Instantiates a new old decorator 2 new decorator.
35
     *
36
     * @param oldDecorator
37
     *            the old decorator
38
     */
39
    public OldDecorator2NewDecorator(com.opensymphony.module.sitemesh.Decorator oldDecorator) {
×
40
        this.oldDecorator = oldDecorator;
×
41
    }
×
42

43
    @Override
44
    protected void render(Content content, HttpServletRequest request, HttpServletResponse response,
45
            ServletContext servletContext, SiteMeshWebAppContext webAppContext) throws IOException, ServletException {
46

47
        request.setAttribute(PAGE, new Content2HTMLPage(content, request));
×
48

49
        // see if the URI path (webapp) is set
50
        // in a security conscious environment, the servlet container
51
        // may return null for a given URL
52
        if (oldDecorator.getURIPath() != null && servletContext.getContext(oldDecorator.getURIPath()) != null) {
×
53
            servletContext = servletContext.getContext(oldDecorator.getURIPath());
×
54
        }
55
        // get the dispatcher for the decorator
56
        RequestDispatcher dispatcher = servletContext.getRequestDispatcher(oldDecorator.getPage());
×
57
        dispatcher.include(request, response);
×
58

59
        request.removeAttribute(PAGE);
×
60
    }
×
61

62
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc