Re: DirectAction question
Re: DirectAction question
- Subject: Re: DirectAction question
- From: Chuck Hill <email@hidden>
- Date: Mon, 9 May 2005 08:01:01 -0700
The method signature is wrong. Direct Actions return WOActionResults
not WOComponent. That is why it can't find the method.
Chuck
On May 8, 2005, at 10:47 PM, Greg wrote:
I am having a problem with a direct action that is in the default
DirectAction class. It keeps throwing a cannot find method exception
for the action, but it is in there and there are other actions there
that work fine. Is there a way to list the direct actions of a class?
I know this would be a security concern, but just for development?
Regards,
Greg
Exception:
java.lang.reflect.InvocationTargetException
Stack Trace:
java.lang.reflect.InvocationTargetException
at
com.webobjects.appserver._private.WOActionRequestHandler._handleRequest
(WOActionRequestHandler.java:250)
at
com.webobjects.appserver._private.WOActionRequestHandler.handleRequest(
WOActionRequestHandler.java:142)
at
er.extensions.ERXDirectActionRequestHandler.handleRequest(ERXDirectActi
onRequestHandler.java:77)
at
com.webobjects.appserver.WOApplication.dispatchRequest(WOApplication.ja
va:1306)
at
er.extensions.ERXApplication.dispatchRequest(ERXApplication.java:633)
at
au.com.shoebox.woapplication.Application.dispatchRequest(Application.ja
va:224)
at
com.webobjects.appserver._private.WOWorkerThread.runOnce(WOWorkerThread
.java:173)
at
com.webobjects.appserver._private.WOWorkerThread.run(WOWorkerThread.jav
a:254)
at java.lang.Thread.run(Thread.java:552)
Caused by: java.lang.NoSuchMethodException:
au.com.shoebox.woapplication.DirectAction.viewPublicAlbumAction()
at
com.webobjects.appserver.WODirectAction.performActionNamed(WODirectActi
on.java:125)
at
com.webobjects.appserver._private.WOActionRequestHandler._handleRequest
(WOActionRequestHandler.java:240)
... 8 more
public WOComponent viewPublicAlbumAction() {
PublicAlbumViewer viewer =
(PublicAlbumViewer)pageWithName("PublicAlbumViewer");
Long aID = new
Long(context().request().stringFormValueForKey("albumID"));
try {
Album a =
(Album)EOUtilities.objectMatchingKeyAndValue(session().defaultEditingCo
ntext(), "Album", "albumID", aID);
if (a.isPublic()) {
viewer.setAlbum(a);
}
} catch (Exception e) {
//do nothing
}
return viewer;
}
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
village.net
This email sent to email@hidden
--
Practical WebObjects - a book for intermediate WebObjects developers
who want to increase their overall knowledge of WebObjects, or those
who are trying to solve specific application development 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@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden