continue processing templates after resource not found?

View: New views
6 Messages — Rating Filter:   Alert me  

continue processing templates after resource not found?

by ChadDavis :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

If a template contains a parse directive that results in a resource
not found, the whole thing blows up.  Is there a configuration setting
that would allow the processing to continue, perhaps just writing a
message in line.  I see that the #include directive can insert a
message into the stream and keep going; how can I do this with #parse?

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@...
For additional commands, e-mail: user-help@...


Re: continue processing templates after resource not found?

by ChadDavis :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Okay.  I can answer my first question and pose another.

> If a template contains a parse directive that results in a resource
> not found, the whole thing blows up.  Is there a configuration setting
> that would allow the processing to continue, perhaps just writing a
> message in line.  I see that the #include directive can insert a
> message into the stream and keep going; how can I do this with #parse?

The answer is that the #include directive doesn't actually handle
missing resources, or appears not to.  I wonder what kind of problems
it does handle?

I'm now using the org.apache.velocity.app.event.implement.IncludeNotFound
event handler.  This works great.  But . . .

I now would like to be able to have access to the name of the missing
resource so i can inline it into the notfound.vm template that takes
over when the resource is not found.  Is this information in the
context ?

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@...
For additional commands, e-mail: user-help@...


Re: continue processing templates after resource not found?

by ChadDavis :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> I'm now using the org.apache.velocity.app.event.implement.IncludeNotFound
> event handler.  This works great.  But . . .
>
> I now would like to be able to have access to the name of the missing
> resource so i can inline it into the notfound.vm template that takes
> over when the resource is not found.  Is this information in the
> context ?
>

Okay.  I looked at the code and it seems that this feature is not
there.  I wrote my own version that puts the not found resource in the
context so you can have amore meaningful message in the notfound.vm.
It's a very simple enhancement.  Seems like it might be worth adding
to the real class, let me know if you're interested.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@...
For additional commands, e-mail: user-help@...


Re: continue processing templates after resource not found?

by Nathan Bubna :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Fri, Aug 28, 2009 at 2:46 PM, ChadDavis<chadmichaeldavis@...> wrote:

>> I'm now using the org.apache.velocity.app.event.implement.IncludeNotFound
>> event handler.  This works great.  But . . .
>>
>> I now would like to be able to have access to the name of the missing
>> resource so i can inline it into the notfound.vm template that takes
>> over when the resource is not found.  Is this information in the
>> context ?
>>
>
> Okay.  I looked at the code and it seems that this feature is not
> there.  I wrote my own version that puts the not found resource in the
> context so you can have amore meaningful message in the notfound.vm.
> It's a very simple enhancement.  Seems like it might be worth adding
> to the real class, let me know if you're interested.

Yeah, that sounds like a good addition.  Can you open a JIRA issue and
attach it as a patch?

https://issues.apache.org/jira/browse/VELOCITY

> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@...
> For additional commands, e-mail: user-help@...
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@...
For additional commands, e-mail: user-help@...


Re: continue processing templates after resource not found?

by ChadDavis :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> Yeah, that sounds like a good addition.  Can you open a JIRA issue and
> attach it as a patch?

Done.  Can you respond to this thread when it get's into the trunk?

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@...
For additional commands, e-mail: user-help@...


Re: continue processing templates after resource not found?

by Nathan Bubna :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

ok, it's in the trunk.

On Sun, Aug 30, 2009 at 2:01 PM, ChadDavis<chadmichaeldavis@...> wrote:

>> Yeah, that sounds like a good addition.  Can you open a JIRA issue and
>> attach it as a patch?
>
> Done.  Can you respond to this thread when it get's into the trunk?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@...
> For additional commands, e-mail: user-help@...
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@...
For additional commands, e-mail: user-help@...