Re: packages and WOBuilder keys
Re: packages and WOBuilder keys
- Subject: Re: packages and WOBuilder keys
- From: Art Isbell <email@hidden>
- Date: Fri, 18 Apr 2003 09:21:36 -1000
On Thursday, April 17, 2003, at 07:29 PM, Richard L. Peskin wrote:
Now if I open WO Builder
(double click Main.wo), I find two instance variables (keys);
application (instantiated by Application.java) and session. Both of
these are of type Application and Session respectively.
How are you determining the classes of these keys? Maybe I'm missing
a WOB capability.
It appears that
neither of these can be removed or replaced (i.e. I can't see how to do
it.).
They can't because they are methods defined by WOComponent and
inherited by your WOComponent subclasses.
Now assume I want to include my Application and Session classes in a
package (call it mypackage) by adding "package mypackage;" as the first
line in Application.java and Session.java. How do I get the instance
variables (application and session) in Main to reflect this package?
After I save my changes in Application.java and Session.java and go to
WO Builder, the class association under Main in the Main.wo window is
still Application, not mypackage.Application. (Same for session)
I don't understand how you're determining the classes of these keys.
But the application() and session() methods will return the
WOApplication and WOSession objects, usually subclasses, regardless of
what package they're in assuming you tell the WO bootstrap the
fully-qualified class name of your WOApplication subclass if it's in a
package.
Yet somehow it can be done. If one looks at the WOExamples
(JavaWebObjectsExamples) and takes, for example, FileUpload, the
package name is "webobjectsexamples.fileupload" and the instance
variables for Main.wo are 'application --->
webobjectsexamples.fileupload.Application' (similar for session). While
this explains my previous question, namely why I couldn't change the
package name when I wanted to alter a WebObjects example, I can't
figure out how a consistent package structure was created for the
WOExamples.
But you can change the package name of an example. I don't know how
WOB figures out what WOApplication and WOSession objects will be
returned by application() and session(), but I wouldn't be surprised if
it does something really simple like looks in the current project for
WOApplication and WOSession subclasses regardless of package. Why do
you think WOB is package-aware?
What I want to do is create my own package structure similar to what
was done for the WebObjects examples. Can anyone help me out?
Why can't you? What is broken when you try?
Aloha,
Art
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.