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 7715049
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T02:17:22+00:00 2026-06-01T02:17:22+00:00

I’m wondering how to use GWT to hide certain files stored on the server.

  • 0

I’m wondering how to use GWT to hide certain files stored on the server. I have databases with passwords and such in them, and I need users to be redirected from the databases to some other page. How do I do this?

I’ve tried changing stuff in web.xml:

<servlet-mapping>
    <servlet-name>SomeServer</servlet-name>
    <url-pattern>/actual_url</url-pattern>
    <url-pattern>/database1.db</url-pattern>
    <url-pattern>/database2.db</url-pattern>
</servlet-mapping>

And

<servlet-mapping>
    <servlet-name>SomeServer</servlet-name>
    <url-pattern>/actual_url</url-pattern>
</servlet-mapping>

<servlet-mapping>
    <servlet-name>SomeServer</servlet-name>
    <url-pattern>/database1.db</url-pattern>
</servlet-mapping>

<servlet-mapping>
    <servlet-name>SomeServer</servlet-name>
    <url-pattern>/database2.db</url-pattern>
</servlet-mapping>

Both allow access to the servlet at actual_url like they should, but I can still access database1.db and database2.db.

I know I can hide these files using .htaccess for Apache, but I would prefer a GWT solution. Does anyone have any idea?

Also, if anyone can find a reference for web.xml it would be much appreciated. I have searched a fair bit and have found nothing.

EDIT: After a little more testing, I’ve found that sometimes the second methods sometimes works, sometimes it does not. Can’t tell why or under what circumstances.

  • 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-01T02:17:24+00:00Added an answer on June 1, 2026 at 2:17 am

    If you don’t want some files to be accessible by clients, the best way is to not deploy them, or deploy them within your war’s WEB-INF or META-INF special folders.

    If you have to deploy them outside the WEB-INF, then you can restrict access to them using security-constraints:

    <security-constraint>
       <display-name>Denied</display-name>
       <web-resource-collection>
          <web-resource-name/> <!-- mandatory, but can be empty -->
          <url-pattern>/database1.db</url-pattern>
          <url-pattern>/database2.db</url-pattern>
          <!-- alternatively, you could simply use:
             <url-pattern>*.db</url-pattern>
          -->
       </web-resource-collection>
       <auth-constraint>
          <!-- an empty but not absent auth-constraint denies everyone -->
       </auth-constraint>
    </security-constraint>
    

    Note that if you’re using AppEngine, static files are served specifically, and your web.xml doesn’t apply to them unless you list them in your appengine-web.xml (see note in http://code.google.com/appengine/docs/java/config/webxml.html#Servlets_and_URL_Paths, and see http://code.google.com/appengine/docs/java/config/appconfig.html#Including_and_Excluding_Files)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have thousands of HTML files to process using Groovy/Java and I need to
I have a bunch of posts stored in text files formatted in yaml/textile (from
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
I am trying to understand how to use SyndicationItem to display feed which is
I have a jquery bug and I've been looking for hours now, I can't
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.

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.