I am creating an email form in jsp. I have the form coded so that the
fields replace variables in a text document that is emailed to the
reciever. That code is fine. A co-worker helped me set it up, and the
replace function works fine. However when he set it up, he had me code
the form so that the variables in the text document were being replaced
by actual names. Basically when I tried to test the form, this is what
happened.
This is one of my lines of code. lname is field name, so I wanted the
code to replace
%_lname% in the text document with the contents of the field lname on
my form. In actuality the code replaced %_lname% with the words lname.
content=content.replaceAll("%_lname%","lname");
I tried the following code to remedy the situation but that didn't work
either.
content=content.replaceAll["%_lname%",request.getParameter("lname")];
I am a beginner coder, so does anyone have any suggestions?
Thanks,
Lindsay
Oliver Wong - 12 Jun 2006 19:09 GMT
> I tried the following code to remedy the situation but that didn't work
> either.
>
> content=content.replaceAll["%_lname%",request.getParameter("lname")];
>
> I am a beginner coder, so does anyone have any suggestions?
Try using round brackets, as in
content=content.replaceAll("%_lname%",request.getParameter("lname"));
Next time, quote the exact error message you received. See
http://riters.com/JINX/index.cgi/Suggestions_20for_20Asking_20Questions_20on_20N
ewsgroups#RepeatErrorsExactly
- Oliver