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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T14:52:15+00:00 2026-05-21T14:52:15+00:00

I’ve looked around a lot (trust me :) before posting this questions and I’m

  • 0

I’ve looked around a lot (trust me ๐Ÿ™‚ before posting this questions and I’m still confused. Here’s the scenario:

Hosting a J2EE web-app on glassfish v3 using Restlet 2.0 The freemarker template files are located in the /WEB-INF folder. The templates link to jQuery/javascript files, some static images and stylesheets using relative URLs.

Since it’s not a good practice to store them in /WEB-INF (as stated at many places on the web) I moved the files to the WebContent folder


WebContent:
+--Images
   -.jpg, .gif files
+--Styles
   -myStyle.css
+--Scripts
   +--jQLabel
   +--mColorPicker
      +--Images
      +--javascripts
         -.js files

I refer to them in the freemarker template/html as:

<link rel="stylesheet" type="text/css" href="${baseRef}/Styles/myStyle.css"  />

where ${baseRef} is the Root Reference of the site. The site is deployed at /Winbook. So the URL on the localhost for the css looks like this:

http://localhost:8080/Winbook/Styles/winbookwall.css <– retrieved using a GET

Problem(s):

For each of the above resources I get a 404 ๐Ÿ™ I’m not sure if this is really how one should store css, images or scripts and whether the WebContent folder is a good place for it be stored.

Question(s):

  1. Why is the above not working? I mean there has to be a mistake and I just don’t know about it ๐Ÿ™‚
  2. What is the best place to store the above files on the web server/glassfish?
  3. How do I refer to those resources (in the HTML/freemarker template) if they are deployed in the .war? (They will get deployed in the war file if they are placed in WebContent, right? Is this ‘legal’ or good practice? Seems to smell ๐Ÿ™‚
  4. Do we have to create alternate doc roots in glassfish for all such resources (or the equivalent Directory class in Restlet?)
  5. What is the ‘best’ way/place of/for such a deployment for an intranet based application to seamlessly locate the resources? JNDI based lookup? (I don’t know how that would work, another question probably on SO ๐Ÿ˜‰

I am totally confused! It’s been a while since I had to write a full end to end web app and this was usually taken care of by the ‘others’ ๐Ÿ™‚

Thanks!

  • 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-21T14:52:16+00:00Added an answer on May 21, 2026 at 2:52 pm

    I’m probably late on posting an answer to this but here it is. As I mentioned it Restlet intercepts the URLs and you HAVE to use the Directory class to return static content – initialized with the path “war:///” or “war:///images/” etc., for each of the folders.

    The reason it wasn’t working was with the Routing issues of Restlet – The directory folder was ‘last’ in the code order of URLs. Directories are created with Template.MODE_STARTS_WITH and the others (i.e., Restlets or other resources) are Template.MODE_EQUALS

    You should either change the order of routing manually or push it at the top of the list of URIs when routing.

    Hope that helps anyone stumbling on the same problem.

    Here is the related question that Jerome answered: Restlet Routing Nightmare

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

Sidebar

Related Questions

I know there's a lot of other questions out there that deal with this
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jackโ€™s Spindle from a text
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.
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
This could be a duplicate question, but I have no idea what search terms
Does anyone know how can I replace this 2 symbol below from the string

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.