473,750 Members | 2,308 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1694
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.i o.*,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.setCon tentType("image/gif");
OutputStream outStream = response.getOut putStream();
synchronized(re sponse.getOutpu tStream()){
outStream.write (spacer);
}
response.flushB uffer();
}catch(IOExcept ion e){
System.out.prin tln("IO Exception details 1 : " + e.getMessage()) ;
}catch(Exceptio n e){
System.out.prin tln("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
5053
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
2387
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 this behavior, I'd greatly appreciate it. I'm leaving the example at the bottom. There is a variable, fmt, within the test0 function which can be changed from -1 (pickle.HIGHEST_PROTOCOL) to 0 (ascii). The behavior between the two pickle...
5
2932
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 squares, 0's in red squares and *'s in yellow squares.
0
2179
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
7400
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 there are multiple pages per invoice. How can I grab the data, make the TIF, place it on the client and then Open with the clients default program for veiwing TIF's (usually Microsoft Picture and Fax Viewer). Please help.
2
2291
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 : <% set conn=server.CreateObject("ADODB.Connection") conn.Provider="Microsoft.jet.oledb.4.0" conn.Open(server.MapPath("test1.mdb"))
8
2555
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 using "C".can anybody tell me how to represent it as a .bmp file?I could read data from an existing .bmp file...but couldnt construct that type of file...I tried to add header to the data directly..but the constructed image is not the one which...
18
2097
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); printf("Player Name (form): %s", player2);
15
2055
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 or by the below program It lets you place a palette from a file or from a program on the clipboard and allows you to retrieve one from the clipboard. But you'll find the retrieved one is always "Nothing"
0
8997
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8833
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9568
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9389
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9256
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8257
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6801
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
2
2794
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2218
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.