It's getting user defined fields from the request, and putting them in a cell next to the field. I'm trying to use the value of placeHolder as an argument to a tag-and was wondering if i embedded the tag in the body of the scriplet if that would work.
Think about for a minute and you will see why it won't work. JSP tags (custom or otherwise) are translated into servlet code along with the rest of the JSP elements (e.g. scriplets) on the page. So tags are evaluated long before the JSP is executed to produce the output.
So any tags that you put in the output are sent to the browser as is, where they are ignored.
The big question is: why on earth are you writing HTML in scriplets? You are already in a JSP page -- just use template text for the output and you wouldn't be having this problem to begin with.
Jeanne Boyarsky
,
author & internet detective
staff
Tobi, In your example, you are trying to write out an HTML tag, not a JSP tag. This is legal because the HTML is just getting output to the stream and sent to the browser. It's a lot less awkward to use the templates as Bear suggested. Take a look at the two. Which is easier to read?
Your placeholder example isn't working because the quotes aren't properly matched. (I just copied the code; I didn't correct that in my first example.) Another reason it is easier to use the JSP as a template.
[edited to add line breaks] [ February 28, 2005: Message edited by: Jeanne Boyarsky ]
I didn't write the scriplet in question-it's legacy code. I'm just trying to put some new functionality into this particular JSP-and I'm just starting to learn the in's and out's of J2EE. Thanks again for the information.
Post by:autobot
Creativity is allowing yourself to make mistakes; art is knowing which ones to keep. Keep this tiny ad:
a bit of art, as a gift, that will fit in a stocking