473,406 Members | 2,707 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Need an ascii image format!

Hi,

I developing a system using JSP. People familiar with this technology
know that ServerPages are easier to maintain than Servlets, but they
can only have ASCII output.

With that as the backdrop, here's what I want to accomplish. I want
clicking on a link to cause a script to be executed on the server but
-->I don't want the browser to jump to another page<--.

A solution that I conceived was to have javascript like

someimage.src = 'http://myscript'

This will accomplish the task and it would be great if myscript return
an image of a checked checkbox! But, because of JSP limitations this
would need to be an ASCII image.

So my question is twofold:
1. Are there convenient ASCII image formats?
2. Is there another way to accomplish what I want (trigger some action
on the server without jumping to another page and using js to display
a sensible response - something like a check)?

Thanks!

Bura
Jul 23 '05 #1
1 1684
Bura Tino wrote:
I developing a system using JSP. People familiar with this technology
know that ServerPages are easier to maintain than Servlets, but they
can only have ASCII output.

<snip>

Not true, you can output anything from a JSP because a JSP is a
servelet. You just have to be careful not to output any character data
(including CR/LF pairs) prior to resetting the response and starting to
output binary e.g.:-

<%@ page language="java" import=",java.io.*,java.util.*"%><%!
final static byte[] spacer = {
71, 73, 70, 56, 57, 97, 1, 0, 1, 0, -128, 1, 0, -1, -1, -1,
0, 0, 0, 44, 0, 0, 0, 0, 1, 0, 1, 0, 0, 2, 2, 68, 1, 0, 59
};
%><%
try{
response.reset();
response.setContentType("image/gif");
OutputStream outStream = response.getOutputStream();
synchronized(response.getOutputStream()){
outStream.write(spacer);
}
response.flushBuffer();
}catch(IOException e){
System.out.println("IO Exception details 1 : " + e.getMessage());
}catch(Exception e){
System.out.println("Exception details 2 : " + e.getMessage());
}%>

But JSP is OT here.

Richard.
Jul 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: lawrence | last post by:
Can someone please tell me where I can get some open source code for resizing images? I know such code has been written a million times and I don't feel like doing it again from scratch.
7
by: Bix | last post by:
As this is my very first post, I'd like to give thanks to all who support this with their help. Hopefully, this question hasn't been answered (too many times) before... If anyone could explain...
5
by: Karthik | last post by:
Hi, I have an ASCII text file which contains 1's,0's and *'s. The file looks something like this 0 1 1 * 1 1 1 0 * * * 0 1 0 1 I want to create an image file which shows the 1's in green...
0
by: Anonieko Ramos | last post by:
> I have a graphics images that I want to convert to > ASCII art. How do I do it? > Code: - Default.aspx.cs
4
by: Phil | last post by:
k, here is my issue.. I have BLOB data in SQL that needs to be grabbed and made into a TIF file and placed on the client (could be in temp internet dir). The reason we need it in TIF format is...
2
by: Chris3000 | last post by:
All i wanna do is simple, I wanna display an image from an access database. I try alot of things to no result. Like ascii code or nothing but a blank image with a red 'X'. Here is the code : ...
8
by: mvkml | last post by:
hi! I am working with bmp files for my project.I am having the pixel data (binary.. i.e;10001001001..)and i need to represent it as a .bmp file.I need to construct an image(.bmp) from this data...
18
by: Scott | last post by:
Hi, a problem with this following code is really bugging me. tform = fopen(country, "r"); fseek(tform, 9L, SEEK_SET); fgets(player2, 38, tform); printf("Player Name (save): %s", player);...
15
by: active | last post by:
Below is a small but complete program that appears to show you can't retrive a Palette from the clipboard. This is true whether the palette is placed on the clipboard by Photoshop or Photoshop...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.