Ssd1 Pratical-quiz-6 answer

Source: Internet
Author: User
Tags java decompiler
{Statement: Do not reprint}
At that time, it seems that I used DJ Java decompiler to decompile the. Class file given by icarnegie, and then copied some code. The code I provided does not seem to be able to compile. Please be careful.
/**
* Author:
* Date: 05-09
* Description: exercise6
*/
Import java. Io .*;
Import javax. servlet .*;
Import javax. servlet. http .*;

Public class oogallery extends httpservlet {
Public void dopost (httpservletrequest request,
Httpservletresponse response)
Throws servletexception, ioexception {

/**
* Indicate the content type (for example, text/html ),
* Being returned by the response
*/
/* Add your code here */

Response. setcontenttype ("text/html ");

/**
* Retrieve an output stream to use to send data to the client
*/
/* Add your code here */

Printwriter out = response. getwriter ();
/**
* Get the user input from the form
*/
/* Add your code here */
String themepicture1 = request. getparameter ("theme") + "one ";
String themepicture2 = request. getparameter ("theme") + "two ";
String backgroundimage = "/" + request. getparameter ("bgrnd") + ". GIF ";
String bgcolor = "# fff8dc ";


/**
* Create an instance of the htmlpage class
*/
/* Add your code here */
Htmlpage = new htmlpage ();

/**
* Create an instance of the htmlimage class for the first image
*/
/* Add your code here */
Htmlimage htmlimage1 = new htmlimage ("/" + themepicture1 + ". jpg", themepicture1 );

/**
* Create an instance of the htmlimage class for the second image
*/
/* Add your code here */
Htmlimage htmlimage2 = new htmlimage ("/" + themepicture2 + ". jpg", themepicture2 );

/**
* Set the attributes of the htmlpage object
*/
/* Add your code here */
Htmlpage. settitle ("oogallerypage using htmlpage and htmlimage classes ");
Htmlpage. setbackgroundimage (backgroundimage );
Htmlpage. setbackgroundcolor ("bgcolor ");


/**
* Add the images
*/
/* Add your code here */
String picture1 = htmlimage1.buildhtml ();
String picture2 = htmlimage2.buildhtml ();
Htmlpage. addtext (picture1 );
Htmlpage. addtext ("<br> ");
Htmlpage. addtext ("<br> ");
Htmlpage. addtext (picture2 );

/**
* Finish building the web page
*/
/* Add your code here */
Out. println (htmlpage. buildhtml ());

}
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.