You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by "White, Tim" <Ti...@qwest.com> on 2007/07/27 20:31:02 UTC
Ignoring/rewriting SSI commands with VelocityLayoutServlet
So, I'm trying out an idea that would let us serve all our existing
.html pages with VelocityLayoutServlet, instead of with with straight
Apache.
The problem is, a lot of our existing .html pages have Server Side
Includes in them like this:
<!--#include
virtual="/global/includes/residential/resInGlobalScript.html"-->
Ideally, I'd like velocity to handle these without changing the .html
files, since there are around 10,000 of them.
At minimum, I'd at least like Velocity to ignore it, rather than trying
to process it as a velocity #include().
Any ideas?
Tim
This communication is the property of Qwest and may contain confidential or
privileged information. Unauthorized use of this communication is strictly
prohibited and may be unlawful. If you have received this communication
in error, please immediately notify the sender by reply e-mail and destroy
all copies of the communication and any attachments.
Re: Ignoring/rewriting SSI commands with VelocityLayoutServlet
Posted by Nathan Bubna <nb...@gmail.com>.
On Wed, Oct 15, 2008 at 8:52 AM, Serge Knystautas <sk...@gmail.com> wrote:
> On Wed, Oct 15, 2008 at 11:49 AM, Nathan Bubna <nb...@gmail.com> wrote:
>> Ah, this is why it's important to say what version we're talking
>> about. VMProxyArg doesn't even exist anymore. I searched my local
>> copy of the trunk for all instances of "Include" and found none in any
>> macro-related code. So, perhaps Macro *did* depend on Include, but it
>> *does* not anymore. :)
>
> I'm on the current production release... 1.5. :)
thanks. :)
> Sorry I didn't answer your specifics. I'm actually doing something
> very crazy with Velocity, so if you wanted to dig into the details,
> the other thread had the full info.
>
>> Anyway, if you could try removing #include in the trunk, that would be
>> helpful. If you're stuck on an old version, you'll probably have to
>> extend Include, override getName() to return something else
>> ("vinclude?") and replace it in directive.properties, rather than
>> remove it. I haven't tried that myself, but it ought to work.
>
> Great, I will give it a try. Do you have a time frame you expect to
> make another production release?
I personally hope to have a 1.6 final before December, but of course,
nothing can be promised. :)
> --
> Serge Knystautas
> Lokitech >> software . strategy . design >> http://www.lokitech.com
> p. 301.656.5501
> e. sergek@lokitech.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
> For additional commands, e-mail: user-help@velocity.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org
Re: Ignoring/rewriting SSI commands with VelocityLayoutServlet
Posted by Serge Knystautas <sk...@gmail.com>.
On Wed, Oct 15, 2008 at 11:49 AM, Nathan Bubna <nb...@gmail.com> wrote:
> Ah, this is why it's important to say what version we're talking
> about. VMProxyArg doesn't even exist anymore. I searched my local
> copy of the trunk for all instances of "Include" and found none in any
> macro-related code. So, perhaps Macro *did* depend on Include, but it
> *does* not anymore. :)
I'm on the current production release... 1.5. :)
Sorry I didn't answer your specifics. I'm actually doing something
very crazy with Velocity, so if you wanted to dig into the details,
the other thread had the full info.
> Anyway, if you could try removing #include in the trunk, that would be
> helpful. If you're stuck on an old version, you'll probably have to
> extend Include, override getName() to return something else
> ("vinclude?") and replace it in directive.properties, rather than
> remove it. I haven't tried that myself, but it ought to work.
Great, I will give it a try. Do you have a time frame you expect to
make another production release?
--
Serge Knystautas
Lokitech >> software . strategy . design >> http://www.lokitech.com
p. 301.656.5501
e. sergek@lokitech.com
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org
Re: Ignoring/rewriting SSI commands with VelocityLayoutServlet
Posted by Nathan Bubna <nb...@gmail.com>.
On Wed, Oct 15, 2008 at 7:16 AM, Serge Knystautas <sk...@gmail.com> wrote:
> On Mon, Oct 13, 2008 at 11:30 AM, Nathan Bubna <nb...@gmail.com> wrote:
>> What version of Velocity, and what does your directive.properties look
>> like now? Did you redo the numbers or is directive.2 just missing?
>> Is it only #macro that breaks? Or is that just the first error
>> message you get because Velocity loads your macro library on startup.
>>
>> Macro.java does not internally depend on Include.java, so there's more
>> to this than you allege.
>
> I'm sorry but this is not correct, which is why I wanted to mention it
> on this unanswered user list. Please refer to a thread I was on on
> July 3rd 2008 with the subject "Velocity arg init issue". Here is the
> salient message:
>
> =========================
> Wow, figured this one out. :( I doubt anyone else will hit this, but
> wanted to post it so nobody else wastes their time on this.
>
> The issue is that when the Macro directive initializes itself, when it
> comes across a macro with args, it creates a VMProxyArg. For reasons
> I don't (need to) grasp, it creates some temporary velocity code that
> uses the Include directive and does a quick parse/evaluate on it.
> Once I re-enabled the include directive, things worked again.
> =========================
Ah, this is why it's important to say what version we're talking
about. VMProxyArg doesn't even exist anymore. I searched my local
copy of the trunk for all instances of "Include" and found none in any
macro-related code. So, perhaps Macro *did* depend on Include, but it
*does* not anymore. :)
Anyway, if you could try removing #include in the trunk, that would be
helpful. If you're stuck on an old version, you'll probably have to
extend Include, override getName() to return something else
("vinclude?") and replace it in directive.properties, rather than
remove it. I haven't tried that myself, but it ought to work.
> --
> Serge Knystautas
> Lokitech >> software . strategy . design >> http://www.lokitech.com
> p. 301.656.5501
> e. sergek@lokitech.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
> For additional commands, e-mail: user-help@velocity.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org
Re: Ignoring/rewriting SSI commands with VelocityLayoutServlet
Posted by Serge Knystautas <sk...@gmail.com>.
On Mon, Oct 13, 2008 at 11:30 AM, Nathan Bubna <nb...@gmail.com> wrote:
> What version of Velocity, and what does your directive.properties look
> like now? Did you redo the numbers or is directive.2 just missing?
> Is it only #macro that breaks? Or is that just the first error
> message you get because Velocity loads your macro library on startup.
>
> Macro.java does not internally depend on Include.java, so there's more
> to this than you allege.
I'm sorry but this is not correct, which is why I wanted to mention it
on this unanswered user list. Please refer to a thread I was on on
July 3rd 2008 with the subject "Velocity arg init issue". Here is the
salient message:
=========================
Wow, figured this one out. :( I doubt anyone else will hit this, but
wanted to post it so nobody else wastes their time on this.
The issue is that when the Macro directive initializes itself, when it
comes across a macro with args, it creates a VMProxyArg. For reasons
I don't (need to) grasp, it creates some temporary velocity code that
uses the Include directive and does a quick parse/evaluate on it.
Once I re-enabled the include directive, things worked again.
=========================
--
Serge Knystautas
Lokitech >> software . strategy . design >> http://www.lokitech.com
p. 301.656.5501
e. sergek@lokitech.com
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org
Re: Ignoring/rewriting SSI commands with VelocityLayoutServlet
Posted by Nathan Bubna <nb...@gmail.com>.
On Mon, Oct 13, 2008 at 8:04 AM, Serge Knystautas
<se...@prestosports.com> wrote:
>
>
> Nathan Bubna wrote:
>>
>> no, there's no interaction.
>>
>> On 7/30/07, White, Tim <Ti...@qwest.com> wrote:
>>> Hmmm. I removed #include from directive.properties, and now #macro
>>> doesn't work. Looks like they depend on each other in some manner?
>>
>
> This came up recently on the developer list... #macro does require #include
> unfortunately. I've had to re-enable #include because of this and am
> hitting the same bug (hence how I found this user list thread).
>
> Anyway, would be nice to change how #macro works to be able to disable
> #include again, but I don't have time right now.
What version of Velocity, and what does your directive.properties look
like now? Did you redo the numbers or is directive.2 just missing?
Is it only #macro that breaks? Or is that just the first error
message you get because Velocity loads your macro library on startup.
Macro.java does not internally depend on Include.java, so there's more
to this than you allege.
> --
> Serge Knystautas
> PrestoSports - College Sports Information Network
> http://www.prestosports.com
>
> --
> View this message in context: http://www.nabble.com/Ignoring-rewriting-SSI-commands-with-VelocityLayoutServlet-tp11834554p19956419.html
> Sent from the Velocity - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
> For additional commands, e-mail: user-help@velocity.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org
Re: Ignoring/rewriting SSI commands with VelocityLayoutServlet
Posted by Serge Knystautas <se...@prestosports.com>.
Nathan Bubna wrote:
>
> no, there's no interaction.
>
> On 7/30/07, White, Tim <Ti...@qwest.com> wrote:
>> Hmmm. I removed #include from directive.properties, and now #macro
>> doesn't work. Looks like they depend on each other in some manner?
>
This came up recently on the developer list... #macro does require #include
unfortunately. I've had to re-enable #include because of this and am
hitting the same bug (hence how I found this user list thread).
Anyway, would be nice to change how #macro works to be able to disable
#include again, but I don't have time right now.
--
Serge Knystautas
PrestoSports - College Sports Information Network
http://www.prestosports.com
--
View this message in context: http://www.nabble.com/Ignoring-rewriting-SSI-commands-with-VelocityLayoutServlet-tp11834554p19956419.html
Sent from the Velocity - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org
Re: Ignoring/rewriting SSI commands with VelocityLayoutServlet
Posted by Nathan Bubna <nb...@gmail.com>.
no, there's no interaction. what does your directive.properties look like now?
On 7/30/07, White, Tim <Ti...@qwest.com> wrote:
> Hmmm. I removed #include from directive.properties, and now #macro doesn't work. Looks like they depend on each other in some manner?
>
> -----Original Message-----
> From: Claude Brisson [mailto:claude@renegat.net]
> Sent: Friday, July 27, 2007 2:50 PM
> To: Velocity Users List
> Subject: Re: Ignoring/rewriting SSI commands with VelocityLayoutServlet
>
> Maybe by globally disactivating the #include directive? It is declared in the file org/apache/velocity/runtime/defaults/velocity.properties.
>
>
> Claude
>
> Le vendredi 27 juillet 2007 à 12:31 -0600, White, Tim a écrit :
> > So, I'm trying out an idea that would let us serve all our existing
> > .html pages with VelocityLayoutServlet, instead of with with straight
> > Apache.
> >
> > The problem is, a lot of our existing .html pages have Server Side
> > Includes in them like this:
> >
> > <!--#include
> > virtual="/global/includes/residential/resInGlobalScript.html"-->
> >
> > Ideally, I'd like velocity to handle these without changing the .html
> > files, since there are around 10,000 of them.
> >
> > At minimum, I'd at least like Velocity to ignore it, rather than
> > trying to process it as a velocity #include().
> >
> > Any ideas?
> >
> > Tim
> >
> >
> > This communication is the property of Qwest and may contain
> > confidential or privileged information. Unauthorized use of this
> > communication is strictly prohibited and may be unlawful. If you have
> > received this communication in error, please immediately notify the
> > sender by reply e-mail and destroy all copies of the communication and any attachments.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
> For additional commands, e-mail: user-help@velocity.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
> For additional commands, e-mail: user-help@velocity.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org
RE: Ignoring/rewriting SSI commands with VelocityLayoutServlet
Posted by "White, Tim" <Ti...@qwest.com>.
Hmmm. I removed #include from directive.properties, and now #macro doesn't work. Looks like they depend on each other in some manner?
-----Original Message-----
From: Claude Brisson [mailto:claude@renegat.net]
Sent: Friday, July 27, 2007 2:50 PM
To: Velocity Users List
Subject: Re: Ignoring/rewriting SSI commands with VelocityLayoutServlet
Maybe by globally disactivating the #include directive? It is declared in the file org/apache/velocity/runtime/defaults/velocity.properties.
Claude
Le vendredi 27 juillet 2007 à 12:31 -0600, White, Tim a écrit :
> So, I'm trying out an idea that would let us serve all our existing
> .html pages with VelocityLayoutServlet, instead of with with straight
> Apache.
>
> The problem is, a lot of our existing .html pages have Server Side
> Includes in them like this:
>
> <!--#include
> virtual="/global/includes/residential/resInGlobalScript.html"-->
>
> Ideally, I'd like velocity to handle these without changing the .html
> files, since there are around 10,000 of them.
>
> At minimum, I'd at least like Velocity to ignore it, rather than
> trying to process it as a velocity #include().
>
> Any ideas?
>
> Tim
>
>
> This communication is the property of Qwest and may contain
> confidential or privileged information. Unauthorized use of this
> communication is strictly prohibited and may be unlawful. If you have
> received this communication in error, please immediately notify the
> sender by reply e-mail and destroy all copies of the communication and any attachments.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org
Re: Ignoring/rewriting SSI commands with VelocityLayoutServlet
Posted by Claude Brisson <cl...@renegat.net>.
Le vendredi 27 juillet 2007 à 14:02 -0700, Nathan Bubna a écrit :
> None that i know of.
>
> Perhaps you can extend the Include directive to change it's name (to
> #import() or something, then do as Claude suggested and drop the
> orginal from the default directive.properties and add your renamed
> directive as well.
Yes, renaming it is one solution. Or escaping the # (-> \#include).
Using comments cannot work since apache won't see them.
Claude
> On 7/27/07, White, Tim <Ti...@qwest.com> wrote:
> > Right...I still want to be able to do includes. I wonder if there is a way to disable them if they are inside comments?
> >
> > -----Original Message-----
> > From: Claude Brisson [mailto:claude@renegat.net]
> > Sent: Friday, July 27, 2007 2:50 PM
> > To: Velocity Users List
> > Subject: Re: Ignoring/rewriting SSI commands with VelocityLayoutServlet
> >
> > Maybe by globally disactivating the #include directive? It is declared in the file org/apache/velocity/runtime/defaults/velocity.properties.
> >
> >
> > Claude
> >
> > Le vendredi 27 juillet 2007 à 12:31 -0600, White, Tim a écrit :
> > > So, I'm trying out an idea that would let us serve all our existing
> > > .html pages with VelocityLayoutServlet, instead of with with straight
> > > Apache.
> > >
> > > The problem is, a lot of our existing .html pages have Server Side
> > > Includes in them like this:
> > >
> > > <!--#include
> > > virtual="/global/includes/residential/resInGlobalScript.html"-->
> > >
> > > Ideally, I'd like velocity to handle these without changing the .html
> > > files, since there are around 10,000 of them.
> > >
> > > At minimum, I'd at least like Velocity to ignore it, rather than
> > > trying to process it as a velocity #include().
> > >
> > > Any ideas?
> > >
> > > Tim
> > >
> > >
> > > This communication is the property of Qwest and may contain
> > > confidential or privileged information. Unauthorized use of this
> > > communication is strictly prohibited and may be unlawful. If you have
> > > received this communication in error, please immediately notify the
> > > sender by reply e-mail and destroy all copies of the communication and any attachments.
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
> > For additional commands, e-mail: user-help@velocity.apache.org
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
> > For additional commands, e-mail: user-help@velocity.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
> For additional commands, e-mail: user-help@velocity.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org
Re: Ignoring/rewriting SSI commands with VelocityLayoutServlet
Posted by Nathan Bubna <nb...@gmail.com>.
None that i know of.
Perhaps you can extend the Include directive to change it's name (to
#import() or something, then do as Claude suggested and drop the
orginal from the default directive.properties and add your renamed
directive as well.
On 7/27/07, White, Tim <Ti...@qwest.com> wrote:
> Right...I still want to be able to do includes. I wonder if there is a way to disable them if they are inside comments?
>
> -----Original Message-----
> From: Claude Brisson [mailto:claude@renegat.net]
> Sent: Friday, July 27, 2007 2:50 PM
> To: Velocity Users List
> Subject: Re: Ignoring/rewriting SSI commands with VelocityLayoutServlet
>
> Maybe by globally disactivating the #include directive? It is declared in the file org/apache/velocity/runtime/defaults/velocity.properties.
>
>
> Claude
>
> Le vendredi 27 juillet 2007 à 12:31 -0600, White, Tim a écrit :
> > So, I'm trying out an idea that would let us serve all our existing
> > .html pages with VelocityLayoutServlet, instead of with with straight
> > Apache.
> >
> > The problem is, a lot of our existing .html pages have Server Side
> > Includes in them like this:
> >
> > <!--#include
> > virtual="/global/includes/residential/resInGlobalScript.html"-->
> >
> > Ideally, I'd like velocity to handle these without changing the .html
> > files, since there are around 10,000 of them.
> >
> > At minimum, I'd at least like Velocity to ignore it, rather than
> > trying to process it as a velocity #include().
> >
> > Any ideas?
> >
> > Tim
> >
> >
> > This communication is the property of Qwest and may contain
> > confidential or privileged information. Unauthorized use of this
> > communication is strictly prohibited and may be unlawful. If you have
> > received this communication in error, please immediately notify the
> > sender by reply e-mail and destroy all copies of the communication and any attachments.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
> For additional commands, e-mail: user-help@velocity.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
> For additional commands, e-mail: user-help@velocity.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org
RE: Ignoring/rewriting SSI commands with VelocityLayoutServlet
Posted by "White, Tim" <Ti...@qwest.com>.
Right...I still want to be able to do includes. I wonder if there is a way to disable them if they are inside comments?
-----Original Message-----
From: Claude Brisson [mailto:claude@renegat.net]
Sent: Friday, July 27, 2007 2:50 PM
To: Velocity Users List
Subject: Re: Ignoring/rewriting SSI commands with VelocityLayoutServlet
Maybe by globally disactivating the #include directive? It is declared in the file org/apache/velocity/runtime/defaults/velocity.properties.
Claude
Le vendredi 27 juillet 2007 à 12:31 -0600, White, Tim a écrit :
> So, I'm trying out an idea that would let us serve all our existing
> .html pages with VelocityLayoutServlet, instead of with with straight
> Apache.
>
> The problem is, a lot of our existing .html pages have Server Side
> Includes in them like this:
>
> <!--#include
> virtual="/global/includes/residential/resInGlobalScript.html"-->
>
> Ideally, I'd like velocity to handle these without changing the .html
> files, since there are around 10,000 of them.
>
> At minimum, I'd at least like Velocity to ignore it, rather than
> trying to process it as a velocity #include().
>
> Any ideas?
>
> Tim
>
>
> This communication is the property of Qwest and may contain
> confidential or privileged information. Unauthorized use of this
> communication is strictly prohibited and may be unlawful. If you have
> received this communication in error, please immediately notify the
> sender by reply e-mail and destroy all copies of the communication and any attachments.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org
Re: Ignoring/rewriting SSI commands with VelocityLayoutServlet
Posted by Claude Brisson <cl...@renegat.net>.
Maybe by globally disactivating the #include directive? It is declared
in the file org/apache/velocity/runtime/defaults/velocity.properties.
Claude
Le vendredi 27 juillet 2007 à 12:31 -0600, White, Tim a écrit :
> So, I'm trying out an idea that would let us serve all our existing
> .html pages with VelocityLayoutServlet, instead of with with straight
> Apache.
>
> The problem is, a lot of our existing .html pages have Server Side
> Includes in them like this:
>
> <!--#include
> virtual="/global/includes/residential/resInGlobalScript.html"-->
>
> Ideally, I'd like velocity to handle these without changing the .html
> files, since there are around 10,000 of them.
>
> At minimum, I'd at least like Velocity to ignore it, rather than trying
> to process it as a velocity #include().
>
> Any ideas?
>
> Tim
>
>
> This communication is the property of Qwest and may contain confidential or
> privileged information. Unauthorized use of this communication is strictly
> prohibited and may be unlawful. If you have received this communication
> in error, please immediately notify the sender by reply e-mail and destroy
> all copies of the communication and any attachments.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org