Results 1 to 7 of 7
  1. #1
    sukanya is offline Member
    Join Date
    Mar 2012
    Posts
    5
    Rep Power
    0

    Default displaying images

    I am developing a project using jsp in Netbeans5.5.1. In Netbeans5.5.1 the image buttons cannot be displayed during execution.

    Any one help me how to display those buttons as images. and my code is below


    <%
    try
    {

    Connection con=databasecon.getconnection();
    Statement st=con.createStatement();
    String sql="select * from emp2";
    ResultSet rs=st.executeQuery(sql);
    while(rs.next())
    {

    %>
    <tr class="paragraping2">
    <td height="33"> <font color="000080"> <%out.println(rs.getString("mail"));%> </font></td>
    <td height="33"> <font color="000080"> <%out.println(rs.getString("name"));%> </font></td>
    <td align="left"><font color="#000000"> <% out.println(rs.getString("dateapp"));%> </font></td>
    <td align="left"><font color="#000000"> <% out.println(rs.getString("leavtype"));%> </font></td>
    <td align="left"><font color="#000000"> <% out.println(rs.getString("lfrom"));%> </font></td>
    <td align="left"><font color="#000000"> <% out.println(rs.getString("leaveuntil"));%> </font></td>

    <td><font color="#000000"> <% out.println(rs.getString("app"));%></font></td>
    <td><font color="#000000"> <% out.println(rs.getString("status"));%></font></td>
    <td><a href="empsendingreply.jsp?<%=rs.getString("name")% >"><img src="images/reply.png" width="50" height="35"></a></td> //problem is here.
    <%
    }
    st.close();
    con.close();

    }

    catch(Exception e)
    {
    out.println(e);

    }

    %>

  2. #2
    wsaryada is offline Senior Member
    Join Date
    Jun 2007
    Location
    Bali, Indonesia
    Posts
    760
    Rep Power
    8

    Default Re: displaying images

    What did you see on the browser? Is it a broken image because the image is not in the correct path of your web app?

  3. #3
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,455
    Rep Power
    20

    Default Re: displaying images

    Moved from New to Java

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  4. #4
    sukanya is offline Member
    Join Date
    Mar 2012
    Posts
    5
    Rep Power
    0

    Default Re: displaying images

    I saw the designed table.One of the cell containing image.That image is not displayed.

    I place the images folder in the current directory itself. so i specify the src location as "images/reply.png"

  5. #5
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,184
    Rep Power
    20

    Default Re: displaying images

    What is the webapp structure?
    Is it (on Tomcat):
    webapps/<yourapp>/images/reply.png
    ?
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  6. #6
    sukanya is offline Member
    Join Date
    Mar 2012
    Posts
    5
    Rep Power
    0

    Default Re: displaying images

    I am using NetBeans 5.5.1 for execution.
    The structure is:
    D:\LEAVE_MGMT\web\images\reply.png
    (The netbeans project contains the following folders. build,dist,nbproject,src,test,web and a build.xml file)
    Last edited by sukanya; 03-25-2012 at 01:03 PM.

  7. #7
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,184
    Rep Power
    20

    Default Re: displaying images

    Netbeans has a target server though.
    Probably Glassfish.
    It's not Netbeans, as such, running it.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

Similar Threads

  1. Displaying multiple images
    By asmitarnd in forum AWT / Swing
    Replies: 2
    Last Post: 04-19-2011, 01:14 PM
  2. Displaying moving images
    By Maulik in forum AWT / Swing
    Replies: 3
    Last Post: 04-02-2011, 01:00 AM
  3. Displaying large images
    By pir8ped in forum AWT / Swing
    Replies: 2
    Last Post: 01-21-2009, 10:20 PM
  4. [SOLVED] Need help in displaying images
    By kirly in forum Advanced Java
    Replies: 3
    Last Post: 10-21-2008, 06:36 AM
  5. Images not displaying in JSP in IE7
    By chadscc in forum Advanced Java
    Replies: 0
    Last Post: 11-13-2007, 04:24 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •