jsp:declaration parsing error
It seems that orion ignored the jsp tag jsp:declaration completely. The version is 1.4.5: ## # jsp code fragment: ## ...skip... jsp:scriptlet FormBuilder fb = new FormBuilder(lp_context); /jsp:scriptlet jsp:declaration private static final String[] toStringArray(int[] ori_array){ String [] str_array = new String[ori_array.length]; for (int i = 0; i ori_array.length; i++){ str_array[i] = String.valueOf(ori_array[i]); } return str_array; } /jsp:declaration skip ## # java code fragment after transformation: ## ...skip... FormBuilder fb = new FormBuilder(lp_context); out.write("\r\n\r\njsp:declaration\r\n\r\nprivate static final String[] toStringArray(int[] ori_array){\r\n\tString [] str_array = new String [ori_array.length];\r\n\tfor (int i = 0; i ori_array.length; i++){\r\n\t\tstr_array[i] = String.valueOf(ori_array[i]);\r\n\t}\r\n\treturn str_array;\r\n}\r\n\r\n ...skin...
Re: jsp:declaration parsing error
It's in here: ### # Extracted from JavaServer Pages Specification Version 1.1 ### 7.4.1 Declarations In the XML document corresponding to JSP pages, declarations are represented using the syntax: jsp:declaration declaration goes here /jsp:declaration For example, the second example from Section 2.10.1: %! public String f(int i) { if (i3) return("..."); ... } % is translated using a CDATA statement to avoid having to quote the "" inside the jsp:declaration. jsp:declaration ![CDATA[ public String f(int i) { if (i3) return("..."); } ]] /jsp:declaration DTD Fragment !ELEMENT jsp:declaration (#PCDATA) === By the way, the jsp directive is like this : %@ % but you are right, %! ... % is the jsp declaration tag. My problem is using these jsp tag inside an XML document will cause major headache because it makes the XML not well-formed. Though it can be solved by using DTD parameter entitis and some other tricks but the most elegant solution is the jsp:declaration tag, in the spec. - Original Message - From: "Rafael Alvarez" [EMAIL PROTECTED] To: "Orion-Interest" [EMAIL PROTECTED] Sent: Friday, April 20, 2001 10:00 PM Subject: Re: jsp:declaration parsing error Hello doggie, I can't find the jsp:declaration tag anywhere in the spec, but it sounds like the %! % directive. Try using: %! private static final String[] toStringArray(int[] ori_array){ String [] str_array = new String[ori_array.length]; for (int i = 0; i ori_array.length; i++){ str_array[i] = String.valueOf(ori_array[i]); } return str_array; } % It seems that orion ignored the jsp tag jsp:declaration completely. -- Best regards, Rafaelmailto:[EMAIL PROTECTED]
Re: Re[2]: jsp:declaration parsing error
Hi Rafael, I have difficulty to tell whether the meaning of the 1.1 spec is, since it didn't use the more familiar words like MUST or MAY to describe it. (and English is not my domain language.) Orion 1.4.5 support almost all the other xml equivalent tags defined in the spec such as jsp:directive, jsp:scriptlet, and jsp:expression. But, as you pointed out, the xml equivalent tags cannot be mixed with the traditional jsp syntax in the same file, with means that the lack of support of one single tag will cause all the rest of them practically useless because it can't be substituted by the old fashion %! ... % alone. I just wonder why the declaration tag has been "chosen" to be left alone while the rest are supported. - Original Message - From: "Rafael Alvarez" [EMAIL PROTECTED] To: "Orion-Interest" [EMAIL PROTECTED] Sent: Saturday, April 21, 2001 3:54 AM Subject: Re[2]: jsp:declaration parsing error Hello doggie, Thanks for pointing it out. I misses it entirely! I found something interesting in the Specs: ### # Extracted from JavaServer Pages Specification Version 1.1 ### 7 JSP Pages as XML Documents The JSP page to XML document mapping is not visible to JSP 1.1 containers; it will receive substantial emphasis in the next releases of the JSP specification. Since the mapping has not received great usage, we particularly encourage feedback in this area. == ### # Extracted from JavaServer Pages Specification Version 1.2 ### 2.1.2 XML Document for a JSP Page All JSP pages have an equivalent XML document. This equivalent XML document is the view of the JSP page that is exposed to the translation phase (see below). A JSP page can also be written directly as its equivalent XML document. Unlike in JSP 1.0 and JSP 1.1 containers, the XML document itself can be delivered to a JSP container for processing. It is not valid to intermix "standard syntax" and XML syntax inside the same source file. A JSP page (in either syntax) can include via a directive a JSP page in either syntax. As I understood (please, correct me if I'm wrong) the JSP 1.1 container is not forced to accept the XML representation. But Orion is suppose to implement JSP 1.2 features, so I don't know. Perhaps they left it out because there is not sure if it will be in the final draft. Best Regards mailto:[EMAIL PROTECTED] Rafael Alvarez