• 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/webapp/SiteMeshWebAppContext.java
1
/*
2
 * SPDX-License-Identifier: Apache-2.0
3
 * Copyright 2011-2026 Hazendaz
4
 */
5
package com.opensymphony.sitemesh.webapp;
6

7
import com.opensymphony.sitemesh.SiteMeshContext;
8

9
import jakarta.servlet.ServletContext;
10
import jakarta.servlet.http.HttpServletRequest;
11
import jakarta.servlet.http.HttpServletResponse;
12

13
/**
14
 * The Class SiteMeshWebAppContext.
15
 *
16
 * @author Joe Walnes
17
 *
18
 * @since SiteMesh 3
19
 */
20
public class SiteMeshWebAppContext implements SiteMeshContext {
21

22
    /** The Constant IS_USING_STRING_KEY. */
23
    private static final String IS_USING_STRING_KEY = "com.opensymphony.sitemesh.USINGSTREAM";
24

25
    /** The request. */
26
    private final HttpServletRequest request;
27

28
    /** The response. */
29
    private final HttpServletResponse response;
30

31
    /** The servlet context. */
32
    private final ServletContext servletContext;
33

34
    /** The content type. */
35
    private String contentType;
36

37
    /**
38
     * Instantiates a new site mesh web app context.
39
     *
40
     * @param request
41
     *            the request
42
     * @param response
43
     *            the response
44
     * @param servletContext
45
     *            the servlet context
46
     */
47
    public SiteMeshWebAppContext(HttpServletRequest request, HttpServletResponse response,
48
            ServletContext servletContext) {
×
49
        this.request = request;
×
50
        this.response = response;
×
51
        this.servletContext = servletContext;
×
52
    }
×
53

54
    /**
55
     * Gets the request.
56
     *
57
     * @return the request
58
     */
59
    public HttpServletRequest getRequest() {
60
        return request;
×
61
    }
62

63
    /**
64
     * Gets the response.
65
     *
66
     * @return the response
67
     */
68
    public HttpServletResponse getResponse() {
69
        return response;
×
70
    }
71

72
    /**
73
     * Gets the servlet context.
74
     *
75
     * @return the servlet context
76
     */
77
    public ServletContext getServletContext() {
78
        return servletContext;
×
79
    }
80

81
    /**
82
     * Checks if is using stream.
83
     *
84
     * @return true, if is using stream
85
     */
86
    public boolean isUsingStream() {
87
        return request.getAttribute(IS_USING_STRING_KEY) == Boolean.TRUE;
×
88
    }
89

90
    /**
91
     * Sets the using stream.
92
     *
93
     * @param isUsingStream
94
     *            the new using stream
95
     */
96
    public void setUsingStream(boolean isUsingStream) {
97
        request.setAttribute(IS_USING_STRING_KEY, isUsingStream ? Boolean.TRUE : Boolean.FALSE); // JDK 1.3 friendly
×
98
    }
×
99

100
    @Override
101
    public String getContentType() {
102
        return contentType;
×
103
    }
104

105
    @Override
106
    public void setContentType(String contentType) {
107
        this.contentType = contentType;
×
108
    }
×
109
}
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