Thanks! This seems like a very good workaround.
I am not sure that the default behavior should be like
it is now, though.

Quoting "Filip S. Adamsen" <[EMAIL PROTECTED]>:
> Hi,
> 
> I had this problem too so I decided to do something
about it. What I 
> have done is to create a new class, HttpStatusCode,
that wraps an HTTP 
> status code and a message, and then contributing a 
> ComponentEventResultProcessor that sends an error
with the given status 
> code and message.
> 
> public class HttpStatusCode
>      implements Serializable {
> 
>    private final int statusCode;
>    private final String message;
> 
>    public HttpStatusCode(int statusCode) {
>      this.statusCode = statusCode;
>      this.message = "";
>    }
> 
>    public HttpStatusCode(int statusCode, String
message) {
>      this.statusCode = statusCode;
>      this.message = message;
>    }
> 
>    public int getStatusCode() {
>      return statusCode;
>    }
> 
>    public String getMessage() {
>      return message;
>    }
> }
> 
>    public static void
contributeComponentEventResultProcessor(
>        MappedConfiguration<Class,
ComponentEventResultProcessor> 
> configuration, final Response response) {
>      configuration.add(HttpStatusCode.class, new 
> ComponentEventResultProcessor<HttpStatusCode>() {
>        public void processResultValue(HttpStatusCode
value) throws 
> IOException {
>          response.sendError(value.getStatusCode(),
value.getMessage());
>        }
>      });
>    }
> 
> In my Index page I then use it like this:
> 
>    Object onActivate(Object obj) {
>      return new
HttpStatusCode(HttpServletResponse.SC_NOT_FOUND);
>    }
> 
> This triggers if there's any context for the page.
You could use this to
> 
> return other status codes in other places as well.
> 
> -Filip
> 
> On 2008-04-12 13:20, Imants Firsts wrote:
> > Hello!
> > 
> > I changed my application to use the Index.tml instead
> > of Start.tml, because pagelink component for index page
> > renders www.mydomain.com/, which looks much better than
> > www.mydomain.com/start 
> > 
> > However now there is a problem that all the invalid
> > tapestry URLs are rendered as my index page with
> > everything that comes after mydomain.com/ treated as
> > context to the index page.
> > 
> > I would like to render the standard 404 http response
> > for invalid URLs or pass them through to servlet
> > container to return 404. Is this possible with
index pages?
> > 
> > Thanks in advance,
> > Imants
> > 
> > 
> >
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
[EMAIL PROTECTED]
> > For additional commands, e-mail:
[EMAIL PROTECTED]
> > 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
[EMAIL PROTECTED]
> For additional commands, e-mail:
[EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to