Re: encoding ok with jsp but not with velocity

2005-05-31 Thread David Sperling
After working on this for a couple days I've got some new info: 1. clicking submit from the jsp and vm pages causes request.getContentType()) to produce the following: working jsp: multipart/form-data; boundary=... broken vm: null 2. velocity log shows the following: [info]

Re: encoding ok with jsp but not with velocity

2005-05-31 Thread Simon Christian
Hi David, I can't really comment on most of your query, but I notice that the form in your JSP has the 'enctype=multipart/form-data' attribute, but the equivalent VM page doesn't appear to have the same attribute. Might that be causing the difference? - simon David Sperling wrote: After

parse custom markers

2005-05-31 Thread Katrin Möller
I'm trying to parse a given template containing custom markers. Sample template: sometext $KEY$ sometext The easyiest way would be to parse it with a VelocityContext containing KEY as a marker: context.put(KEY,value); The parsed String is then sometext value$ sometext. This is nasty because first,

Re: encoding ok with jsp but not with velocity

2005-05-31 Thread David Sperling
I figured out the problem. After adding enctype and method tags to the form tag everything worked fine. /**/ Was: form action=$link.setAction('AddOutdoorReservation') /**/ Now: form

Re: parse custom markers

2005-05-31 Thread Adam Williams
Hello, Katrin. Do you want the product to contain $KEY$? If so, you need to escape that first $. You've likely seen http://jakarta.apache.org/velocity/user-guide.html#Escaping%20Valid%20VTL%20References adam On 5/31/05, Katrin Möller [EMAIL PROTECTED] wrote: I'm trying to parse a given

Re: parse custom markers

2005-05-31 Thread Katrin Möller
Hi Adam, no, the result should not contain the $-signs. The well parsed template should look like this: sometext value sometext Cheers, Katrin On 5/31/05, Adam Williams [EMAIL PROTECTED] wrote: Hello, Katrin. Do you want the product to contain $KEY$? If so, you need to escape that first $.

RE: Performance tuning and Velocity

2005-05-31 Thread Withers John Z
Malcolm, Thanks for your response. I hesitated at including too many details in case I just needed to RTFM. As it turns out, that's exactly what I needed to do. I have #parse embedded in a #foreach loop and I had template caching turned off. Since I've turned it on, the resulting application

Servlet Resource Loader: Webapp, then classpath

2005-05-31 Thread Eric Fixler
Hi all. I'm doing a Velocity/Struts app, and I'd like to set up VelocityViewServlet so that, in response to a template request, it first tries the WebappResourceLoader, and then, if there's no appropriate document there, a ClasspathResourceLoader. Looking at VelocityViewServlet, it

Re: Servlet Resource Loader: Webapp, then classpath

2005-05-31 Thread Nathan Bubna
you should be able to configure your velocity.properties as you would with any other velocity application. yours will look someting like resource.loader=webapp,classpath webapp.resource.loader.class=...WebappLoader classpath.resource.loader.class=...ClasspathResourceLoader and so on... be sure

Re: Servlet Resource Loader: Webapp, then classpath

2005-05-31 Thread Eric Fixler
Thanks Nathan! eric On May 31, 2005, at 14:00, Nathan Bubna wrote: you should be able to configure your velocity.properties as you would with any other velocity application. yours will look someting like resource.loader=webapp,classpath webapp.resource.loader.class=...WebappLoader

Re: Newbie needs help

2005-05-31 Thread jian chen
It seems like an html issue with the img src url not correct. Try putting some text in the if/else and see which one gets called. Something like this: #if ($needMoreInfo == 'Y' ) ##img src=images/needmoreinfo.gif image is displayed here #else ##img src=images/1x1.gif another

RE: Newbie needs help

2005-05-31 Thread Michael_W_Nance
Thanks Jian, But the img src is correct I have tried several different things And the if seems to always fall through to the else section even though I know I Have 2 conditions that meet the if condition. I am very new to Velocity, can it be due to it be evaluated on the server? -Original

Re: Newbie needs help

2005-05-31 Thread jian chen
Hi, Michael, What did you pass in to the velocity context? I think it should be: ctx.put(needMoreInfo, Y); Or, You could set it in another way in your java code: ctx.put(needMoreInfo, Boolean.TRUE); Then, in the Velocity template, you will put: #if ($needMoreInfo) img

Re: Newbie needs help

2005-05-31 Thread Jason Pettiss
Yeah, #if ($needMoreInfo == 'Y' ) will only succeed if $needMoreInfo is in the context, is of type String, and has value Y. Put a [$needMoreInfo] right before the if and see that you get a [Y] in your output. Also, try using a #set( $needMoreInfo = 'Y' ) right before the if... that should