Generating excel sheets through JSP

  • Follow


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?
0
Reply ruds 3/16/2008 6:37:45 AM

On Mar 16, 5:37=A0pm, ruds <rudra...@gmail.com> wrote:
=2E..
> 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.
0
Reply Andrew 3/16/2008 6:46:12 AM


the file is getting created but the data is not there..

0
Reply ruds 3/16/2008 8:19:13 AM

On Mar 16, 7:19=A0pm, ruds <rudra...@gmail.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
0
Reply Andrew 3/16/2008 9:06:05 AM

On Mar 16, 8:06=A0pm, Andrew Thompson <andrewtho...@gmail.com> wrote:
> On Mar 16, 7:19=A0pm, ruds <rudra...@gmail.com> wrote:
=2E..
> ( * 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
0
Reply Andrew 3/16/2008 9:38:53 AM

> Is there any chance of 'swallowing exceptions'
> within a JSP? =A0I 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=3D"c" uri=3D"http://www.java.sun.com/jsp/jstl/core" %>

<c:catch var=3D"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,

0
Reply diz4tech 3/16/2008 3:29:29 PM

diz4tech@gmail.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
0
Reply Lew 3/16/2008 5:17:14 PM

Andrew Thompson wrote:
> On Mar 16, 8:06 pm, Andrew Thompson <andrewtho...@gmail.com> wrote:
>> On Mar 16, 7:19 pm, ruds <rudra...@gmail.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�
0
Reply ISO 3/16/2008 6:52:20 PM

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.
0
Reply Mark 3/16/2008 8:47:56 PM

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
0
Reply ISO 3/16/2008 11:06:33 PM

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
0
Reply ISO 3/16/2008 11:10:11 PM

In article 
<3d307e1c-44e2-4e86-9f11-1339fb90d277@s13g2000prd.googlegroups.com>,
 Andrew Thompson <andrewthommo@gmail.com> wrote:
> On Mar 16, 7:19�pm, ruds <rudra...@gmail.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
0
Reply Tim 3/17/2008 4:48:40 AM

11 Replies
330 Views

(page loaded in 0.141 seconds)

Similiar Articles:


















7/17/2012 7:28:39 AM


Reply: