Greg, Thanks. Finally a thorough answer that makes sense. I really appreciate it.
-jeff --- Greg Trasuk <[EMAIL PROTECTED]> wrote: > The first snippet works if and only if your jsp > file is entirely > XML-formatted. Specifically, you need to: > > (1) have an xml declaration at the beginning of the > file (i.e <?xml > version='1.0'?>). > (2) Enclose the whole thing in a <jsp:root> element > with the correct > namespace (see the spec for details) > (3) Ensure that the whole document is well-formed > XML (i.e. start tags have > end tags, tags nest properly, attributes are quoted, > etc). > > In (3) lies the rub, especially if you're > generating HTML. HTML is not, > and cannot be well-formed, so you have to enclose > your HTML portions in a > CDATA section. It's a lot of extra work if you're > editing jsp files by > hand. Hence Craig's comment that the XML syntax is > for tools, not people. > It's intended for auto-generation, IDE-type editors, > etc, not for generating > jsp files manually. > > To make things a little more confusing, at least > one container (IBM > Websphere) seems to accept XML syntax as direct > subsitution for the JSP > syntax, but it's in violation of the JSP specs and > you should stick to the > spec to ensure portability. You can get the spec > at: > http://jcp.org/aboutJava/communityprocess/first/jsr053/index.htmlhttp://jcp. > org/aboutJava/communityprocess/first/jsr053/index.html > > Short answer- you can and probably should forget > about the XML syntax for > JSP pages. > > Cheers, > > Greg Trasuk, President > StratusCom Manufacturing Systems Inc. - We use > information technology to > solve business problems on your plant floor. > http://stratuscom.ca > > >-----Original Message----- > >From: Jeff Ousley [mailto:[EMAIL PROTECTED]] > >Sent: January 13, 2003 16:16 > >To: Tomcat Users List > >Subject: Re: jsp versus xml syntax > > > > > >So, under tomcat 4.1 am I not able to do this: > > > ><jsp:declaration> > >// this is a local "helper" bean for processing the > >HTML form > >static public class localBean > >{ > > private String value; > > public String getValue() { return > value;} > > public void setValue(String s) { value = s; } > >} > ></jsp:declaration> > > > > > >but instead have to do this: > > > ><%! > >// this is a local "helper" bean for processing the > >HTML form > >static public class localBean > >{ > > private String value; > > public String getValue() { return > value;} > > public void setValue(String s) { value = s; } > >} > >%> > > > > > >>From everything I can tell/read, the first snippet > >(using the xml syntax) should work, but I can't > seem > >to get it to. > > > >thanks! > >-jeff > >--- Robert Horton <[EMAIL PROTECTED]> > >wrote: > >> Hi, > >> > > >> > I think I'm having trouble first of all because > >> much > >> > of the syntax is in xml form not jsp form. Is > this > >> > correct? How do I use the xml syntax under > tomcat > >> 4? > >> > I'm very new and still learning. > >> > >> It goes: > >> > >> jsp -> xml (or html) -> rendered by browser > >> > >> i.e. the jsp is executed by the server to produce > >> the xml (being a > >> superset of html) which is then passed to the > >> browser. > >> > >> Hope that helps, > >> R > >> > >> -- > >> To unsubscribe, e-mail: > >> > <mailto:[EMAIL PROTECTED]> > >> For additional commands, e-mail: > >> <mailto:[EMAIL PROTECTED]> > >> > > > > > >__________________________________________________ > >Do you Yahoo!? > >Yahoo! Mail Plus - Powerful. Affordable. Sign up > now. > >http://mailplus.yahoo.com > > > >-- > >To unsubscribe, e-mail: > ><mailto:tomcat-user->[EMAIL PROTECTED]> > >For > >additional commands, > >e-mail: > <mailto:[EMAIL PROTECTED]> > > > > > -- > To unsubscribe, e-mail: > <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: > <mailto:[EMAIL PROTECTED]> > __________________________________________________ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>