At 18:51 01/13/01, Santiago Gala wrote:
>Jon Stevens escribió:
>
> > This is a perfect example of why JSP sucks.
>
>+1024 on that one.
True, it was a quick hack, just copied the code out of Error.java. But
you'll admit that generating the error screen ecs based isn't better.
Usually I would process everything in the calling code, place a JavaBean in
the request and only read this bean in the JSP. However using a JavaBean is
no option for the _error_ page, as when the error occurs, it might be
already too late to execute a respective action...
I tried to clean it up a bit but I dont like those many <open code> <close
code> tags either. BTW, I wanted to rename error.jsp to Error.jsp to make
sure that there won't be trouble with unix file systems, but deleting a
file and adding it with uppercase letters didn't work in CVS. So I renamed
the file to ErrorGeneral.jsp meaning that it'll display all errors that
don't have their specific error screen.
> >
> >
> > 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.
Even if JSPs won't stay the standard tempalting system, we should continue
to support it - it's still some sort of an industry standard...
>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.
Yes, it's currently HTML specific. But so is the Login page, Edit Account
and basically all other screens except the Home screen. If we are honest,
Jetspeed (and turbine) are both still biased towards HTML. But a mechanism
like the one used for the layout JSP would easily allow to have error pages
specific to the output format.
ingo.
> >
> >
> > -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]
--
--------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/[email protected]/>
List Help?: [EMAIL PROTECTED]