Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    Senior Coder
    Join Date
    Dec 2005
    Location
    Slovenia
    Posts
    1,958
    Thanks
    120
    Thanked 76 Times in 76 Posts

    Embeding <%%> into html ?

    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");
    %>


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

  • #2
    Senior Coder nikkiH's Avatar
    Join Date
    Jun 2005
    Location
    Near Chicago, IL, USA
    Posts
    1,973
    Thanks
    1
    Thanked 32 Times in 31 Posts
    Assuming the file has the proper extension and the server is serving it right, you forgot the equal sign.

    <%= a %>

    If this post contains any code, I may or may not have tested it. It's probably just example code, so no getting knickers in a bunch over a typo, OK? If it doesn't have basic error checking in it, such as object detection or checking if objects are null before using them, put that in there. I'm giving examples, not typing up your whole app for you. You run code at your own risk.
    Bored? Visit
    http://www.kaelisspace.com/

  • #3
    Senior Coder
    Join Date
    Dec 2005
    Location
    Slovenia
    Posts
    1,958
    Thanks
    120
    Thanked 76 Times in 76 Posts
    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 ? .....

  • #4
    Senior Coder nikkiH's Avatar
    Join Date
    Jun 2005
    Location
    Near Chicago, IL, USA
    Posts
    1,973
    Thanks
    1
    Thanked 32 Times in 31 Posts
    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.

    If this post contains any code, I may or may not have tested it. It's probably just example code, so no getting knickers in a bunch over a typo, OK? If it doesn't have basic error checking in it, such as object detection or checking if objects are null before using them, put that in there. I'm giving examples, not typing up your whole app for you. You run code at your own risk.
    Bored? Visit
    http://www.kaelisspace.com/

  • #5
    Senior Coder
    Join Date
    Dec 2005
    Location
    Slovenia
    Posts
    1,958
    Thanks
    120
    Thanked 76 Times in 76 Posts
    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 ?

  • #6
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Something like this
    Code:
    C:\Documents and Settings\Miran\...\web\jpg\DSC_0108mod3slofoto.JPG
    should be this
    Code:
    file:///C|/Documents and Settings/Miran/../web/jpg/DSC_0108mod3slofoto.JPG
    That should work in IE as well.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #7
    Senior Coder
    Join Date
    Dec 2005
    Location
    Slovenia
    Posts
    1,958
    Thanks
    120
    Thanked 76 Times in 76 Posts
    ok, thanks will deal with it (-:


  •  

    Posting Permissions

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