Re: [OT] Re: ajax proj
On 5/2/05, Jason Lea <[EMAIL PROTECTED]> wrote: > Just a quick note/question about Craig's code below: > > This line > > ${category.label} > > will output the value with not xml filtering, so some values will cause > incorrect xml to be generated. > > You should use tag to filter the <,>,',", and & characters to > output <, >, ', ", and & > > > > and the same for the element > Yep ... +1 on that suggestion. Craig - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Re: ajax proj
Just a quick note/question about Craig's code below: This line ${category.label} will output the value with not xml filtering, so some values will cause incorrect xml to be generated. You should use tag to filter the <,>,',", and & characters to output <, >, ', ", and & and the same for the element Craig McClanahan wrote: On 5/2/05, Woodchuck <[EMAIL PROTECTED]> wrote: JSTL is da bomb! :) Indeed it is. If you actually need to create XML in a response to an XmlHttpRequest call from an Ajax client side gadget :-), here's an approach using a JSP 2.0 page (in xml syntax) that uses JSTL to iterate over a result set, and JSP expressions to pull out the data (copied from the Shale Use Cases example app): http://java.sun.com/jsp/jstl/core"; xmlns:jsp="http://java.sun.com/JSP/Page";> ${category.label} ${category.value} The business logic that looks up the label/value pairs for the response doesn't have a clue how it will actually be rendered, and setting up a JSP page is much easier to author than building an XML DOM in Java code. Craig --- Rick Reumann <[EMAIL PROTECTED]> wrote: Dakota Jack wrote the following on 5/2/2005 4:01 PM: The other aspect that is not discussed above is the removal of the complexity from the "page". This is where JSP, Taglibs, etc., come into the picture. And, I suspect, you two are talking about a combination of this problem (keeping the page simple) and the previous problem (using a reasonable architecture). yes. For example, take a table sort example. I like being able to use JSTL (or even a display tag if that suits you) to display the collection info into the display of the table. Doing something like this within a servlet (Action) wouldn't really be wrong, but just more difficult to maintain and more of pain to code (using StringBuffer and append bla bla). -- Rick -- Jason Lea
Re: [OT] Re: ajax proj
Woodchuck wrote: JSTL is da bomb! :) Does this mean... we can drop it? Eh, it's Friday, whaddya want. Seriously, I hate all that typing-JSP 2.0 may save my wrists. Dave "What do you mean, Monday?" Newton - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Re: ajax proj
On 5/2/05, Woodchuck <[EMAIL PROTECTED]> wrote: > JSTL is da bomb! :) Indeed it is. If you actually need to create XML in a response to an XmlHttpRequest call from an Ajax client side gadget :-), here's an approach using a JSP 2.0 page (in xml syntax) that uses JSTL to iterate over a result set, and JSP expressions to pull out the data (copied from the Shale Use Cases example app): http://java.sun.com/jsp/jstl/core"; xmlns:jsp="http://java.sun.com/JSP/Page";> ${category.label} ${category.value} The business logic that looks up the label/value pairs for the response doesn't have a clue how it will actually be rendered, and setting up a JSP page is much easier to author than building an XML DOM in Java code. Craig > > --- Rick Reumann <[EMAIL PROTECTED]> wrote: > > Dakota Jack wrote the following on 5/2/2005 4:01 PM: > > > > > > The other aspect that is not discussed above is the removal of the > > > complexity from the "page". This is where JSP, Taglibs, etc., come > > > into the picture. And, I suspect, you two are talking about a > > > combination of this problem (keeping the page simple) and the > > previous > > > problem (using a reasonable architecture). > > > > yes. For example, take a table sort example. I like being able to use > > > > JSTL (or even a display tag if that suits you) to display the > > collection > > info into the display of the table. > > > > Doing something like this within a servlet (Action) wouldn't really > > be > > wrong, but just more difficult to maintain and more of pain to code > > (using StringBuffer and append bla bla). > > > > -- > > Rick > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > __ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[OT] Re: ajax proj
JSTL is da bomb! :) --- Rick Reumann <[EMAIL PROTECTED]> wrote: > Dakota Jack wrote the following on 5/2/2005 4:01 PM: > > > > The other aspect that is not discussed above is the removal of the > > complexity from the "page". This is where JSP, Taglibs, etc., come > > into the picture. And, I suspect, you two are talking about a > > combination of this problem (keeping the page simple) and the > previous > > problem (using a reasonable architecture). > > yes. For example, take a table sort example. I like being able to use > > JSTL (or even a display tag if that suits you) to display the > collection > info into the display of the table. > > Doing something like this within a servlet (Action) wouldn't really > be > wrong, but just more difficult to maintain and more of pain to code > (using StringBuffer and append bla bla). > > -- > Rick > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]