• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: WebServerResources under servlet deploy - WOAppMode=Deployment
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: WebServerResources under servlet deploy - WOAppMode=Deployment


  • Subject: Re: WebServerResources under servlet deploy - WOAppMode=Deployment
  • From: David Avendasora <email@hidden>
  • Date: Wed, 20 May 2009 17:32:02 -0400


On May 20, 2009, at 5:00 PM, Jon Nolan wrote:

Thanks a million Dave. I was coming to the conclusion myself that it wasn't "built in." Your hack will be very useful but more importantly the knowledge that I'm on my own is a big help. I didn't want to go firing off with home grown solutions if I was simply missing a flag somewhere that would do it for me.

Well, there's nothing saying that there _isn't_ some flag somewhere. I don't do much Web stuff. I mostly do Direct To JavaClient so any "Web" solution from me is most likely a hack. (shut up Chuck)


This is how I got it working for myself a couple years ago and I just haven't ever looked into it again because it works for me.

Dave



Thanks again, Jon

David Avendasora wrote:

On May 19, 2009, at 6:39 PM, Jon Nolan wrote:

I am really struggling to figure out how to access static resources under a servlet deployment. I want to serve them via tomcat for a variety of reasons. I set WOAppMode=Deployment and I get ERXStyleSheet and ERXJavaScript URLs which are giving me fits.

For the sake of context, application URL - http://dev.box.com/Admin/WebObjects/Admin.woa .

To keep it simple here is a single ERXStyleSheet I've included.
<wo:ERXStyleSheet framework="WDExtensions" filename="css/default- styles.css" />


The URL generated looks like this:

http://dev.box.com/WebObjects/Frameworks/WDExtensions.framework/WebServerResources/css/default-styles.css

The ERXStyleSheet is assuming that the file is in the location it would be if you were having the Web Server serve the static files.


This path maps to: /Library/WebServer/Documents/WebObjects/ Frameworks/WDExtensions.framework/WebServerResources/css/default- styles.css

But because you are serving static files through Tomcat instead of the Web Server and Tomcat has no way of parsing that URL to you're app's.

I'm not sure how to get ERXStyleSheet to generate a different URL that would get it to load from the app.

I have a small Web-Client WO App that I have Tomcat serving the static files for as well. I've got them hard-coded to load from / MyApp/WebServerResources/image.png and I put the WebServerResources directory in the Apps root (same level as the WEB-INF directory).

I've added the following to the build.xml file to get Ant to do the dirty work:

       <mkdir dir="${dest.dir}/${project.name}/WebServerResources" />
       <copy todir="${dest.dir}/${project.name}/WebServerResources">
           <fileset dir="WebServerResources">
               <include name="**" />
           </fileset>
       </copy>

I put that just above the following comment line:

<!-- copy the frameworks to the WEBINFROOT/Library directory -->

I have a WebServerResources Symbolic Link setup in my /Library/ WebServer/Documents/MyApp directory that points to my project's WebServerResources directory so that everything resolves correctly when run within Eclipse as well.

It's a hack, but it works.

Dave


So far so good in that the form is exactly the same as those static resources included by Ajax.framework among others.


The problem is that the files are not served. I get 404 errors. What am I missing? Why does the URL include /WebObjects which I believe will map to WOServletAdaptor. Definitely not what I want.
Sorry if this is a bit elementary. Tomcat deployment is new to me. I can't find anything helpful in any of the tomcat logs.
Thanks,
Jon


WOLips 3.4.5744
Wonder nightly build from a couple of weeks ago
WebObjects 5.4
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden








_______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: WebServerResources under servlet deploy - WOAppMode=Deployment
      • From: Jon Nolan <email@hidden>
References: 
 >WebServerResources under servlet deploy - WOAppMode=Deployment (From: Jon Nolan <email@hidden>)

  • Prev by Date: Re: WebServerResources under servlet deploy - WOAppMode=Deployment
  • Next by Date: WOAction returning current page instead of next page.
  • Previous by thread: Re: WebServerResources under servlet deploy - WOAppMode=Deployment
  • Next by thread: Re: WebServerResources under servlet deploy - WOAppMode=Deployment
  • Index(es):
    • Date
    • Thread