Displaying an Integer in a JSP page

Hi, i have a small problem which i'm not sure how to solve.
I'm developing a small application in Spring/Hibernate. Now, one of the classes i mapped to a table has some fields which are of Integer type. My problem is that when i try to display these fields directly in a JSP page i get a NumberFormatException. Is there any tag that knows how to "extract" the intValue() from an Integer and display in in a JSP without me having to resort to custom getters?

A NumberFormatException would occur if the to-be-formatted value is actually not a numeric. But you're saying that it is an Integer. Aren't you storing it as String? How exactly are you displaying it in JSP and how exactly are you storing the value?

Similar Messages

  • Displaying Crystal reports in a JSP Page

    hello,
    Can anybody help me out in displaying Crystal reports on a JSP page.
    which needs to be deployed on weblogic server and oracle database.
    i am new to crystal report and dont have much idea how to proceed.
    if you can give me a pointer how to start then i can proceed.
    waiting for the reply eagerly

    Start with the Crystal reports site.
    [url http://www.businessobjects.com/products/dev_zone/java/default.asp?ref=devzone_main] Java zone has some documentation and basic examples on how to do it

  • Display values from database in jsp page

    Hi,
    I need to display a list of options with checkboxes in a jsp page .The values are retrived from DB.
    formBean fb=new FormBean(request)
    <Input type="checkbox" name="xyz" value="<%=fb.getFormdata( "xyz")%>">
    should this"xyz" be the name of the column in the DB table?

    This is my FormBean
    public class FormBean {
    HttpServletRequest _request;
    public FormBean(HttpServletRequest request) {
    _request = request;
    public String getFormData(String abc) {
    return getFormData(abc, true);
    public String getFormData(String name, boolean filter) {
    String value = null;
    if (_request != null) {
    value = _request.getParameter(abc);
    if (value == null) value = "";
    if (filter) {
    value = Utils.filter(value);
    return value;
    * "Clears" parameters. Useful if you do wnat a form initialized with blanks rather than
    * current values;
    public void clear() {
    _request = null;
    }

  • How can I display the date on a jsp page??

    Is there anyway to display the current date when someone views a jsp page??? Can I get it from the server or something like that?
    Thx
    Rich

    is there any type of formatting that goes witth
    that.....Most definitely -- check out the java.text.DateFormat object and its cohort java.text.SimpleDateFormat.
    For example, if you wanted to display the current date in MM/DD/YYYY format, you could do the following:
    <%-- This could go somewhere near the top of the JSP %>
    <%
    SimpleDateFormat f = new SimpleDateFormat("MM/dd/yyy");
    %>
    <% And later on, you could have... %>
    <%= f.format(new Date()); %>Note that I've omitted the proper <%import%> directives.
    -Navin

  • 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

  • Displaying a report in a jsp page

    Hi,
    I want to display my report (pdf or html) in a jsp page ,so can someone help me
    note that I am using NetBeans & JasperReports 2.0.5
    Thanking in advance

    That is a Client side configurtion and you cant control it using Javascript.

  • Displaying pdf file in a jsp page...

    hi,
    I want to display a pdf document in a jsp page. i got that pdf file from a servlet class(MVC Architecture) through session. now my problem is to display that pdf file in my jsp page. can anyone give me a idea to solve this problem..

    hi,
    i used that code in scriplets. Actually my problem is I got one pdf file from session and i stored that file in a File object. the code is ..
    File pdfDocument = (File) session.getAttribute(CommonConstants.EBILL_PDF_DOCUMENT);
    now i have to display this pdf file in jsp..

  • Not displaying decalritive component in my jsp page

    i delete my adf libarary jar in my deploy folder and it works fine,but now
    not able to dislay decalartive components in my jsp page
    hi i have decalarative components page which am calling from another jsp page,the thing is when irun my jsp page am not able to display my decalartve components but in design of my jsp page i can see my decalartive components
    my decalaritive components xml is
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1" xmlns:af="http://xmlns.oracle.com/adf/faces/rich"
    xmlns:f="http://java.sun.com/jsf/core">
    <jsp:directive.page contentType="text/html;charset=UTF-8"/>
    <af:componentDef var="attrs" componentVar="comp" definition="public">
    <af:panelGroupLayout id="dc_pgl1" inlineStyle="width:736px;" layout="horizontal" valign="middle"
    halign="center">
    <af:panelFormLayout id="dc_pfl1" rows="1" maxColumns="10"
    inlineStyle="width:376px; height:33px; border-color:Navy; border-style:ridge;">
    <af:commandLink text="Home" id="dc_cl1" action="Home"/>
    <af:commandLink text="TaskPool" id="dc_cl2" action="toPool"/>
    <af:commandLink text="LogOut" id="dc_cl3" action="logout"/>
    <af:selectOneChoice label="Skin" id="dc_soc1" value="#{SkinHelper.currentSkin}">
    <f:selectItems value="#{SkinHelper.currentSkin}" id="dc_si1"/>
    </af:selectOneChoice>
    <af:commandButton text="Select" id="dc_cb1" action="#{SkinHelper.switchSkin}"/>
    </af:panelFormLayout>
    </af:panelGroupLayout>
    <af:xmlContent>
    <component xmlns="http://xmlns.oracle.com/adf/faces/rich/component">
    <display-name>SmscomponentDef</display-name>
    <component-class>component.SmscomponentDef</component-class>
    <component-extension>
    <component-tag-namespace>component</component-tag-namespace>
    <component-taglib-uri>/componentLib1</component-taglib-uri>
    </component-extension>
    </component>
    </af:xmlContent>
    </af:componentDef>
    </jsp:root>
    when i drag and drop my decalaritive components from my components platter i get the below xml in my jsp page
    <sms:SmscomponentDef id="sd1"/>
    reference
    error running running application with decalaritive components

    timo
    Please be patient and wait for an answer in the other thread...
    how can i display the declarative components on the jsp page, am not able to diplay in runtime but can see decalarative components in design
    Edited by: Tshifhiwa on 2012/06/26 8:26 PM

  • Japanese charcters displaying as "?" on a JSP page

    Hi
    My database is UTF-8. I am loading some japaneese data using sql*loader and using Java.IO mechanism(Reader classes). Both ways it is storing the data on database in proper(Japanese) format. If I print it on dos-prompt then same Japanese characters are printing, no problem till here. But if I try to print the same data in database on a JSP page then it is printing "?"(question marks). Also, if I insert any data from a JSP page then it is inserting it as "?" on database. Any help, I really appreciate that.
    Thanks
    Ram

    I am using Chinese Windows NT 4.0
    I succeed in displaying Big5 chinese using Unicode encoding in JSP.
    Now I encounter problem in displaying HK fonts.
    Nevertheless,
    Have your tried to set the charset in your jsp file ?
    <meta http-equiv='Content-Type' content='text/html; charset=UTF-8'>
    Or have tried to set the browser encoding method to your desired one shift-jfs
    <% response.setContentType("text/html; charset=UTF8");%>
    Lastly, have you tried including a parameter in your getBytes stream
    String temp = rs.getString("headline");
    String newResult = new String(temp.getBytes("UTF-8"),"UTF-8");
    Hope this is related!

  • How to export only the data displayed in table of a jsp page to Excel

    Hi All,
    I want to export only the data that is displayed in the table of a jsp page to excel. But with my current code everything is getting exported to excel.
    <input type="checkbox" name="download" onclick = "form.submit()"/> Export to Excel
    response.setContentType("application/vnd.ms-excel");
    response.setHeader("Content-disposition", "inline; filename=fileName.xls");
    the table is displayed in the jsp using the following code:
    <table cellspacing="2" cellpadding="3" border="1"
    width="100%"> <tr> <%for (int i = 2; i <= cols; i++) {%>
    <td>
    <%
    out.println( rsmd.getColumnName(i) + " ");
    } %>
    <% while (rsettaba.next ())
    out.println("<tr>");
    for (int j= 2; j <= cols ; j++) {
    //out.println("<td>"+rsetallcl.getString(j)+"</td>");
    String varnl = rsettaba.getString(j);
    if ( varnl == null )
    out.println("<td> Empty </td>");
    else
    out.println("<td>"+rsettaba.getString(j)+"</td>");
    out.println("</tr>");
    %>
    </td>
    </tr>
    </table>
    please can anyone help how to just extract only the data in the table of a jsp page to excel.
    Edited by: Ramky48 on Dec 9, 2009 9:51 PM

    Ramky48,
    Why did you open a new thread when you had gotten quite a few responses and suggestions on the [url http://forums.oracle.com/forums/thread.jspa?threadID=998411]thread where you asked the same question - seems the best thing to do would be to continue on the same thread?
    However, your question has nothing to do with JDeveloper/ADF. If you'd like to do it the ADF way, it's trivially easy - you can use the [url http://download.oracle.com/docs/cd/E15523_01/apirefs.1111/e12419/tagdoc/af_exportCollectionActionListener.html]af:exportCollectionActionListener component, which does what you are asking for. If you want to use a straight JSP way, there were several good suggestions in the other thread you opened, or Googling "jsp export to excel" will get you about 4.6 million hits; the first 10 or so look pretty promising.
    John

  • Could not display Alert component in Visualweb JSP page

    Hi All,
    I am having difficulty getting the Ajax Autovalidation Alert Component to work in Netbeans Visualweb 6.5 on Windows XP with the following steps:
    ( i ) Set autoValidate attribute of firstnametextField and lastnametextField to "true" from property windows of Page1.jsp.
    ( ii ) Drag the Alert component of Page1.jsp and modified it's default id attribute to "form1:autoValidateAlert". Some how Netbeans change this attribute in the property window to "form1_autoValidateAlert" instead.
    ( iii ) Add notify="form1:autoValidateAlert" to Page1.jsp file for both firstnametextField and lastnametextField as follows:
    <jsp:root version="2.1" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:webuijsf="http://www.sun.com/webui/webuijsf">
        <jsp:directive.page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"/>
        <f:view>
            <webuijsf:page id="page1">
                <webuijsf:html id="html1">
                    <webuijsf:head id="head1">
                        <webuijsf:link id="link1" url="/resources/stylesheet.css"/>
                    </webuijsf:head>
                    <webuijsf:body id="body1" style="-rave-layout: grid">
                        <webuijsf:form id="form1">
                            <webuijsf:button actionExpression="#{Page1.button1_action}" binding="#{Page1.button1}" id="button1"
                                style="left: 130px; top: 144px; position: absolute" text="Submit"/>
                            <webuijsf:textField autoValidate="true" binding="#{Page1.firstNametextField}" columns="10" id="firstNametextField" label="First Name"
                                notify="form1:autoValidateAlert" required="true" style="left: 52px; top: 48px; position: absolute" text="#{SessionBean1.page1FirstName}"/>
                            <webuijsf:textField binding="#{Page1.middleNametextField}" columns="10" id="middleNametextField" label="Middle Name"
                                style="left: 47px; top: 71px; position: absolute" text="#{SessionBean1.page1MiddleName}"/>
                            <webuijsf:textField autoValidate="true" binding="#{Page1.lastNametextField}" columns="10" id="lastNametextField" label="Last Name"
                                notify="form1:autoValidateAlert" required="true" style="left: 53px; top: 94px; position: absolute" text="#{SessionBean1.page1LastName}"/>
                            <webuijsf:dropDown id="salutationdropDown" items="#{Page1.salutationdropDownDefaultOptions.options}" label="Salutation"
                                selected="#{SessionBean1.page1Salution}" style="left: 75px; top: 118px; position: absolute"/>
                            <webuijsf:alert id="autoValidateAlert" style="position: absolute; left: 96px; top: 216px"/>
                        </webuijsf:form>
                    </webuijsf:body>
                </webuijsf:html>
            </webuijsf:page>
        </f:view>
    </jsp:root>However, the Alert Component does not pop up after leaving First Name or Last Name text field blank prior to entering the field such as middlenametextField...
    Your suggestion would appreciated.
    Thanks,
    Jack

    timo
    Please be patient and wait for an answer in the other thread...
    how can i display the declarative components on the jsp page, am not able to diplay in runtime but can see decalarative components in design
    Edited by: Tshifhiwa on 2012/06/26 8:26 PM

  • How to display japanese charecters in the JSP page

    Hi,
    Below is my jsp page where i am trying to read the japan character from the properties file
    through the Resource bundle.
    ===============================================
    <%@page contentType="text/html" %>
    <%@page pageEncoding="UTF-8"%>
    <%@ page import ="java.util.*" %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
         <title>JSP Page</title>
    </head>
    <body>
    <h1>JSP Page</h1>
    <%Locale locale = new Locale(request.getParameter("country"));
    ResourceBundle bundle = ResourceBundle.getBundle("com.sunit.regtool.resources.RegTool",locale);
    String namelabel =bundle.getString("userName");
    String passwordlabel= bundle.getString("password");
    %>
    <%=namelabel %>
    </body>
    </html>
    =========================================================
    In the above code i am getting the value of the country from request object i.e its value
    will be en for English ,ja for japanese etc.
    I am able to get the value from Resource bundle but when my country is japan
    i am not able to see the same japan characters in the browser when i get the JSP on the browser at runtime .
    It shows me " �����&#133;� &#136;�&#131;&#149;�&#130;��&#131;��&#131;��&#131;&#137;" where the charecters are different.
    But when i see in the properties file it is fine.
    Please help me what need to be done furher for this.
    Thanks,
    Kiran

    I think you need to install japanese language fonts in your browser.

  • Admin Order Template gets displayed on sorting in genericsearch.jsp page

    Dear All,
    Standard Order template is customized and this template is available to all the customers who login to webshop. Admin creates this template and it is visible to all the customers who click on the New Order Template link and can transfer the contents to the basket.
    However, with this customization, the sorting feature is not working correctly.
    When we click on sort then the results get changed and only admin order templates are available.
    Templates created by user are not appearing in the genericsearch.jsp page.
    Any pointers on to eliminate this issue?
    Thanks and Regards,
    Gauri.

    Fully understand your frustration. Almost every customer was / is there and only consolation here is, you are not alone. Hope some one in SAP is listening. In this world of web 2.0, web 3.0 interfaces, b2b application is mired in frames. Just not one, close to gazillion.
    Well, you are already in the quagmire and consultants can't complain but must give solutions.
    Actually, in your case, there is a vertical scroll bar and it comes to visibility if you scroll horizontally the frame that contains the result list. What a mess.
    Well, we added a resource for working specifically with the stylesheet and framesets of the application and were able to come with a presentable set of frames without "invisible" scrollbars. But we are still far from being called a "fair website". Lot of tweaking of the sizes, percentages of the framesets and frames and changing the stylesheet components.

  • Hi all.... how to display tables dynamically in a JSP page

    im trying to display the list of tables in MYSQL datbase into a JSP.... i have a database name link on the page.... once i click on that the list of tables should be listed dynamically in the page as a link...Also is it possible to click on each table link and go to see the table details ...if so how.... please some one help me ...its very urgent........

    im trying to display the list of tables in MYSQL
    datbase into a JSP.... i have a database name link on
    the page.... once i click on that the list of tables
    should be listed dynamically in the page as a
    link...Also is it possible to click on each table
    link and go to see the table details ...if so how....DatabaseMetaData has a method (look in the documentation) to get the list of tables. It also has methods to get information on specific database objects
    please some one help me ...its very urgent........It's even urgent that you look in the documentation.

  • How can i display database data in my jsp page?

    actually i m doing a small appliaction of quiz test.
    where i m keeping my question and answers in the database.
    now i want to pull questions from the database and display in the jsp or html page.for each question i m having 4 options 4 them.
    like this user has to answer the question and display the resuklt in the end.
    so how can i do this?
    can i get any example or source code for this from any sites?

    I never tried this... but doesn't the normal html <applet> tag work?

Maybe you are looking for

  • Data in cube is not coming in Multiprovider

    Hi All, When i tried executing the multiprovider for customer analysis, am not getting the account manager corresponding to payer.But where as when i checked the cube (ZSD_C03) under it i could see the account manager field filled . There are two cub

  • Links Don't Work in Contact Card (people view) Outlook 2013 SP1

    I have Office Professional Plus 2013 SP1 x64 installed. When viewing contacts in "People" view, none of the links in blue work.  For example, clicking on the "Schedule a meeting" blue link under Calendar or "Outlook (Contacts)" blue link under View S

  • How to setup Glashfish 2.1 with sun crypto hardware inside T2 processor

    Dear Expert, I had setup comm 7 at guest os (ldom guest) on sun fire t5240 , All running well (mail,calender,im) , I also read http://wikis.sun.com/display/BluePrints/Taking%20Advantage%20of%20Wire-Speed%20Cryptography Does any body have guide step b

  • DesignJet Z6100 will not start

    Hope someone has an answer to this problem. We have had the z6100 plotter for a couple of years and this morning the employee that uses this plotter noticed it was off, when he tried to turn it on it displays a rectangle on the led screen and one bee

  • Ora-02089-COMMIT is not allowed in a subordinate session - V'urgent pls

    All, BPEL version: 11.1.1 I have to invoke a pl/sql procedure which inserts a data to a table. After insert, I used commit. When BPEL try to invoke this procedure, I got ora-02089-COMMIT is not allowed in a subordinate session+. I know without commit