1

我试图在 Compiere 网上商店的网格中显示图像

JSP

<div id="content">
    <h2>Login </h2>

      <form method="get" name="ClientLogin" action="clientLoginServlet" enctype="application/x-www-form-urlencoded" onSubmit="">
        <input class="bluebutton" name="Submit" type="submit" value="Submit">    
        <table class="contentTable">
        <tr> 
          <th class="left">Client ID</th>
          <th class="left">Verification</th>
          <th class="left">Sign In</th>
          <th class="left">Sign out</th>        
          <th class="left">Signature</th>      
           <th class="left">Signature</th>   
        </tr>   
        <c:forEach items='${info.webstore}' var='web' varStatus='status'>
            <jsp:useBean id="status" type="javax.servlet.jsp.jstl.core.LoopTagStatus" />
            <c:choose>
                <c:when test="<%= status.getCount() %2 == 0 %>">
                    <c:set var="rowClass" value="evenRow"/>
                </c:when>
                <c:otherwise>
                    <c:set var="rowClass" value="oddRow"/>
                </c:otherwise>
            </c:choose>  
        <tr> 
          <td class="<c:out value='${rowClass}' /> left"><c:out value='${web.name}'/></td>
          <td class="<c:out value='${rowClass}' /> left"><c:out value='${web.verification}'/></td>        
          <td class="<c:out value='${rowClass}' /> left"><fmt:formatDate value='${web.date_Signin}' type="both" /></td>
          <td class="<c:out value='${rowClass}' /> left"><fmt:formatDate value='${web.date_Signout}' type="both"/></td>                   
          <td class="<c:out value='${rowClass}' />">                        
                 <img src="<c:out value='${web.imageURL}'/>" alt="image" height="142" width="142"> </td>
           </td>

          <td class="<c:out value='${rowClass}' /> left">      
                <a href="clientloginservlet?ST_WebStore_ID=<c:out value='${web.ST_WebStore_ID}'/>&AttachmentIndex=<c:out value='1'/>" target="_blank">
                    <c:out value='${web.fileName}'/> </a         
          </td>                     
        </tr>  
         </c:forEach>     
      </table>  

       </form>    
      </div>

我从附件中获取此图片网址

JAVA

MAttachment attachment = MAttachment.get(ctx, this.get_Table_ID(), record_id);
        if(attachment!=null)
        {
        MAttachmentEntry ent = attachment.getEntry(0);  
            if(ent!=null)
            {
            File f = ent.getFile();
            String filename = f.getName();      
            String path = f.getAbsolutePath();
            setFileName(filename);
            setImageURL(path);
            }
        }

我的图像路径应该是这样的,但图像不显示 <img src="D:\Compiere\jboss-as-7.1.1.Final\bin\ui.png" alt="image" height="142" width="142">

在锚标记中我 <a href="clientloginservlet?record_ID=<c:out value='${web.record_ID}'/>&AttachmentIndex=<c:out value='1'/>" target="_blank"><c:out value='${web.fileName}'/> </a > 无法进入我的 servlet 类

请任何人帮我解决这个问题

4

1 回答 1

0

尝试这样的图像路径

file:///D:/Compiere/jboss-as-7.1.1.Final/bin/ui.png

所以

<img src="file:///D:/Compiere/jboss-as-7.1.1.Final/bin/ui.png" alt="image" height="142" width="142">
于 2015-10-27T05:14:05.353 回答