Hi All, I was trying to templatize some JSP page I would like to dynamically generates but it looks like puppet doesn''t like it. Common JSP tags are <% ... %> so I guess it''s getting confused between regular tags and jsp''s one. This is an example of the trace it is givin me : /etc/puppet/modules/xxx/templates/webapps/xxx/yyy/Mantle.jsp:1:in `result'':> compile error (SyntaxError) > /etc/puppet/modules/xxx/templates/webapps/xxx/yyy/Mantle.jsp:1: syntax > error, unexpected tIDENTIFIER, expecting $end >Is there any know way to deal with JSP pages ? Thanks all, -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/q83caZg6ZV0J. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Felix Frank
2012-Jul-23 07:26 UTC
Re: [Puppet Users] Puppet template tags and Java JSP tags
Hi, On 07/22/2012 04:02 AM, Yanis Guenane wrote:> Hi All, > > I was trying to templatize some JSP page I would like to dynamically > generates but it looks like puppet doesn''t like it. > > Common JSP tags are <% ... %> so I guess it''s getting confused between > regular tags and jsp''s one. > > This is an example of the trace it is givin me : > > /etc/puppet/modules/xxx/templates/webapps/xxx/yyy/Mantle.jsp:1:in > `result'': compile error (SyntaxError) > /etc/puppet/modules/xxx/templates/webapps/xxx/yyy/Mantle.jsp:1: > syntax error, unexpected tIDENTIFIER, expecting $end > > > Is there any know way to deal with JSP pages ?I don''t know of a simple way. You probably need to escape all JSP tags (which doesn''t seem to be worth the hassle, really ;) Cheers, Felix -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
jcbollinger
2012-Jul-23 12:57 UTC
[Puppet Users] Re: Puppet template tags and Java JSP tags
On Saturday, July 21, 2012 9:02:50 PM UTC-5, Yanis Guenane wrote:> > Hi All, > > I was trying to templatize some JSP page I would like to dynamically > generates but it looks like puppet doesn''t like it. > > Common JSP tags are <% ... %> so I guess it''s getting confused between > regular tags and jsp''s one. > > This is an example of the trace it is givin me : > > /etc/puppet/modules/xxx/templates/webapps/xxx/yyy/Mantle.jsp:1:in >> `result'': compile error (SyntaxError) >> /etc/puppet/modules/xxx/templates/webapps/xxx/yyy/Mantle.jsp:1: syntax >> error, unexpected tIDENTIFIER, expecting $end >> > > Is there any know way to deal with JSP pages ? >ERB is the Ruby analog to the templating aspects of JSP, even sporting overlapping syntax (as you discovered). If you must create a JSP page by processing a template with ERB, then any literal JSP tag delimiters in the ERB template must be escaped. The Ruby docs for class ERB give the syntax: <%% maps to <%, and %%> maps to %>. You''ll have to decide whether that''s worthwhile, or whether to look for a better way. For sure, if there are many JSP tags or much scriptlet code in your JSP, then it is already difficult enough to read and maintain before you convert it into an ERB template. John -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/lc4vIc2XSPIJ. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Yanis Guenane
2012-Jul-24 15:36 UTC
[Puppet Users] Re: Puppet template tags and Java JSP tags
Thanks a lot to both of you. Effectively, escaping the JSP opening tag with <%% made the trick. The closing tag needs not to be closed. It is not interpreted in anyway. @John : Thanks for the complementaries informations to do it with ERB. On Monday, July 23, 2012 2:57:13 PM UTC+2, jcbollinger wrote:> > > > On Saturday, July 21, 2012 9:02:50 PM UTC-5, Yanis Guenane wrote: >> >> Hi All, >> >> I was trying to templatize some JSP page I would like to dynamically >> generates but it looks like puppet doesn''t like it. >> >> Common JSP tags are <% ... %> so I guess it''s getting confused between >> regular tags and jsp''s one. >> >> This is an example of the trace it is givin me : >> >> /etc/puppet/modules/xxx/templates/webapps/xxx/yyy/Mantle.jsp:1:in >>> `result'': compile error (SyntaxError) >>> /etc/puppet/modules/xxx/templates/webapps/xxx/yyy/Mantle.jsp:1: syntax >>> error, unexpected tIDENTIFIER, expecting $end >>> >> >> Is there any know way to deal with JSP pages ? >> > > ERB is the Ruby analog to the templating aspects of JSP, even sporting > overlapping syntax (as you discovered). If you must create a JSP page by > processing a template with ERB, then any literal JSP tag delimiters in the > ERB template must be escaped. The Ruby docs for class ERB give the syntax: > <%% maps to <%, and %%> maps to %>. > > You''ll have to decide whether that''s worthwhile, or whether to look for a > better way. For sure, if there are many JSP tags or much scriptlet code in > your JSP, then it is already difficult enough to read and maintain before > you convert it into an ERB template. > > > John > >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/-ZMSFkockmwJ. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.