Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to display more number of images in a jsp page ?  RSS feed

 
abinash das
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have developed an application where some number of images are getting displayed in a jsp page.

What happens is when the number of images(.jpg) increases to 40 then instead of the images only blank space is coming with border and we have to manually use the
show pictures option to view the image.


I have tried to increase the buffer size also but it's not that effective.

Please suggest some ways to handle such a scenario.

Thanks in advance
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66207
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This will have nothing whatsoever to do with the buffer size of your JSP. The images aren't being served along with the JSP; they are each fetched using their own request when the HTML hits the browser.
 
abinash das
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:This will have nothing whatsoever to do with the buffer size of your JSP. The images aren't being served along with the JSP; they are each fetched using their own request when the HTML hits the browser.


Thanks Bibeault ,

I was thinking in terms of jsp buffer size to display the images.
So can you tell me why exactly i am facing such an issue and whats the solution for that ?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66207
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
abinash das wrote:I was thinking in terms of jsp buffer size to display the images.

The images are not part of the JSP, so the buffer size of the JSP is completely irrelevant.

So can you tell me why exactly i am facing such an issue and whats the solution for that ?

I cannot. You should start inspecting the requests that are begin generated to fetch the images from the browser to see if they hold a clue to what is going on. Perhaps HttpFox for Firefox would be able to help.
 
abinash das
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:
abinash das wrote:I was thinking in terms of jsp buffer size to display the images.

The images are not part of the JSP, so the buffer size of the JSP is completely irrelevant.

So can you tell me why exactly i am facing such an issue and whats the solution for that ?

I cannot. You should start inspecting the requests that are begin generated to fetch the images from the browser to see if they hold a clue to what is going on. Perhaps HttpFox for Firefox would be able to help.



thanks Bibeault,i found it true when i used a HttpRequest analyzer for the request in
internet explorer that all request are being served separately.

during my analysis i am not able to find much of the differences .
can you tell me in this particular scenario which attribute are the key differentiators.



 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'd say the first step is to find out whether the requests or the images are sent correctly by the browser, and received correctly by the server. The server log files should be helpful in figuring that out, as might a client-side proxy in case the server doesn't receive all the requests.
 
abinash das
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf Dittmer wrote:I'd say the first step is to find out whether the requests or the images are sent correctly by the browser, and received correctly by the server. The server log files should be helpful in figuring that out, as might a client-side proxy in case the server doesn't receive all the requests.


Actually in my application there is a option for the user to select number of check boxes
based on which images will be generated.
example:
lets say there are 6 check boxes A,B,C,D,E,F

based on the selection chart images are created for each check box around 5 images are getting created.

when user selecting some combination's he is getting the images and with some other combination he is not.
The most interesting thing is there is nothing common in between the two options ,So i am confused like why the same option
works and for some combination and doesn't for some.

For the combination it is not working it comes like a cross symbol,and when
i use show picture option of windows then only the picture is getting displayed.

I checked in the Server.log file also, not able to find any difference as such
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
None of this is relevant to the problem at hand. The important thing is whether the page that is returned to the client contains links to those images, whether those links are correct, and whether the images are being requested by the browser (which they should).

server.log is probably the wrong place to look; what you want to find whether the images are getting requested by the browser, and whether the request URLs are correct. Where that information is depends on the server you're using; for Tomcat it would be in the log/access.log file. You may have to enable the access log in the server.xml file.
 
abinash das
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf Dittmer wrote:None of this is relevant to the problem at hand. The important thing is whether the page that is returned to the client contains links to those images, whether those links are correct, and whether the images are being requested by the browser (which they should).

server.log is probably the wrong place to look; what you want to find whether the images are getting requested by the browser, and whether the request URLs are correct. Where that information is depends on the server you're using; for Tomcat it would be in the log/access.log file. You may have to enable the access log in the server.xml file.


What was actually happening in my application i am creating some charts which contains some time more than 10,00 points and kept in the jsp page
such that the user can view the coordinates of the points on the charts,when the number of such charts are increasing some charts are not getting displayed
and the page gets hanged .Currently i removed those pints object lying in the jsp page ,so now all the images are coming properly.

but i need the points also on the charts ,to be displayed ,what should i do so the at least the memory management can be done on the jsp page.
and all the charts will come normaly
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That probably has nothing to do with JSP, and all with how those chart images are generated. Are you certain that those images are not generated eventually, and just take a long time to do so?
 
abinash das
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf Dittmer wrote:That probably has nothing to do with JSP, and all with how those chart images are generated. Are you certain that those images are not generated eventually, and just take a long time to do so?


Ya i am quite sure to generate the images it is not taking much of the time but when i am keeping the object related to the chart in the page which is of very high value makes the image size all total to some time 5 -6 mb,in that case only i am finding issues if i am commenting the portion of the code that keeps the chart object coordinates it is coming properly.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!