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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T18:45:50+00:00 2026-05-11T18:45:50+00:00

I am writing a JSP application and am deploying it to JBoss 5.0. When

  • 0

I am writing a JSP application and am deploying it to JBoss 5.0. When I attempt to retrieve my CSS or Javascript files, JBoss returns the wrong Content-type for the file, so Firefox refuses to execute code supplied in them. Here is my web.xml file:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns="http://java.sun.com/xml/ns/javaee"
         xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
                             http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
         id="WebApp_ID" version="2.5">

   <display-name>TestServlet</display-name>

   <servlet>
      <servlet-name>TestServlet</servlet-name>
      <servlet-class>org.example.TestServlet</servlet-class>
      <load-on-startup>1</load-on-startup>
   </servlet>
   <servlet-mapping>
      <servlet-name>TestServlet</servlet-name>
      <url-pattern>/engine/*</url-pattern>
   </servlet-mapping>

   <welcome-file-list>
      <welcome-file>
         /login.jsp
      </welcome-file>
   </welcome-file-list>
   <jsp-config>
      <jsp-property-group>
         <display-name>TestServlet</display-name>
         <url-pattern>/*</url-pattern>
         <el-ignored>false</el-ignored>
         <scripting-invalid>false</scripting-invalid>
         <is-xml>false</is-xml>
         <trim-directive-whitespaces>true</trim-directive-whitespaces>
      </jsp-property-group>
   </jsp-config>

   <mime-mapping>
      <extension>css</extension>
      <mime-type>text/css</mime-type>
   </mime-mapping>
   <mime-mapping>
      <extension>js</extension>
      <mime-type>text/javascript</mime-type>
   </mime-mapping>
</web-app>

Using lynx to test the file download, I get the following:

host> lynx http://devbox:8080/TestServlet/js/main.js -head -dump

HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
X-Powered-By: Servlet 2.5; JBoss-5.0/JBossWeb-2.1
Set-Cookie: JSESSIONID=EA6FFF63B00F0B8C0C44F7A79BD368CF; Path=/jclaim
Content-Type: text/html;charset=ISO-8859-1
Content-Length: 1778
Date: Sun, 24 May 2009 17:53:31 GMT
Connection: close
  • 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-05-11T18:45:50+00:00Added an answer on May 11, 2026 at 6:45 pm

    I have found an answer by changing the following:

      <jsp-property-group>
         <display-name>TestServlet</display-name>
         <url-pattern>/*</url-pattern>
    

    to be this, instead:

      <jsp-property-group>
         <display-name>TestServlet</display-name>
         <url-pattern>*.jsp</url-pattern>
    

    As a beginner to JSP, I’m not sure what tutorial I picked up the previous example from, but it had led to no amount of frustration.

    The lynx command now results in:

    HTTP/1.1 200 OK
    Server: Apache-Coyote/1.1
    X-Powered-By: Servlet 2.5; JBoss-5.0/JBossWeb-2.1
    Accept-Ranges: bytes
    ETag: W/"11038-1243181792000"
    Last-Modified: Sun, 24 May 2009 16:16:32 GMT
    Content-Type: text/javascript
    Content-Length: 11038
    Date: Sun, 24 May 2009 17:57:07 GMT
    Connection: close
    

    This applies to CSS as well.

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

Sidebar

Related Questions

I'm testing a JBoss / Tomcat web application, writing JavaScript tests in .js files.
I am writing a web application that uses a JSP usebean tag in the
While writing a .jsp file, can i include all the html5 tags in it
I am writing a spring 2.5 application and in my jsp I'm writing my
I am writing a class in JSP to retrieve a bunch of config values
I'm writing an application in JSP that needs to reach out to a remote
I'm writing a web app with multiple jsp files wit a session timeout of
I am writing some JSP 2.x tag files. I have searched for a few
I'm currently writing a JSP-application with webservices. The problem is: I should detect the
I am currently writing an application that works in both JSP and the Andriod

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.