Generating excel sheets through JSP  
Author Message
ruds





PostPosted: 2008-3-16 14:38:00 Top

java-programmer, Generating excel sheets through JSP Hi,
I have previously created excel sheets in JSP in weblogic, and i get
the result accurately.
I had used;
<%@ page contentType="application/vnd.ms-excel" import="java.sql.*"
language="java"%>
at the top of the page and,
<meta http-equi="Content-Type" content="application/vnd.ms-excel;
charset=iso-8859-1">
in the head tag of my page.
Now I'm using tomcat 5.5 and this is just not working....
Can someone help me out with this?
 
Andrew Thompson





PostPosted: 2008-3-16 14:46:00 Top

java-programmer >> Generating excel sheets through JSP On Mar 16, 5:37爌m, ruds <email***@***.com> wrote:
...
> Now I'm using tomcat 5.5 and this is just not working....

Lazy is it?* Try beating it with a stick, or
alternately, offer it inducements - like cash.

* WTF does 'not working' mean?

Andrew T.
 
ruds





PostPosted: 2008-3-16 16:19:00 Top

java-programmer >> Generating excel sheets through JSP the file is getting created but the data is not there..

 
 
Andrew Thompson





PostPosted: 2008-3-16 17:06:00 Top

java-programmer >> Generating excel sheets through JSP On Mar 16, 7:19爌m, ruds <email***@***.com> wrote:
> the file is getting created but the data is not there..

Thanks for clarifying. Now hopefully someone* who
is experienced with WebSphere and Tomcat can explain
the difference in behaviour.

( * I can offer no useful suggestions, so I will bow
out of the thread now. Hope you get it sorted. )

Andrew T.
PhySci.org
 
 
Andrew Thompson





PostPosted: 2008-3-16 17:39:00 Top

java-programmer >> Generating excel sheets through JSP On Mar 16, 8:06爌m, Andrew Thompson <email***@***.com> wrote:
> On Mar 16, 7:19爌m, ruds <email***@***.com> wrote:
...
> ( * I can offer no useful suggestions, ..

But now I think about it, I will ask a general
question re JSP of anybody that can answer it.

Is there any chance of 'swallowing exceptions'
within a JSP? I did some JSP, but my recollection
is fuzzy.

And to the OP. Do you understand what I mean by
'swallow exceptions'? OK.. since I'm here, the
general form would be

try {
// something that might fail
catch(Exception e) {
//do nothing useful with the information
// and continue
}

That owuld be 'swallowing an exception'.

Whereas the way to do the opposite (*not*
swallow exceptions) would be to..

try {
// something that might fail
catch(Exception e) {
// be very verbose about what went wrong
e.printStackTrace();
}

How long is the JSP file? If it is short, it
may pay to post it to this thread.

Andrew T.
PhySci.org
 
 
diz4tech





PostPosted: 2008-3-16 23:29:00 Top

java-programmer >> Generating excel sheets through JSP > Is there any chance of 'swallowing exceptions'
> within a JSP? 營 did some JSP, but my recollection
> is fuzzy.

Hi Friends,

Ruds, am realy sorry- i dont have any idea abt ur query, hope somebody
else will clarify it.

Thompson,

JSTL provides library tags to maintain Exceptions in JSP pages
& is

<%@ taglib prefix="c" uri="http://www.java.sun.com/jsp/jstl/core" %>

<c:catch var="sampleExc">

- code -

</c:catch>

By this JSP container will handle the exception, using the custom var
we can able to display the type of error occured in the later part of
the code.

Thank you,

 
 
Lew





PostPosted: 2008-3-17 1:17:00 Top

java-programmer >> Generating excel sheets through JSP email***@***.com wrote:
> Ruds, am realy sorry- i [sic] dont have any idea abt ur query, hope somebody
> else will clarify it.

Sure:
<http://en.wikipedia.org/wiki/Ur>

And it's spelled with an upper-case "U".

--
Lew
 
 
Roger Lindsj





PostPosted: 2008-3-17 2:52:00 Top

java-programmer >> Generating excel sheets through JSP Andrew Thompson wrote:
> On Mar 16, 8:06 pm, Andrew Thompson <email***@***.com> wrote:
>> On Mar 16, 7:19 pm, ruds <email***@***.com> wrote:
> ...
>> ( * I can offer no useful suggestions, ..
>
> But now I think about it, I will ask a general
> question re JSP of anybody that can answer it.
>
> Is there any chance of 'swallowing exceptions'
> within a JSP? I did some JSP, but my recollection
> is fuzzy.

You could of course use <% try } %>
... JSP code ...
<% } catch (Exception e) {} %>

or use JSTL core.
<c:catch var="e">
... JSP code ...
</c:catch>
<c:if test="${e != null}">
Exception ${e}
</c:if>

--
Roger Lindsj?
 
 
Mark Space





PostPosted: 2008-3-17 4:48:00 Top

java-programmer >> Generating excel sheets through JSP ruds wrote:
> Hi,
> I have previously created excel sheets in JSP in weblogic, and i get
> the result accurately.
> I had used;
> <%@ page contentType="application/vnd.ms-excel" import="java.sql.*"
> language="java"%>
> at the top of the page and,
> <meta http-equi="Content-Type" content="application/vnd.ms-excel;
> charset=iso-8859-1">
> in the head tag of my page.
> Now I'm using tomcat 5.5 and this is just not working....
> Can someone help me out with this?

Can you show us the complete JSP? That would be a start.
 
 
Arne Vajh鴍





PostPosted: 2008-3-17 7:07:00 Top

java-programmer >> Generating excel sheets through JSP Andrew Thompson wrote:
> But now I think about it, I will ask a general
> question re JSP of anybody that can answer it.
>
> Is there any chance of 'swallowing exceptions'
> within a JSP? I did some JSP, but my recollection
> is fuzzy.

It is possible to catch exceptions in Java code embedded
in or called from a JSP page.

It is also possible to redirect to an error page
in case of an exception.

My assumption would be that if someone is capable of using
either of those techniques, then are also able to
troubleshoot effectively. They are not something that
get added standard.

Arne
 
 
Arne Vajh鴍





PostPosted: 2008-3-17 7:10:00 Top

java-programmer >> Generating excel sheets through JSP ruds wrote:
> I have previously created excel sheets in JSP in weblogic, and i get
> the result accurately.
> I had used;
> <%@ page contentType="application/vnd.ms-excel" import="java.sql.*"
> language="java"%>
> at the top of the page and,
> <meta http-equi="Content-Type" content="application/vnd.ms-excel;
> charset=iso-8859-1">
> in the head tag of my page.
> Now I'm using tomcat 5.5 and this is just not working....

Are you generating CSV or XLS format ?

Generating XLS format from JSP is error prone. You should
use a servlet for that.

Generating CSV should be possible from JSP even though I would
still recommend a servlet.

An empty file has nothing to do with the content type, so
we need more info.

Arne
 
 
Tim Smith





PostPosted: 2008-3-17 12:49:00 Top

java-programmer >> Generating excel sheets through JSP In article
<email***@***.com>,
Andrew Thompson <email***@***.com> wrote:
> On Mar 16, 7:19爌m, ruds <email***@***.com> wrote:
> > the file is getting created but the data is not there..
>
> Thanks for clarifying. Now hopefully someone* who
> is experienced with WebSphere and Tomcat can explain
> the difference in behaviour.
>
> ( * I can offer no useful suggestions, so I will bow
> out of the thread now. Hope you get it sorted. )

Empty output is sorted, so he's OK there. :-)



--
--Tim Smith