JSP to Excel question

Hi,
I have a jsp page that renders data from a result set (queried from database).
A button on this pages calls a 2nd page that I want to re-query and open excel with the data.
This all works except that there are a number of blank likes at the top of the excel page, prior to my data. These relate to declatations at the top of my page. i.e
<%@ page import="java.io.*" %>
and
<jsp:useBean id="AccountDetailsBean" class="com.xxx.yyy.zzz.AccountDetailsBean" scope="session" />
This will give 2 blank lines. I assume that this is because they are essentially being treated as HTML comment lines.
How can I avoid this? Can I declare these within the main JSP servlet?
Thanks for any assistance.

However, remember that the parameters in GET requests are logged in the
server log so whatever information you send to the server via a GET, remains
logged and available to whoever has access to your logs. Shouldn't be many,
but should that information get to the people who run a log analyzer to get
statistics on the server usage?
POST is better because the parameters are sent in the body of the request
and the body is not logged.
SSL needs to be used in both cases.
"Dror Avinun" <[email protected]> wrote in message
news:3affe4b3$[email protected]..
>
All the SSL encryption is done in the socket layer and all of the HTTPcommunication
is encrypted. This means that both the request (yout "GET" command) andresponse
are secured.
cheers,
Dror
"Asher Bitton" <[email protected]> wrote:
Hi,
I'm using https to call from an excel application to a weblogic jsp page,
my question is whether the url that excel sends (for example:
"https://mypc:7002/mydir/myfile.jsp?myvar1=val1&myvar2=val2")
gets also encrypted\secured, what I'm interested to know is whether the
parameters sent using the http "get" method are secure?
Where can I find some information regarding the https implementation
thanks.

Similar Messages

  • Need help in writing data from JSP to excel

    Hi ,
    I need help in writing the data from JSP to excel.I somehow able to retrieve the data into excel but unable to get the required format.
    For eg: The amount should be displayed in 0.00 format .when i am exporting it to excel it is displaying as 0 :( .
    I am using the following code in JSP.
    "out.print(amt + '\t');"
    Would like to know if there is any otherway where in i can get my requirement.
    Thanks
    Tom

    Hi,
    Try using format part of the JSTL tag libs.
    Syntax :
    <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
    <fmt:formatNumber value="40" pattern="$#,##0.00"/>
    I need help in writing the data from JSP to excel.I
    somehow able to retrieve the data into excelHow do u convert the jsp to excel?
    One way to convert the jsp page to excel, is to render it as an excel appl instead of html. Set the content type of the response to application/ms-excel.
    response.setContentType("application/ms-excel")Hope this Helps....

  • Problem on exporting images from jsp to excel

    i had exported content of jsp to excel, but the problem is i couldn't able to export images present in jsp to excel.
    the images are present in
    webapplication / images directory.
    guys if you know any way please let me know
    code which i used for exporting was
    <%
         response.setContentType("application/vnd.ms-excel; charset=UTF-8");
         response.setHeader("content-disposition","attachment; filename=test.xls");
    %>Message was edited by:
    mohaideenkhaja

    If Somebody have the solution the please let me know......................
    Thx

  • Export data from JSP to Excel on click on button

    Hi,
    I want to display the table data in my Jsp to Excel on click of "Export to Excel" icon, The data in my jsp table is dynamic, only click of "export to Excel" icon i want the contents of the table needs to be exported to Excel. Can pls anyone help me in doing this..
    Thanks & Regards
    Sowmya.J

    On click of the button, you will have to reuse the same java code which you used to populate the table in the JSP except that you will have to create an excel file with the data you got using suitable excel api's (look for POI api). Write the stream to the response and the browser will take care of opening a dialog to save/open the file.

  • Please verify my account. I have an excel question I'm working on today. Thank you.

    Please verify my account. I have an excel question I'm working on today. Thank you.

    Should happen automatically or you can also add your request in this thread.
    https://social.msdn.microsoft.com/Forums/en-US/fb60847b-188f-4075-93d0-3438e06d9047/verify-your-account-22?forum=reportabug
    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows]
    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees , and confers no rights.

  • Excel question--appropriate here? If not, where?

    Is there an appropriate place in these fora to ask a simple Excel question?
    In any case, here it is:
    (iMac G5 1.6MHz, running 10.4.10)
    After some Tiger version update about a year ago, the tops of my Excel X worksheets default-opened and zoomed behind the status and formula bars. In other words, when I open a new worksheet or click on the green zoom button, the worksheet aligns itself so that the title bar and the column heads hide behind the status and formula bars. I recently upgraded to Excel 2004 hoping that the problem would fix itself. Nope.
    Sorry if this is posted in the wrong place...
    iMac G5; iBook G4; Mac Mini G4   Mac OS X (10.4.10)  

    I always had a hard time with MS help and found google groups to be quite good.
    http://groups.google.com/group/microsoft.public.mac.office.excel/topics?lnk=sg&h l=en
    This link is to Microsoft.public.mac.office.excel
    Good luck, Glynn
    I Have 2004 and have not had this problem.

  • Export JSP to Excel : Weird problem  (Urgent)

    Hi,
    Sorry for the length of question.
    I am facing a bit weired problem while exporting my JSP report to Excel.
    I have multiple tables in my JSP page .( Use of Multiple tables is a requirement .).
    I am using Struts and Oracle 9i JDeveloper for developement.
    I have a button called "Excel" and on its click , I am opening the same JSP page in a pop up and passing reqd. parameters to it using querystring
    ( sometimes I am keeping the parameters into session as the length is loo large to fit into queryString. )
    I am using
    response.setContentType("application/vnd.ms-excel");
    to transform my JSP page to Excel.
    Sometimes, this works fine.
    But, mant times this gives error such ( in Windows2000 Adv. Server ) as
    "Memory could not be "read"."..with the tile of error-popup as "Excel.exe".
    (In Windows NT , it never exports to Excel. Every time it gives "Dr. Watson Debugger" message box.)
    In Windows2000 Adv. Server ,
    While debugging, I observed that when I click on Excel button, the pop up opens and executes the page and again goes to the start of the page and executes again and thus tries to open the same Excel document.
    As we know, we cannot open same Excel document twice. Hence it gives a popup alert that
    " The file <filename with its entire path> could not be opened.
    There may be several reasons :
    You might be trying to open a file which does not exist.
    You might be trying to open the file which is already open. ..."
    etc.etc. and something like this.
    Now, this is totally unpredictable. If I click Excel button, It may open the file in excel and on next try it would give error.
    This is quite annoying. I searched on this forum, Google but could not find the solution yet.
    I cannot use POI - HSSF . I cannot use userdefined Excel tags as well. as it will require a lot of reqork and unfortunately I don't have that much time now.
    Please help me and let me know how would I be able to successfully and predictably export my JSP pages to Excel.
    Thanks,
    Swipsy.

    Hi,
    Why don�t you save as attachment? (use -> <% response.setHeader("Content-Disposition", "attachment; filename=\"name.xls\""); %> scriplet )...
    I�m doing the same work, but I have problems to export images to Excel by this method...
    Someone could help me??
    thanks a lot

  • How to disable Format Warning when displaying JSP in Excel under MS-Office

    We have an application running in WebSphere 6.0 container, the application displays jsp data in Excel, it had no problem before MS-Office 2007 was install. However, after MS-Office 2007 is used, following format warning dialog box is always displayed:
    The file you are trying to open, ’Requests[1].xls’, is in a different format than specified by the file extension.
    Verify that the file is not corrupted and is from a trusted source before opening the file.
    The user has to click the "Yes" button before the Excel report can be successfully displayed. This is not acceptable by our production users, and I need your helps to get rid of this dialog box.
    The application uses struts. The Action class retrieves data from database and the data is forward to the result jsp
    in an data object set in an attribute of the session's Request object. The Action class also set the display info, such as the contentType,etc., in session's Response object (please see below for details).
    The result jsp retrieves data from the data object and display in Excel according to the display info provided in the
    session response object.
    To eliminate any possible problem that may be caused by the data, I have simplified the result jsp by removing original
    codes (such as data object forwarded from Action, and Tag Library, etc.), and just hardcoded few data for displaying in Excel, however, the same format warning box still always shows up.
    My Action class set display info as below:
    response.setContentType("application/vnd.ms-excel");
    response.setHeader("Expires", "0");
    response.setHeader("Cache-Control","must-revalidate, post-check=0, pre-check=0");
    response.setHeader("Pragma", "public");
    response.setHeader("content-disposition","attachment; filename=Requests.xls");
    My simplified result jsp is listed below:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <HTML>
    <HEAD>
    <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
    <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
    <!-- <%@ taglib prefix='c' uri='http://java.sun.com/jstl/core_rt'%> -->
    <TITLE></TITLE>
    </HEAD>
    <BODY>
    <TABLE border="1">
         <TBODY>
         <TR>
         <td><p align='left'>myData1</p></td>
         <td><p align='left'>myData2</p></td>
         <td><p align='left'>myData3</p></td>
         <td><p align='left'>myData4</p></td>
         </TR>
         </TBODY>
    </TABLE>
    </BODY>
    </HTML>
    So, I reduced the result jsp to contain only few hardcoded data, but the format warning always shows up. Is it caused by inconsistency between the MS-Office 2007 browser and the JSP engine in WebSphere 6.0 Web container? Need your help to resolve this problem.
    Thanks in advance.

    That's the caveat of fooling your webbrowser and Excel with a plain HTML page along an Excel content-type and Excel extension.
    Don't do that. That's plain stupid. Provide a real binary Excel file. You can create one using Apache POI HSSF or Andy Khan's JExcelAPI. Alternatively -and more recommended in case of large reports-, just use the CSV format. It's easy to create a CSV file in 20 lines of code and Excel perfectly understands CSV formats. Don't forget to change content-type to CSV.

  • Download data from jsp to Excel

    Originally, when I was using tomcat as the web server (installed at my local machine), I wrote a jsp which allows users to download Oracle table data to a Excel file. When the user clicks "Download" data, a "File Download" dialog box pops up and asks whether the user want to "Open this file from its current location" or "Save this file to disk". That is what I want.
    Now, I migrate the application to OC4J (installed at Sun Solaris Server), the same program is not working as the same way as above. If the user clicks the link, then the program simply display the jsp page. In order to download data, the user needs to right click the link and selects "Save Target as".
    How to make the application work just like it works on tomcat? Is this a programming issue or a server configuration issue?
    Thanks.
    Jingzhi

    Hi,
    I am having the same exact problem that you had months ago. Would love to hear if you came up with a solution? Original post included below...
    Thanks,
    Andres
    ORIGINAL POST:
    Hi
    I could successfully send the data from a jsp file to a excel file. But, I have a problem with the data. The data i pass is normally alpha numeric, but some times the data is something like '00123456'. In such cases, i am loosing the leading zeros and get '123456'. Is there any way i can get around with this problem?
    Help is greatly appreciated.
    Bharat

  • JSP Weblogic server question.

              Hi,
              I'm new with Weblogic, and I have running the server already. I'm able to run servlets
              through the browser, however I want to start working with JSP. I created a sample
              jsp file and when trying to launch it through the browser I get a 404 message error.
              So my question is how can I make weblogic to act as a jsp server as well?
              Thank you for any help.
              A.R.
              

    Copy your JSP file into the
              config/mydomain/applications/
              DefaultWebApp directory
              In a web browser, request the JSP file using the following URL:
              http://localhost:7001/sampleJsp.jsp
              "A.R." wrote:
              > Hi,
              > I'm new with Weblogic, and I have running the server already. I'm able to run servlets
              > through the browser, however I want to start working with JSP. I created a sample
              > jsp file and when trying to launch it through the browser I get a 404 message error.
              > So my question is how can I make weblogic to act as a jsp server as well?
              >
              > Thank you for any help.
              > A.R.
              

  • Jsp,servlet,bean question,please help

    The Tomcat Web server set up like this.......
    The directory structure is
    e:/sampleapp/WEB-INF/classes
    /lib
    And the web.xml is in the WEB-INF for the use of ay potential servlet.
    The basic understanding is that all the .java files go into the WEB-INF directory and the .class files go into the classes directory.
    All the .jsp files go into the sampleapp directory.Till here is correct I feel.
    Now for my qustion......
    I plan to use jsp,servlet and beans for a potential web application...,where do all these files go?,just the same as above or is there a difference.
    Hope that I have given a reasonable explaination to my question.
    Thanks for any replies
    AS

    All of your compiled servlet and java bean (java
    classes in general) will be placed into the following
    directory (under a directory structure matching the
    java package they are in):
    e:/sampleapp/WEB-INF/classesAll of your .jar files that are used as libraries (not
    your .jar files for applets):
    e:/sampleapp/WEB-INF/libAll of the rest of your JSP files, javascript files,
    HTML files, JAR files, images files, etc. will go into
    the following directory:
    e:/sampleappYou must make sure you put your sampleapp directory
    where tomcat can load it. Or use the admin tool to
    load it. If you make a .WAR file with a corresponding
    web.xml file in it, it will simplify loading it into
    tomcat. It also will help you do your servlet
    mappings, etc. I hope this helps.Thanks for your timely response.To add to it,let me tell you.
    The <b>bean</b> files are put into a package right,so they should be put into the WEB-INF/classes/<package name>
    What about The <b> servlet </b> files...... they are just put into the WEB-INF/classes/ directory????
    Kindly let me know.
    Thanks
    AS

  • Retrieving lists from other layer into a JSP page - Design Question

    Hi all,
    What should be a good design technique in order to allow a JSP page to present some list obtained from other layer of my application. I intend to leave only presentation logic in the JSP layer, while all data access will be in other layer.
    For example, I have a JSP page that will show the results of a SQL query originated from an entry form in other JSP page. Let's name them 'search.jsp' and 'result.jsp'
    I want that all JDBC access be done in some other layer.
    Question 1:
    What would be better for this task? A servlet or a bean? (A bean, I suppose?)
    Then this bean (?) would have to find some way to pass all the result set into this 'result.jsp'. I think it would be very poor design if I used some Data Object, because it would have to store all rows and pass them at once.
    I don't want, either, that the presentation (JSP) layer access directly the data access layer (JDBC, files...). This way, I don't want any JSP page accessing the Resultset object directly.
    Question 2:
    What do you think could be a good design technique?
    I thought of some intermediate layer that provided data objects and data access interfaces. I mean, as my data will come from different sources, like some database (JDBC), some Electronic Document Manager, I thought of having a common access interface, that would provide methods for accessing the resultsets. This could be even a java.util.Enumeration that has a hasMoreElements() method that could be implemented as the next() method from JDBC result sets and the nextElement() method that would actually bring the next row of data.
    This way the JSP layer would see only hasMoreElements() and nextElement() methods from the middle layer. On the other hand, the data layer would provide as many different implementations to this access interface (Enumeration?) as there were data sources (JDBC, Files, ...)
    Question 3:
    What do you think of this design?
    Question 4:
    Is there any flaw in my approach? Which?
    Question 5:
    Could you suggest other designs?
    I really thank you all, for any kind of answer. I actually use this design for development, however I've never seriously discussed it with someone... this is going to be of great value for me.
    Regards,
    Filipe Fedalto

    Well I saw you question and I'll tell you what I do.
    I have JSP's which post form data to servlets.
    The servlet then calls a factory to produce a ResultContainer (analagous to your lists) which is generated
    via JDBC, and/or request parameters etc...
    this provides a single point of reference and a "group" of containers (functions really) that can be produced and reused (same container different amount of data)
    I also have other static classes which can manipulate the data in the containers
    (such as add additional info to the items in the containers) before I forward the container (request attribute)
    to the JSP page
    Additionally I use Type safe constants for all my HTML form tag names (easier to change and ensure the same name is used everywhere when reading parameters) and again for item statuses
    and any other info I need to send along with the page (using Javascript to update the
    status to another type safe constant).
    I've found that using factories for ResultContainers is very worthwhile and allows you to implement additional servlets extremely quickly (mostly reusing containers that exist) and since the
    container is the same for all my JSPs (this may not be the case with you) I can implement JSP's
    very quickly as well (just change the view)
    btw I refrain from calling my ResultContainer a bean because it is not serializable
    I don't know if this will help but at least it gives me a forum to test my ideas
    Thanks

  • Newbie JSP/Servlet general question

    Hi,
    I am currently studying the life cycle of a JSP page from the Java EE 5 Tutorial (http://java.sun.com/javaee/5/docs/tutorial/doc/bnahe.html). This document says that: "+If an instance of the JSP page’s servlet does not exist, the container loads the JSP page’s servlet class, instantiates an instance of the servlet class, initializes the servlet instance by calling the jspInit method+".
    My two questions are:
    i) Does this JSP servlet implement the HttpJspPage interface defined in javax.servlet.jsp?
    ii) Does Struts and Spring MVC provide such JSP servlet Java classes implementations or are these part of other packages? If not, which packages offer such implementations?
    Thanks,
    J.

    Jrm wrote:
    Hi,
    I am currently studying the life cycle of a JSP page from the Java EE 5 Tutorial (http://java.sun.com/javaee/5/docs/tutorial/doc/bnahe.html). This document says that: "+If an instance of the JSP page&#146;s servlet does not exist, the container loads the JSP page&#146;s servlet class, instantiates an instance of the servlet class, initializes the servlet instance by calling the jspInit method+".
    My two questions are:
    i) Does this JSP servlet implement the HttpJspPage interface defined in javax.servlet.jsp?Yes.
    >
    ii) Does Struts and Spring MVC provide such JSP servlet Java classes implementations or are these part of other packages? If not, which packages offer such implementations?No, the implementation for the JSP servlet is usually provided by the Servlet Container, not a framework, since the Servlet Container is responsible for creating and compiling the JSP.
    >
    Thanks,
    J.

  • Exporting data from JSP to EXCEL

    Hi All,
    I am getting data in form of table in my jsp page. I need to know how to export the data in excel sheet with a click of button.
    Please help me.
    Thanks

    Thanks for your help
    I put the code in my jsp page. it shows a dialog box which ask the location for the excel sheet to save. However the excel it blank. It does not retrive any values from the database or jsp page
    Here is an overview of the page which i`m generating the report
    1) creating a connection object, and loading the Mysql driver
    2) getting the values from the database using select command
    3) Displaying the values in form of table
    4) in the bottom creating a button called "Export"
    5) this export will go to another page called "export.jsp"
    6) here i write the code
    <%@ page contentType="application/vnd.ms-excel" %>Plz help

  • Exporting JSF/JSP to Excel

    Hi,
    I have a JSP(JSF) containing only 1 table with data coming from a database. I use:
    <jsp:directive.page contentType="application/vnd.ms-excel">
    to enable the users export these data to Excel. This is working fine on Win2K using Office 2K, but it gives some errors on WinXP using Office XP.
    Anybody saw that before? Any ideas for an workaround?
    Thanks
    Valeriu

    I believe this is a creator studio problem because it was working fine in office 2002 and 2003. Now it displays an error saying something like "link tag does not match body tag". Therefore it appears that there is something happening in the jsp.

Maybe you are looking for

  • ALV report i want to display in each P.O , i want to display item details

    Hi all, in alv report i want to display in each P.O , i want to display item details. is it possible without hierarchical display.

  • Can't Install S-ATA Drivers

    Set up for XP Pro gets to the point where I can select what driver to choose then tells me that the file has caused an unexpected error (18) at line 210B in d:\xpclient\base\boot\setup\oemdisk.c Any help would be great. ~John

  • Dynamic update of the classpath

    Hi everybody ! I'm working on an application that uses plugins and that is able to compile them from inside it. I need to update the classpath so that thae update is applied without restarting the application. For the moment I'm working like this: I

  • Protect against DOS attack on NIO Server

    I have a NIO server which recently underwent a DOS attack. The attack was very simply a packet flood in which a rogue engineered client sent a packet request to the system 80,000 times in about 5 seconds. The packet was successfully ignored in the ap

  • How to store and refresh cache in CPO 2.3?

                       We have some dozen workflows (CPO 2.3 processes) each triggered to start by a unique tidal event. Each workflow when triggered fetches numeric data (just two or three two-digit data such as 15, 300) from a singluar web service  end