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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:46:25+00:00 2026-05-26T17:46:25+00:00

I have a resources web app, which only has static content, such as images,

  • 0

I have a resources web app, which only has static content, such as images, CSS and JavaScript.

I’m using these resources in another web app within JSF pages, but for some reason the JavaScript files are not loaded properly. I’ve seen two outcomes so far, either the JSF page renders weirdly (missing most of the content) or the page looks fine, but the JavaScript is not functional. CSS and images come alright.

I’m loading the resources like below

<head>
    <link rel="stylesheet" type="text/css" href="http://localhost:8080/resources/css/styles.css" />
    <script type="text/javascript" src="http://localhost:8080/resources/js/utils.js" />
</head>

FireBug shows that everything is loaded properly. The JavaScripts work fine when they are inline inside the JSF page.

I’ve tried with Jetty 8 and GlassFish 3, but results are pretty much same. Anyone got some pointers on what’s the problem?

  • 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-26T17:46:25+00:00Added an answer on May 26, 2026 at 5:46 pm

    Self-closing <script> tag is not valid in HTML documents with text/html content type and the browser behaviour is undetermined. You need to close it with another tag:

    <script type="text/javascript" src="http://localhost:8080/resources/js/utils.js"></script>
    

    It’s however valid in pure XHTML documents with application/xhtml+xml content type, but this is in turn not supported by IE. Serving XHTML as text/html is in turn considered harmful.

    This has nothing to do with Java/JSF.

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

Sidebar

Related Questions

I have an asp.net MVC web app that processes images and resizes them which
I have a web.xml which looks like: <web-app> <welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list> <security-constraint> <web-resource-collection> <web-resource-name>Default</web-resource-name>
I have a web application which was using Asp.net MVC2 . I Upgraded it
I have a web app, that is consuming more memory, which i can see
I have a list of items in my web app. Currently these have a
I have an app which displays 10 images and each image is associated with
I have several web applications in production that utilize NFS mounts to share resources
Let's say we have a grails web application exposing several resources. tags urls users
I have a Java Web Start application. I specify the resource (jars, images, etc)
Windows resources have a FileVersion and a ProductVersion. In native development environment(eg. Win32 app,

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.