Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8238569
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T19:51:41+00:00 2026-06-07T19:51:41+00:00

<Configure class=org.eclipse.jetty.server.handler.ContextHandler> <Set name=contextPath>/</Set> <Set name=resourceBase><SystemProperty name=jetty.home default=./>/webapps/foo</Set> <Set name=handler> <New class=org.eclipse.jetty.server.handler.ResourceHandler> <Set name=cacheControl>max-age=3600,public</Set>

  • 0
<Configure class="org.eclipse.jetty.server.handler.ContextHandler">
  <Set name="contextPath">/</Set>
  <Set name="resourceBase"><SystemProperty name="jetty.home" default="."/>/webapps/foo</Set>
  <Set name="handler">
    <New class="org.eclipse.jetty.server.handler.ResourceHandler">
      <Set name="cacheControl">max-age=3600,public</Set>
    </New>
  </Set>
<Set name="virtualHosts">
    <Array type="java.lang.String">
          <Item>foo.bar</Item>
    </Array>
</Set>
</Configure>

This is my configuration, but no expires header can be added to the http response.

Because there is no property related to expires header in
ResourceHandler.

I found MovedContexHandler have this property, shall i use that?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T19:51:42+00:00Added an answer on June 7, 2026 at 7:51 pm

    I make a silly hack to get this work done! If you have a better solution, tell me.

    package org.eclipse.jetty.server.handler;
    
    import javax.servlet.http.HttpServletResponse;
    
    import org.eclipse.jetty.http.HttpHeaders;
    import org.eclipse.jetty.util.resource.Resource;
    /**
     * @author jilen.zhang@gmail.com
     * @date 12-7-6
     */
    public class StaticResourceHandler extends ResourceHandler{
        private String expires = "xxx";
    
        @Override
        protected void doResponseHeaders(HttpServletResponse response, Resource resource, String mimeType) {
            super.doResponseHeaders(response, resource, mimeType);
            response.setHeader(HttpHeaders.EXPIRES, expires);
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm embedding Jetty in a Spring based application. I configure my Jetty server in
I'm trying to configure a class with Annotation based configuration in Spring 3, which
return Fluently.Configure() .Database(MsSqlConfiguration.MsSql2008 .ConnectionString(c => c .Database(Database) .TrustedConnection() .Server(Server) ).ShowSql()) .ExposeConfiguration(c => c.SetProperty(current_session_context_class, web))
I configure eclipse Helios Service Release 2 , eclipse properly download and configure ADT
My configuration: app.configure(function(){ app.set('views', __dirname + '/views'); app.set('view engine', 'jade'); app.use(express.bodyParser()); app.use(express.cookieParser()); app.use(express.session({ secret:
i'm trying to configure a datasource of an db2 database in tomcat (using eclipse
I have deployed a .war file inside Jetty Server. The server has been started,
I'd like the version of Jetty launched by sbt> ~jetty to listen on my.name.local
Hi I'm trying to configure Jetty 6.1.26 to use connection pooling and it's giving
In Eclipse you can configure numerous servers to run inside the IDE, including Tomcat.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.