Jon Stevens escribió:

> This is a perfect example of why JSP sucks.

+1024 on that one.

>
>
> You have embedded HTML code within your Java code...
>
> ex:
>
> + out.println("<tr><td><b>"+key+"</b></td><td> = " + value + "</td></tr>");
>
> All programming practices tell us not to do that.

I am planning to develop a XSLT based template set for jetspeed, to avoid jsp
altogether. It will be an alternative way to use it, and it will be the one
that I will use.


In addition to other problems, jsp forces to have the java compiler available
at runtime. This causes a bunch of new problems (classpath, security,
resources, ...). I also don't like XSP because of the same reason.


Also, the error page is HTML specific, which means that it will not work with
WML, PDF, Flash or other media.

>
>
> -jon
>
> ----------
> From: Java Apache CVS Development <[EMAIL PROTECTED]>
> Reply-To: "Java-Apache Development" <[EMAIL PROTECTED]>
> Date: Fri, 12 Jan 2001 00:06:21 -0800 (PST)
> To: [EMAIL PROTECTED]
> Subject: CVS update: jetspeed/webapp/WEB-INF/templates/jsp/screens error.jsp
>
>   User: ingo
>   Date: 01/01/12 00:06:21
>
>   Modified:    webapp/WEB-INF/templates/jsp/screens error.jsp
>   Log:
>   add same functionality that turbine's error.java has
>
>   Revision  Changes    Path
>   1.2       +63 -8
> jetspeed/webapp/WEB-INF/templates/jsp/screens/error.jsp
>
>   Index: error.jsp
>   ===================================================================
>   RCS file:
> /products/cvs/jetspeed/jetspeed/webapp/WEB-INF/templates/jsp/screens/error.j
> sp,v
>   retrieving revision 1.1
>   retrieving revision 1.2
>   diff -u -r1.1 -r1.2
>   --- error.jsp    2001/01/11 16:03:06    1.1
>   +++ error.jsp    2001/01/12 08:06:20    1.2
>   @@ -1,28 +1,82 @@
>    <%@ taglib uri='/WEB-INF/templates/jsp/tld/template.tld'
> prefix='jetspeed' %>
>
>    <%@ page import = "org.apache.turbine.util.*" %>
>   +<%@ page import = "java.util.*" %>
>
>
>    <% RunData rundata = (RunData)request.getAttribute("rundata"); %>
>
>    <table border=1 cellpadding="5">
>   -  <tr>
>   -    <td>
>   -      <br>
>   -      <h2>There has been an Error</h2>
>   -    </td>
>   -  </tr>
>
>   +<% // Error Message %>
>      <tr>
>        <td>
>          <br>
>   -      <h3>Details:</h3>
>   +      <h2>There has been an Error!</h2>
>   +      Reason:
>          <pre>
>            <% out.println( rundata.stackTraceException.toString() ); %>
>          </pre>
>   -    </td>
>   +    </td>
>      </tr>
>
>   +
>   +<% // HTTP Parameters %>
>   +  <%
>   +  Enumeration keys;
>   +  String key;
>   +  String value;
>   +
>   +  keys = rundata.getParameters().keys();
>   +  if (keys.hasMoreElements()) {
>   +  %>
>   +    <tr>
>   +      <td>
>   +        <br>
>   +        <h3>Get/Post Data:</h3>
>   +          <table border=0>
>   +          <%
>   +          keys = rundata.getParameters().keys();
>   +          while ( keys.hasMoreElements() )
>   +          {
>   +              key   = (String) keys.nextElement();
>   +              value = rundata.getParameters().getString(key);
>   +              out.println("<tr><td><b>"+key+"</b></td><td> = " + value +
> "</td></tr>");
>   +          }
>   +          %>
>   +        </table>
>   +      </td>
>   +    </tr>
>   +  <%
>   +  }
>   +  %>
>   +
>   +<% // Debug Keys %>
>   +  <%
>   +  keys = rundata.varDebug.keys();
>   +  if (keys.hasMoreElements()) {
>   +  %>
>   +    <tr>
>   +      <td>
>   +        <br>
>   +        <h3>Debugging Data:</h3>
>   +          <table border=0>
>   +          <%
>   +          while ( keys.hasMoreElements() )
>   +          {
>   +              key   = (String) keys.nextElement();
>   +              value = rundata.varDebug.get(key).toString();
>   +              out.println("<tr><td><b>"+key+"</b></td><td> = " + value +
> "</td></tr>");
>   +          }
>   +          %>
>   +        </table>
>   +      </td>
>   +    </tr>
>   +  <%
>   +  }
>   +  %>
>   +
>   +<% // Stacktrace %>
>      <tr>
>        <td>
>          <br>
>   @@ -32,4 +86,5 @@
>          </pre>
>        </td>
>      </tr>
>   +
>    </table>
>
>
>
>
> --
> --------------------------------------------------------------
> To subscribe:        [EMAIL PROTECTED]
> To unsubscribe:      [EMAIL PROTECTED]
> Search: <http://www.mail-archive.com/[email protected]/>
> List Help?:          [EMAIL PROTECTED]



--
--------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/[email protected]/>
List Help?:          [EMAIL PROTECTED]

Reply via email to