On Oct 24, 2009, at 11:55 AM, Baiss Eric Magnusson wrote:

String fileNameAndPath = "/helpFiles/LoginHelp.html";

try {
        WOResourceManager rm = application().resourceManager(); // this works

// both of the below fail
...
rtrnHTMfile = rm.urlForResourceNamed( fileNameAndPath, null, null, context().request() );
...
byte[] wholePage = rm.bytesForResourceNamed(fileNameAndPath, null, null);

} catch ( Exception ex3 ) {
throw new NSForwardException( ex3, "<rtrnHTMfile> could not open file" );
}

rtrnHTMfile  yields:

/cgi-bin/WebObjects/tyf.woa/-5555/wr? wodata=ERROR_NOT_FOUND_framework_*null*_filename_%2FhelpFiles %2FLoginHelp.html

How should the path look when sent into < rm.urlForResourceNamed>?

The Property pane of the file, seen by right-clicking on the file, shows the path as:

</tyf/WebServerResources/helpFiles/LoginHelp.html>

I don't usually embed WSR. Wonder might help if you have folders under WSR, I see this comment in ERXResourceManager:

/**
 * Replacement of the WOResourceManager which adds:
 * <ul>
 * <li> dealing with nested web server resources when not deploying
 * <li> resource versioning (for better caching control)
 * </ul>
 *
* @property er.extensions.ERXResourceManager.versionManager the class name of the version manager to use (or "default", or "properties")
 * @author ak
 * @fiddler mschrag
 */


Chuck




On Oct 22, 2009, at 4:35 PM, Chuck Hill wrote:

No.  See WOResourceManager.

Chuck


----
Baiss Eric Magnusson
http://www.CascadeWebDesign.com




--
Chuck Hill             Senior Consultant / VP Development

Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems.
http://www.global-village.net/products/practical_webobjects







_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to