Re: WROXComponent Example
Re: WROXComponent Example
- Subject: Re: WROXComponent Example
- From: Jonathan Rochkind <email@hidden>
- Date: Tue, 16 Mar 2004 16:29:43 -0600
WROXComponent has a single constructor, which takes one argument, a
WOContext. This is indeed the reccomended constructor for a
WOComponent in recent WO versions.
WROXPage is a sub-class of WROXComponent. It has no constructors
defined. The Java compiler does some strange things when there are
no constructors defined. It assumes you want a single no-argument
constructor. But, if the super-class does not implement a
no-argument constructor, you can't either. So that's what the
compiler is complaining about. It's a Java thing.
Add the following constructor to WROXPage:
public WROXPage(WOContext context) {
super(c);
}
While you're learning WO with the WROX book, you probably want to get
a good Java book too, to go along with it. As the WROX book probably
isn't so good at teaching Java, which is a skill you need for WO!
--Jonathan
At 10:17 AM -0800 3/16/04, Franck Leveneur wrote:
Hi,
I'm new to WO and Java. I was wondering if someone could help me.
I'm trying to build 2 components based on example from WO 5.0 with Java
(WROX). (page 166).
I followed the direction (New file, choosed Java Class). The java class
are under WebComponents folder (in XCode).
I choose Application Server as the target when adding the file.
I'm getting the error for WROXPage.java: cannot resolve symbol :
constructor WROXComponent()
Thx a lot.
WROXComponent.java
import com.webobjects.foundation.*;
import com.webobjects.eocontrol.*;
import com.webobjects.appserver.*;
public abstract class WROXComponent extends WOComponent {
public WROXComponent(WOContext context) {
super(context);
}
public abstract String getArea();
}
WROXPage.java
import com.webobjects.foundation.*;
import com.webobjects.eocontrol.*;
import com.webobjects.appserver.*;
public abstract class WROXPage extends WROXComponent {
public WROXPage getPage() {
return (WROXPage)context().page();
}
}
_______________________________________________
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.
_______________________________________________
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.