You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by kz <kh...@gmail.com> on 2007/04/23 08:36:33 UTC

Image problem

 Hi,

I am having this problem that images are not shown in the page properly when
we load the page for the first time.

I even tried to pre-load images in my cache. But the problem isn't solved. I
am using IE. Is there any configuration of Tomcat which I am not using
properly? What else could be the problem?


Regards


Khurram.

Re: Image problem

Posted by Johnny Kewl <jo...@kewlstuff.co.za>.
Mmmmmm I had something similar once... maybe same problem.

Are you reading parameters, that then say describe the path to the image?

If so, then what could be happening is you are going straight to the JSP 
page and the servlet has not initialised yet, it hasnt read the params yet!

ie Direct links to Jsps need to init themselves....

So I imagine.... JSP looks imageLESS.... then you post a response to say the 
servlet.... params are read.... then JSP looks good again.

have fun....


----- Original Message ----- 
From: "kz" <kh...@gmail.com>
To: "Tomcat Users List" <us...@tomcat.apache.org>
Sent: Monday, April 23, 2007 8:36 AM
Subject: Image problem


> Hi,
>
> I am having this problem that images are not shown in the page properly 
> when
> we load the page for the first time.
>
> I even tried to pre-load images in my cache. But the problem isn't solved. 
> I
> am using IE. Is there any configuration of Tomcat which I am not using
> properly? What else could be the problem?
>
>
> Regards
>
>
> Khurram.
> 


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Image problem

Posted by Martin Gainty <mg...@hotmail.com>.
please display jsp (with the iframe)

M--
This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed.  If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.

----- Original Message ----- 
From: "kz" <kh...@gmail.com>
To: "Tomcat Users List" <us...@tomcat.apache.org>
Sent: Thursday, April 26, 2007 6:46 AM
Subject: Re: Image problem


> Actually, I have different iframes on my page and the images are used in
> pages loaded in those iframes. The problem is that the images shown in the
> first iframe are not shown properly (i have divs which are sized on the
> basis of the width of image width, those are all wrong the first time
> and the styles are wrong also ). Now when a different page or same page is
> loaded (which uses the same iamges) in the same of any other iframe, the
> images become right.
> Im sorry I cannot check the behaviour on firefox or any browser other than
> IE coz my pages use ActiveX controls etc
> No Christopher, Im not using Tomcat behind Apache.
> Johnny, Im sure the servlets are initialized coz they serve a lot of
> requests before I load the page in the iframe.
>
> Im using "apache-tomcat-5.5.23-embed"
> Im using css for the images.. Heres a sample class.
>
> .secactiveleft {
> background-image: url(images/TabControl/sec_active_tab_left.gif);
> height: 25px;
> width: 18px;
> }
>
> Thank you
>
>
>
> Regards,
>
> Khurram
>
>
> On 4/23/07, Christopher Schultz <ch...@christopherschultz.net> wrote:
>>
>> Khurram,
>>
>> kz wrote:
>> > I am having this problem that images are not shown in the page
>> > properly when we load the page for the first time.
>>
>> Are you using Apache httpd in front of Tomcat? This often happens before
>> Tomcat has decided that your browser can support cookies and so all your
>> URLs have the session id encoded in them.
>>
>> Apache httpd is confused by these URLs when asked to handle them and
>> ends up returning 404s for those requests. It happens with any encoded
>> URL that you use from Tomcat (such as CSS files, etc.) and the main
>> symptom is that images do not show up and the styles are missing.
>>
>> A simple RELOAD of the page in the browser often will redisplay the page
>> properly.
>>
>> If this is the problem, then there are two obvious solutions:
>>
>> 1. Use mod_rewrite to trim-off ";jsessionid=[0-9A-Z]+" from your URLs.
>>   This incantation worked for me:
>>
>>   RewriteRule /your-app/(.*);jsessionid=[0-9A-Z]*(.*)   \ (no newline)
>>               /path/to/tomcat/webapps/your-app/$1$2 [L]
>>
>> 2. Use mod_jk's new JkStripSession attribute (1.2.21 or later, I think).
>>
>> > I even tried to pre-load images in my cache. But the problem isn't
>> > solved. I am using IE. Is there any configuration of Tomcat which I
>> > am not using properly? What else could be the problem?
>>
>> Does this only happen in MSIE?
>>
>> -chris
>>
>>
>> ---------------------------------------------------------------------
>> To start a new topic, e-mail: users@tomcat.apache.org
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
> 


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Image problem

Posted by kz <kh...@gmail.com>.
Actually, I have different iframes on my page and the images are used in
pages loaded in those iframes. The problem is that the images shown in the
first iframe are not shown properly (i have divs which are sized on the
basis of the width of image width, those are all wrong the first time
and the styles are wrong also ). Now when a different page or same page is
loaded (which uses the same iamges) in the same of any other iframe, the
images become right.
Im sorry I cannot check the behaviour on firefox or any browser other than
IE coz my pages use ActiveX controls etc
No Christopher, Im not using Tomcat behind Apache.
Johnny, Im sure the servlets are initialized coz they serve a lot of
requests before I load the page in the iframe.

Im using "apache-tomcat-5.5.23-embed"
Im using css for the images.. Heres a sample class.

.secactiveleft {
 background-image: url(images/TabControl/sec_active_tab_left.gif);
 height: 25px;
 width: 18px;
}

Thank you



Regards,

Khurram


On 4/23/07, Christopher Schultz <ch...@christopherschultz.net> wrote:
>
> Khurram,
>
> kz wrote:
> > I am having this problem that images are not shown in the page
> > properly when we load the page for the first time.
>
> Are you using Apache httpd in front of Tomcat? This often happens before
> Tomcat has decided that your browser can support cookies and so all your
> URLs have the session id encoded in them.
>
> Apache httpd is confused by these URLs when asked to handle them and
> ends up returning 404s for those requests. It happens with any encoded
> URL that you use from Tomcat (such as CSS files, etc.) and the main
> symptom is that images do not show up and the styles are missing.
>
> A simple RELOAD of the page in the browser often will redisplay the page
> properly.
>
> If this is the problem, then there are two obvious solutions:
>
> 1. Use mod_rewrite to trim-off ";jsessionid=[0-9A-Z]+" from your URLs.
>   This incantation worked for me:
>
>   RewriteRule /your-app/(.*);jsessionid=[0-9A-Z]*(.*)   \ (no newline)
>               /path/to/tomcat/webapps/your-app/$1$2 [L]
>
> 2. Use mod_jk's new JkStripSession attribute (1.2.21 or later, I think).
>
> > I even tried to pre-load images in my cache. But the problem isn't
> > solved. I am using IE. Is there any configuration of Tomcat which I
> > am not using properly? What else could be the problem?
>
> Does this only happen in MSIE?
>
> -chris
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: Image problem

Posted by Christopher Schultz <ch...@christopherschultz.net>.
Khurram,

kz wrote:
> I am having this problem that images are not shown in the page
> properly when we load the page for the first time.

Are you using Apache httpd in front of Tomcat? This often happens before
Tomcat has decided that your browser can support cookies and so all your
URLs have the session id encoded in them.

Apache httpd is confused by these URLs when asked to handle them and
ends up returning 404s for those requests. It happens with any encoded
URL that you use from Tomcat (such as CSS files, etc.) and the main
symptom is that images do not show up and the styles are missing.

A simple RELOAD of the page in the browser often will redisplay the page
properly.

If this is the problem, then there are two obvious solutions:

1. Use mod_rewrite to trim-off ";jsessionid=[0-9A-Z]+" from your URLs.
   This incantation worked for me:

   RewriteRule /your-app/(.*);jsessionid=[0-9A-Z]*(.*)   \ (no newline)
               /path/to/tomcat/webapps/your-app/$1$2 [L]

2. Use mod_jk's new JkStripSession attribute (1.2.21 or later, I think).

> I even tried to pre-load images in my cache. But the problem isn't 
> solved. I am using IE. Is there any configuration of Tomcat which I
> am not using properly? What else could be the problem?

Does this only happen in MSIE?

-chris


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Image problem

Posted by David Smith <dn...@cornell.edu>.
Details would help here.  Are you saying the images show on the second 
page load?  Also what version of tomcat, some info on you setup, some 
example code showing the <img /> tag in the pages, etc. , ...

--David

kz wrote:

> Hi,
>
> I am having this problem that images are not shown in the page 
> properly when
> we load the page for the first time.
>
> I even tried to pre-load images in my cache. But the problem isn't 
> solved. I
> am using IE. Is there any configuration of Tomcat which I am not using
> properly? What else could be the problem?
>
>
> Regards
>
>
> Khurram.
>


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org