View Full Version : Embeding <%%> into html ?

12-26-2005, 09:49 AM
This page displays as popup as result of call from java scipt.

1.Basicaly I need to know what would be correct syntax to make red line work.
'a' contains same string as one line before(which works) red line.
2. Hmm, can be this image autosized to predefined dimensions of popup window ?

Thanks for replay.

<%@page contentType="text/html"%>

String a = request.getParameter("FilePathAndName");

<meta http-equiv="Content" ...>
<title>JSP Page</title>
<IMG src="C:/DSC_0108mod3slofoto.JPG">
<IMG src="<% a %>">

12-27-2005, 02:22 PM
Assuming the file has the proper extension and the server is serving it right, you forgot the equal sign.

<%= a %>

12-27-2005, 04:30 PM
Hmm u are assuming wrong (-:. I might find an answer why steel does not work if you point me to some link that explains:

how come that this code
<IMG src="C:\Documents and Settings\Miran\...\web\jpg\DSC_0108mod3slofoto.JPG" alt="no picture">
shows picture runned from IE
and does not, runned from Firefox ?

how shoud this look like in firefox ?

Is this operating system dependant ? .....

12-27-2005, 05:10 PM
Because the two browsers use file protocols differently.
Why are you pointing to an image in someone's C Drive, anyway? That's not the usual way things load from the web. ;)

12-28-2005, 08:46 AM
Pointing coz I'm thinking that user should preview picture before submission to avoid mistakes.
I mean if you look at this sample: DSC_0108mod3slofoto.JPG or even if it would be only DSC_0108.jpg which comes directly from Nikon, it woud be easy to make mistake and submit wrong photo.

anyway, where can I read about this different file protocolos, and since I'm developing on windows, how would this affect things on linux machine where at the end my app will be ?

12-28-2005, 12:30 PM
Something like this

C:\Documents and Settings\Miran\...\web\jpg\DSC_0108mod3slofoto.JPG
should be this

file:///C|/Documents and Settings/Miran/../web/jpg/DSC_0108mod3slofoto.JPG
That should work in IE as well.

12-28-2005, 01:01 PM
ok, thanks will deal with it (-: