7 Replies Latest reply on Mar 27, 2013 10:57 PM by bondchan921

    JSP does not display properly

      this code in JSP doesn't work in jboss-5.0.0.GA-jdk6

      <%@ page import="java.text.DecimalFormat" %>
      <%DecimalFormat df = new DecimalFormat("0.00");%>
      <%=df.format(2d/0d)%>

      it shows only empty page, no exceptions

      can you explain why?

        • 1. Re: JSP does not display properly

          page must contain ? (question mark), but it's empty and if it has other content on page, then it is lost too

          • 2. Re: JSP does not display properly
            peterj

            Very interesting. I viewed the page source in the browser and have an empty page - not even the surrounding html tags! Same results with AS 5.0 and JDK 5.

            With AS 4.2.3 and JDK 5, I get the expected "?". The page source includes the surrounding HTML tag with a lone '?' in the third line of the body.

            Looking at the generated Java source for the JSP, the code to generate the page is the same, but the initialization code is slightly different - in 4.2.3 an annotation processor is declared but in 5.0 there is an instance manager.

            can you explain why?

            Perhaps it is telling you that you should not be using server-side scripts within a JSP and that you should switch to using servlets + JSP + JSTL! ;-)


            • 3. Re: JSP does not display properly

              probably problem is diffrent codes of ? (question mark)
              DecimalFormat df = new DecimalFormat("0.00");
              String test = df.format(2d/0d);
              System.out.println((int)test.charAt(0));
              System.out.println((int)"?".charAt(0));
              output:
              8734
              63
              first code does not processed properly, but why no exception.. just empty page and all content is lost..

              • 4. Re: JSP does not display properly

                same result with jboss-5.0.1.GA

                • 5. Re: JSP does not display properly

                  same result with jboss-5.1.0.GA

                  • 6. Re: JSP does not display properly
                    bondchan921

                    yeah, we have the same result in jboss-5.1.0.GA, but works under jboss-4.2.3.GA and jboss-5.1.2.EAP

                    • 7. Re: JSP does not display properly
                      bondchan921

                      seems fixex later, anyone have the bugID or any workaround ?