Display request contents in JSP page

i need to display the contents in a request in my JSP.
meaning:
i have a hashmap (containing string and a list) coming from the EJB tier to struts action in an event response object, I'm sure that the request has these values. cuz i tested it in struts action using the following code:
HashMap result = (HashMap)((EventResponseSupport)request.getAttribute(WebKeys.EVENT_RESPONSE)).getPayload();
System.out.println("Sponsor name = " + result.get("sponsor"));I am able to print it in the console but i need to know how to display it in the jsp. i tried many things but i can't get it right.
first i need to display the string and then i need to iterate through the list to display its contents in a table.
any help would be appreciated.

Kindly use JSP Scriplet to load the HashMap into the Page Context.
Then you can use the Struts iterate tags to paint the contents of the HashMap

Similar Messages

  • How to display Arabic content in JSP ?

    Hi all,
    I used the following encoding method to display arabic content in JSP page.
    <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
    <meta content="text/html; charset=UTF-8" http-equiv="content-type"/>
    I also set -Dfile encoding=ISO-8859-6 in the JVM Options.As a result the arabic data is getting displayed .
    Variable "data" contains the actual arabic data.
    function updateArabicData(data){
    try{
    document.getElementById('divtag').innerHTML=""+data;
    }catch(err){
    <html>
    <body>
    <div id="divtag" lang="ar-sa"></div>
    </body>
    </html>
    But the problem is the arabic data getting displayed in JSP (within the <div>)seems to be jumbled up.The users say that the arabic words within a single sentence are not arranged correctly.They are mixed up.Please help me with a solution.
    Edited by: Alance on May 27, 2010 5:34 AM

    Data is retrieved as follows
    if(msg.getField("GEN_UNICODE_MESSAGE_1")!=null){
    resultString=resultString+"N"+""+new String((byte[])msg.getField("GEN_UNICODE_MESSAGE_1").value.get(0),"ISO-8859-6");
    with content Type set as response.setContentType("text/html;charset=ISO-8859-6");
    ISO-8859-6 -since the data contains arabic news.
    Edited by: Alance on May 27, 2010 11:05 PM

  • Displaying content in JSP page, want BR but not other Html tags

    I have a page and am reading files and displaying the contents of the files onto the page in a <div> Oneissue is that in the file the end of line are \n or \r\n whichever operation system. I replaced those with <BR> no problem. Now my issue is that I display that in the JSP page:
    <c:out value="${filecontents}" escapeXml="false" />I use escapeXml so that <BR> will add the line breaks. Now my issue is that the file might contains other HTML tags that I want to display simply as text - I don't want the browser to render the other HTML tags.
    Is there a way to do that? Would I have to replace HTML tags with something special?

    Hmm... your file contains HTML tags, but you don't want the browser to interpret them as HTML tags, right? So the way to do that is to use escapeXml="true" in your c:out element.
    But then that also escapes the <BR> tags that you carefully put in there. And you don't want that. You want the browser to interpret those as HTML tags.
    I guess you can't have it both ways. Can you do something like outputting one line of the file at a time with <c:out ... escapeXml="true"> followed by <br>?

  • Display content in Jsp page

    Hi All,
    When I am trying to display large the data in jsp I have problem...
    It will display entire content in one page but I want some data and Click the next hipar link than it will display the next data...
    Like yahoo mail box....
    Please give me the idea on this issue

    you can have a hidden field which stores information about the current record number. so that you can start from the record pointed by the value in the hidden and proceed till delta records and finally increment the value of the hidden field by delta.
    for instance, if you have 20 records, and your hidden field value at the beigning is 0.
    when the page loads you can read this hidden field value and display 5 records starting from the hidden field value. Finally you can increment the hidden field value by 5. Your link must post your form to this page.

  • How to display uploaded image in jsp page.

    Hello,
    I am using struts 1.2.9 and and have uploaded image on the server. Now what I want to do display the image in jsp page after clicking on one link in jsp. I have tried many thing to display image in jsp page. But I am getting an error during displaying image in jsp. I have displayed absolute path in servlet. and used InputStream and outputstream to display image in jsp page.
    Can any one help.
    Thanks in advance
    Manveer Singh

    Follow this. This topic is very popular recently on the forum.

  • How to display a document content in JSP page

    Hi friends,
    I am trying to display a document's content in a JSP page after user authentication.For that I mapped a jsp file with extension .sens in Content Management SDK manager,and put it the file in the directory '/ifs/jsp-bin' of webstarterapp,but it is not working.Down I am giving the code snippet,please help me.I need this to be done fast.
    <HTML>
    <HEAD>
    <%@ page contentType="text/html;charset=windows-1252"%>
    <%@ page import="oracle.j2ee.connector.Login" %>
    <%@ page import="oracle.ifs.adk.filesystem.IfsFileSystem"%>
    <%@ page import="oracle.ifs.adk.http.HttpUtils"%>
    <%@ page import="oracle.ifs.beans.LibrarySession"%>
    <%@ page import="oracle.ifs.beans.DirectoryUser"%>
    <%@ page import="oracle.ifs.beans.PublicObject"%>
    <%@ page import="oracle.ifs.beans.Document"%>
    <%@ page import="java.io.*"%>
    <jsp:useBean id="login" scope="page" class="oracle.j2ee.connector.Login">
    <TITLE>FileExtension.jsp</TITLE>
    </HEAD>
    <BODY BGCOLOR="SILVER">
    <%
    String theDisplay = "initialized";
    String theHidden = "initialized";
    boolean theAdminRights = false;
    try
    login = (Login) request.getSession(true).getValue("IfsHttpLogin");
    LibrarySession ifsSession = login.getSession();
    IfsFileSystem ifsFile = new IfsFileSystem(ifsSession);
    DirectoryUser du = ifsSession.getDirectoryUser();
    String path = HttpUtils.getIfsPathFromJSPRedirect(request) ;
    PublicObject po = ifsFile.findPublicObjectByPath(path);
    if(po instanceof Document)
    Document doc =(Document) po;
    InputStream in= ifsFile.getDocumentContent(doc);
    int i=in.read();
    while(i!=-1)
    out.write(i);
    in.close();
    out.flush();
    out.close();
    theAdminRights = du.isAdminEnabled();
    theDisplay = po.getAttributeByUpperCaseName("DISPLAY").toString();
    theHidden = po.getAttributeByUpperCaseName("HIDDEN").toString();
    catch (Exception e)
    e.printStackTrace();
    %>
    Here is some static content.
    <P>
    The Display Value: <%= theDisplay %>
    <P>
    <%
    if (theAdminRights)
    %>
    The Hidden Value: <%= theHidden %>
    <%
    %>
    </jsp:useBean>
    </BODY>
    </HTML>

    these may help you.
    Google map integration to EBS

  • Problem with displaying BLOB images on JSP page using a servlet

    hi. I have a big problem with displaying BLOB images using JSP. I have a servlet that connects to the oracle database, gets a BLOB image , reads it, and then displays it using a BinaryStream. The problem is , this works only when i directly call that servlet, that is http://localhost:8080/ImageServlet. It doesn't work when i try to use that servlet to display my image on my JSP page (my JSP page displays only a broken-image icon ) I tried several coding approaches with my servlet (used both Blob and BLOB objects), and they work just fine as long as i display images explicitly using only the servlet.
    Here's what i use : ORACLE 10g XE , Eclipse 3.1.2, Tomcat 5.5.16 , JDK 1.5
    here is one of my image servlet's working versions (the essential part of it) :
                   BLOB blob=null;
              rset=st.executeQuery("SELECT * FROM IMAGES WHERE ID=1");
              while (rset.next())
                   blob=((OracleResultSet)rset).getBLOB(2);
              response.reset();
              response.setContentType("image/jpeg");
              response.addHeader("Content-Disposition","filename=42.jpeg");
                    ServletOutputStream ostr=response.getOutputStream();
                   InputStream istr=blob.getBinaryStream(1L);
                    int size=blob.getBufferSize();
              int len=-1;
                    byte[] buff = new byte[size];
                         while ((len=istr.read( buff ))!=-1 ) {
                   ostr.write(buff,0,len);
             response.flushBuffer();
             ostr.close(); and my JSP page code :
    <img src="/ImageServlet" border="0"  > If you could just tell me what i'm doing wrong here , or if you could show me your own solutions to that problem , i would be very greatful ,cos i'm realy stuck here , and i'm rather pressed for time too. Hope someone can help.

    I turns out that it wasn't that big of a problem after all. All i had to do was to take the above code and place it into another JSP page instead of into a servlet like i did before. Then i just used that page as a source for my IMG tag in my first JSP. It works perfectly well. Why this doesn't work for servlets i still don't know, but it's not a problem form me anymore . Ofcourse if someone knows the answer , go ahead and write. I would still appriceatte it.
    here's the magic tag : <img src="ImageJSP.jsp" border="0"  > enjoy : )

  • How to retrieve records from a database and display it in a jsp page.Help!!

    Hello everyone ! im very new to this forum.Please help me to solve my problem
    First i ll explain what is my requirement or needed.
    Actually in my web page i have text box to enter start date and end date
    and one list box to select the month .If user select or enter the dates in text box
    accordingly the data from ms access database has to display in a jsp page.
    Im using jsp and beans.
    I tried returning ResultSet from bean but i get nothing display in my web page
    instead it goes to error page (ErrorPage.jsp) which i handle in the jsp.
    I tried many things but nothing work out please help me to attain a perfect
    solution. I tried with my bean individually to check whether the result set has
    values but i got NullPointerException . But the values which i passed or
    available in the database.
    I dint get any reply for my last post please reply atleast to this.
    i get the date in the jsp page is by this way
    int Year=Integer.parseInt(request.getParameter("year"));
    int Month=Integer.parseInt(request.getParameter("month"));
    int Day=Integer.parseInt(request.getParameter("day"));
    String startdate=Day+"/"+Month+"/"+Year;
    int Year1=Integer.parseInt(request.getParameter("year1"));
    int Month1=Integer.parseInt(request.getParameter("month1"));
    int Day1=Integer.parseInt(request.getParameter("day1"));
    String enddate=Day1+"/"+Month1+"/"+Year1;But this to check my bean whether it return any result!
    public void databaseConnection(String MTName,String startDate,String endDate)
    try
             java.text.SimpleDateFormat dateFormat=new java.text.SimpleDateFormat("dd/MM/yyyy");
             java.util.Date fromDate=dateFormat.parse(startDate);
            java.util.Date tillDate=dateFormat.parse(endDate);          
            java.sql.Date sqlFromDate=new java.sql.Date(fromDate.getTime());
            java.sql.Date sqlTillDate=new java.sql.Date(tillDate.getTime());
              String query1="select MTName,Date,MTLineCount from Main where MTName='"+MTName+"'  and Date between '"+sqlFromDate+"' and '"+sqlTillDate+"' " ;
            System.out.println(query1);
              Class.forName(driver);
             DriverManager.getConnection(url);
             preparedStatement=connection.prepareStatement(query1);
             preparedStatement.setString(1,"MTName");
              preparedStatement.setDate(2,sqlFromDate);
              preparedStatement.setDate(3,sqlTillDate);
              resultSet=preparedStatement.executeQuery();           
               while(resultSet.next())
                        System.out.println(resultSet.getString(1));
                        System.out.println(resultSet.getDate(2));
                        System.out.println(resultSet.getInt(3));
            catch (Exception e)
             e.printStackTrace();
    I Passed value from my main method is like thisl
    databaseConnection("prasu","1/12/2005","31/12/2005");Please provide solutions or provide some sample codes!
    Help!
    Thanks in advance for replies

    Thanks for ur reply Mr.Rajasekhar
    I tried as u said,
    i tried without converting to sql date ,but still i din't get any results
    java.text.SimpleDateFormat dateFormat=new java.text.SimpleDateFormat("dd/MM/yyyy");
             java.util.Date fromDate=dateFormat.parse(startDate);
            java.util.Date tillDate=dateFormat.parse(endDate);          
              String query1="select MTName,Date,MTLineCount from linecountdetails where mtname='"+MTName+"'  and Date >='"+fromDate+"' and Date <='"+tillDate+"' " ;
            System.out.println(query1);
    //From main method
    databaseConnection("prasu","1/12/2005","31/12/2005");I got the output as
    ---------- java ----------
    select MTName,Date,MTLineCount from linecountdetails where mtname='prasu'  and Date >='Thu Dec 01 00:00:00 GMT+05:30 2005' and Date <='Sat Dec 31 00:00:00 GMT+05:30 2005'
    java.lang.NullPointerException
    null
    null
    java.lang.NullPointerException
    Output completed (4 sec consumed) - Normal TerminationThanks
    Prasanna.B

  • Displaying arabic text in jsp page

    Hi,
    Iam displaying some arabic values which will come from server in my jsp page.
    but the problem when display the values its showing rubbish like �������������
    when i select the view-->encoding from browser its showing arabic values..
    i set <meta http-equiv="Content-Type" content="text/html; charset=windows-1256"> like this in my jsp page..
    When i put the arabic text in normal .html page its working fine its displaying fine..
    when iam calling jsp page iam getting above problem..
    do i need to make any setting in server..iam using j2ee refrence server..
    Regards,

    use UTF-8 for character encoding then arabic text will display

  • How to Display jFrame - chart in JSP PAge

    Hi all,
    Can any one help about this task..
    I have writeen a java file which generates multiaxis chart by using JFreeChart API....
    Say for ex..
    public class multiaxis extends JFrame
    /// till know no problem...
    Can any one tell its possible to display this chart (JFrame) in Browser (JSP Page) .. any idea over this..
    Thanks in advance

    there's examples around the forums about using JFreeChart in a servlet to generate a JPEG or PNG images.

  • Displaying Japanese characters in JSP page

    Hi,
    I am calling an application which returns Japanese characters from my JSP. I am getting the captions in Japanese characters from the application and I am able to display the Japanese captions. After displaying the Japanese captions, user will select the particular captions by selecting the check box against the caption and Press Save button. Then I am storing the captions in the javascript string separated by :: and passing it to another JSP.
    The acton JSP retrieves that string and split it by using tokenizer and store it in the database. When I retrieve it again from the database and display it, I am not able to see the Japanese characters, it is showing some other characters, may be characters encoded by ISO.
    My database is UTF-8 enabled and in my server I am setting the UTF-8 as default encoding. In my JSP pages also, I am setting the charset and encoding type as UTF-8.
    I shall appreciate you if you can help me in resolving the issue.

    Post the encoding-related statements from your JSPs - there are a number of different ones that may be relevant.
    It may also be relevant which database you store the strings in (Oracle, DB2, etc.), since some require an encoding parameter to be passed.

  • Display uploaded file on JSP page

    Hi All,
    I want to display uploaded file in JSP.
    Initially I am displaying File Name after saving the file & click on edit link.
    i.e on JSP Page I have File Upload component & save button.With that save button I am saving my file to databse.
    So when I click on edit link I am getting that file name from Databse then I am displaying it.
    But now I want to display uploaded file name on JSP page before saving to databse.i.e I will have browse & Upload button.When I click on browse button I will open window from where I will select file.
    This is working fine as,<x:inputFileUpload id="uploadfile" value="#{errorLotBean.file}" storage="file"></x:inputFileUpload>
    But when I click on upload button that uploaded file should be displyed there only.Can anyone please tell me how to do this ?
    Thanks
    Sandip

    Thanks a lot Siefert,
    I tried the way mentioned in URL.
    But what if I want to display all uploaded file on my screen.
    i.e. If user click on browse & select File A then click on upload button.
    (Here the File A will be displayed) with code
    <h:outputtext value="#{benaName.file.name}"
    But what if after displaying File A if user decide to upload another file File B.
    How to display that ?
    with <h:outputtext value="#{benaName.file.name}" its dispalying one file only.
    Thanks
    Sandip

  • To Display HTML content on ADF page

    Guys,
    I want to display the content from Website (its contains images and text) on to the ADF page. Which component should i use?
    I dont want to use Iframe since we cant set the height properly...

    af:inlineFrame is pretty much your only option. What do you mean you cannot set the height properly?

  • How to display unicode character in jsp pages?

    i have to display user need language using unicode character according to user selected in radio button arabic or german in jsp
    pages. can you explain how i have to code?

    Hi,
    Visit the following URL http://java.sun.com/docs/books/tutorial/i18n/ .
    It will help you.
    bye for now
    sat

  • Displaying Image on th JSP page

    Hello All,
    I am using following code to display the image on the JSP page in my iView
    <% String PublicURL = componentRequest.getPublicResourcePath()+ "/images/Image1.gif"  ; %>
    <hbj:image id="Logo" width="70" height="35" 
                               src="<%= PublicURL %>"
                               alt= "picture Ericsson.gif" />
    Am I missing anything. I am still not able to display the image.
    Regards,
    Sanjeev

    change
    componentRequest.getPublicResourcePath()
    to
    componentRequest.getWebResourcePath()

Maybe you are looking for

  • General Error while exporting QT

    The last couple of projects I've done have been online conforms to HD 10bit uncompressed. After finishing all of my tweeks, I wish to output a master Quicktime. As usual I place my in and out markers at the beginning and end of my timeline, and selec

  • How system updating the delivery dates in sale order schedule line

    Hello i created a sales order with 2 line items. For the first line item the confirmed delivery date in the schedule line is 06.02.2012 and for the second line item the confirmed delivery date in the schedule line is 14.02.2012 . Both the line items

  • ClassCastException - App Client

    Hi, I'm running an application client to test a program, but I keep getting a java.lang.ClassCastException. Error message: java.lang.ClassCastException at com.sun.corba.se.internal.javax.rmi.PortableRemoteObject.narrow(PortableRemotObject.java:293) a

  • Not receiving email when sending large number of records using a FM?

    Hi.. I am using the function module " SO_DOCUMENT_SEND_API1 " to send email.... When a single record is there.. or around 5-6 records are there... email is coming successfully... But when there are more records..say around 100, the email is not comin

  • Encrypted mail from SAP

    Dear All, Please let me know is it possible to send the encrypted mail from SAP as well as the procedure to do? Best Regards Vikas