I'm considering a change for Tapestry 5.4 where the ValueEncoder, responsible for converting portions of the URL into the page activation context, will have a new method that defines what it expects to see in its portion of the URL, in terms of a regular expression.
Thus a URL such as: /account/1234 would match when when the type of value for the page activation context is a number, or an entity with a numeric primary key. A URL like /account/style.css The "style.css" would not match the numeric regular expression, and Tapestry would continue its search for a matching activation event handler and, failing that, a matching page. This would take a bit of work; when processing event handlers for pages, it will be necessary to determine the type of each field, find the ValueEncoder for that type, etc. I should be able to do this as ValueEncoder2, and have some simple smarts about upgrading ValueEncoder to ValueEncoder2. On Mon, Aug 20, 2012 at 2:42 PM, RJB III <rjb...@yahoo.com> wrote: > Well I got it to work by combining Info from here: > > > http://thread.gmane.org/gmane.comp.java.tapestry.user/64654/focus=64655 > > and here: > > http://tapestry.apache.org/error-page-recipe.html > > -------------------------------------------------------------------------------- > > Index.java page: > > Object onActivate(Object obj) { > return Error404.class; > } > > Error404.java: > > public class Error404 > { > > @Property > @Inject > @Symbol(SymbolConstants.PRODUCTION_MODE) > private boolean productionMode; > > @Inject > private RequestGlobals requestGlobals; > > public void setupRender() { > > > requestGlobals.getHTTPServletResponse().setStatus(HttpServletResponse.SC_NOT_FOUND); > } > } > > > > TML: > > <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd"> > <head> > <title>Resource not found.</title> > </head> > > <body> > > > Page or resource not found. > <br/> > > <t:if test="! productionMode"> > http://bit.ly/Rcfayf > </t:if> > > </body> > </html> > > Cheers > Russell John-Baptiste > > > > -- > View this message in context: > http://tapestry.1045711.n5.nabble.com/No-404-error-is-raised-tp3212773p5715638.html > Sent from the Tapestry - User mailing list archive at Nabble.com. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > -- Howard M. Lewis Ship Creator of Apache Tapestry The source for Tapestry training, mentoring and support. Contact me to learn how I can get you up and productive in Tapestry fast! (971) 678-5210 http://howardlewisship.com --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org