Le 2012-02-16 à 07:52, Ron X a écrit :

> email/Email - doesn't work
> 
> app-constructor code:
>     
> public Application() {
>         
> setDefaultRequestHandler(requestHandlerForKey(directActionRequestHandlerKey()));
>         
>         ERXRouteRequestHandler requestHandler;
>         {
>             requestHandler = new 
> ERXRouteRequestHandler(ERXRouteRequestHandler.WO);
>             requestHandler.addDefaultRoutes(Email.ENTITY_NAME, 
> Email.ENTITY_NAME, true, EmailController.class);

addDefaultRoutes(EMail.ENTITY_NAME) is sufficient.

>             
> //            requestHandler.insertRoute(new ERXRoute("Main","", 
> ERXRoute.Method.Get));
>             requestHandler.insertRoute(new ERXRoute(Email.ENTITY_NAME, 
> "/Email", ERXRoute.Method.Get));

You don't need that route since you are adding the default routes. And that 
route will only work for /Email, not /Email/something

You can check the SimpleBlog example for other examples of routes in a 
HTML/browser context.

>         }
>         ERXRouteRequestHandler.register(requestHandler);
>         
>         
>         setAllowsConcurrentRequestHandling(true);        
>     }
> 
> 2012/2/16 Pascal Robert <[email protected]>
> 
> Le 2012-02-16 à 07:29, Ron X a écrit :
> 
> > Hi everyone.
> > I have a problem:
> >
> > in NavPanel:
> > <wo:ERXRouteLink entityName = "Email" id = "1" action = "show" format = 
> > "html">
> >
> > in EmailController extends ERXDefaultRouteController:
> >     @Override
> >     protected boolean isAutomaticHtmlRoutingEnabled() {
> >         return true;
> >     }
> >
> > but this comment:
> >
> >     /**
> >      * Automatic HTML routing means that if someone requests 
> > Entity/X/action.html, the
> >      * router controller will automatically look for an EntityActionPage 
> > component. For
> >      * example, if you go to /Person/1.html, it will look for 
> > PersonShowPage. You can
> >      * manually handle these as well but checking the current request 
> > format and
> >      * choosing the appropriate component to return.
> >      */
> >
> > doesn't work:
> > Feb 16 07:54:35 RonRest[80] ERROR er.rest.routes.ERXRouteController  - 
> > Request failed: /cgi-bin/WebObjects/RonRest.woa/ra/Email/1.html, 405
> 
> Try /email instead of /Email
> 
> And did you register the routes for this entity in your Application class? If 
> yes, send the line that add it to the list.
> 
> Do you have an error (in the console) saying "XXXXX does not exist, falling 
> back to route controller" ?
> 
> > EmailShowPage extends ERDCustomComponent implements IERXRouteComponent - 
> > stateless and non synchronized.
> >
> > any ideas?
> >
> > Thank you.
> > _______________________________________________
> > Do not post admin requests to the list. They will be ignored.
> > Webobjects-dev mailing list      ([email protected])
> > Help/Unsubscribe/Update your Subscription:
> > https://lists.apple.com/mailman/options/webobjects-dev/probert%40macti.ca
> >
> > This email sent to [email protected]
> 
> 


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

This email sent to [email protected]

Reply via email to