on 06-14-2006 9:33 AM
Hi,
Iam creating an portal application (NWDS)in which i need to include a image/.bmp file into it, please let me known where exactly(folder) I should keep the image file.
I tried keeping it in the dist/images folder, even though i cannot see the image file in the ouput.
Please let me know.
Thanks,
Sri.
Done.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Try out this....
<%
String values = componentRequest.getWebResourcePath() + "/images/color.bmp";
out.println("<tr><td width = 20 height=18 background = "values">");
out.println("<strong><samp> 1 </samp></strong></td>");
%>
Regards,
Uma
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Try out this code inside your jsp page...
<% String ImageURL = componentRequest.getWebResourcePath() + "/images/img1.gif"; %>
<img src="<%=ImageURL%>">
Regards,
Uma
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
This is my code
<% String values = componentRequest.getWebResourcePath() + "/images/color.bmp"; %>
out.println("<tr><td width = 20 height=18 background = <%=values%>");
out.println("<strong><samp> 1 </samp></strong></td>");
It throws an error as below :
Portal Runtime Error
An exception occurred while processing a request for :
iView : N/A
Component Name : N/A
Error in executing a process for compilation, D:/usr/sap/J2E/JC00/j2ee/cluster/server0/apps/sap.com/irj/servlet_jsp/irj/root/web-inf/portal/portalapps/myprtproject/work/pagelet/_sapportalsjsp_testjsp.java:122: illegal start of expression out.println("
1 "); ^ 3 errors .
Exception id: 06:45_14/06/06_0181_1009250
See the details for the exception ID in the log file
Hi,
you have to add the file to dist/images.
If you now want to use the image you can get the link to it with the following code:
IResource rs = request.getResource(IResource.IMAGE, "images/image.gif");
String url = rs.getResourceInformation().getURL(request);
By the way, I would recommend that you convert the BMP to a JPG or GIF. Otherwise you have much more traffic than needed.
Regards,
Dennis
Message was edited by: Dennis Junker
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Do you want to know how to display it on the JSP or how to include it into your project?
For including it into your project, open the folder dist and click right on the images folder.
Then you can choose import and there you choose filesystem.
From that point you can just browse for the image and add it to your project.
I hope this helps.
Regards,
Dennis
you have to have a dataBean which is refered in the JSP.
Try it like that:
JAVA part(doInitialization for example):
...
IResource rs = request.getResource(IResource.IMAGE, "images/icon_search.gif");
dataBean.setImage(rs.getResourceInformation().getURL(request));
...
In the JSP use that:
<jsp:useBean id="dataBean" scope="session" class="com.test.DataBean" />
...
...
<IMG src="<%=dataBean.getImageSearch()%>">
...
Regards,
Dennis
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.