|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.sas.Component | +--com.sas.servlet.beans.BaseTransformation | +--com.sas.servlet.beans.BaseImage | +--com.sas.servlet.beans.html.Image
Transformation bean definition for creating an HTML form image.
Problem: Create a document using JSP that contains an image
Solution: Write a Java scriptlet in a JSP page that uses the Image Transformation Bean to create the HTML element.
JSP Page:
<html> <body> <p> This example shows a simple image generated by the Image Transformation Bean. </p> <FORM> <% // Create a new image object com.sas.servlet.beans.ImageInterface image = new com.sas.servlet.beans.html.Image();
image.setName("stuff"); image.setImage("images/beavis.gif"); image.write(out); %> </FORM> </body> </html>
HTML output:
<html> <body> <p> This example shows a simple image generated by the Image Transformation Bean. </p> <FORM> <INPUT TYPE=image NAME="stuff" SRC="images/beavis.gif"> </FORM> </body> </html>
Live element:
Constructor Summary | |
Image()
Constructs a new Image Transformation Bean |
|
Image(String name)
Constructs a new Image Transformation Bean |
|
Image(String name,
String image)
Constructs a new Image Transformation Bean |
|
Image(String name,
String image,
int width,
int height)
Constructs a new Image Transformation Bean |
Method Summary | |
void |
write(PrintWriter out)
Writes the transformed representation of the object |
Methods inherited from class com.sas.servlet.beans.BaseImage |
getAlignment,
getAlternateText,
getHeight,
getHorizontalSpace,
getImage,
getName,
getVerticalSpace,
getWidth,
setAlignment,
setAlternateText,
setHeight,
setHorizontalSpace,
setImage,
setName,
setVerticalSpace,
setWidth |
Methods inherited from class com.sas.servlet.beans.BaseTransformation |
getCustomAttributes,
getDescription,
getParent,
getRequest,
getResponse,
setCustomAttributes,
setDescription,
setParent,
setRequest,
setResponse,
toString,
write,
write,
write |
Methods inherited from class java.lang.Object |
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Constructor Detail |
public Image()
public Image(String name)
name
- The image namepublic Image(String name, String image)
name
- The image field nameimage
- The image sourcepublic Image(String name, String image, int width, int height)
name
- The image field nameimage
- The image sourcewidth
- The image widthheight
- The image heightMethod Detail |
public void write(PrintWriter out) throws IOException
out
- The output stream
Examples of image output are:
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |