JBuilder2005 servlet Development Download Type

Source: Internet
Author: User
Tags system log

In this verse, we have a welcome. JSP page is modified to add a link to the page that calls the servlet to download the system log file that is logged in the previous section.

Creating Excelfileservlet with wizards

1. file->new...->web-> Double-click the standard servlet icon to start the wizard to create the standard servlet.

Specifies that the servlet class is named Excelfileservlet, sets the package name to Bookstore.servlet, and presses next to the next step.

2, choose the cover doget () processing method.

Figure 11 Overriding the Servlet method

· Servlet:creates content type:unspecified, set the type of the servlet's build document, as the servlet is downloaded as an Excel file and as an attachment, We need to manually set the response content type of the servlet.

implements Methods:doget (), so the wizard will generate a Doget () method framework.

Press next to the next step.

3, define the URL parameters for the servlet.

Figure 12 Defining the URL parameters for the servlet

Click Add parameter a new line appears in the parameter list, define the URL parameter for the servlet in the new row, where name is the name of the parameter with the URL, and variable is the corresponding variable name in the servlet. You can also specify comments and defaults for variables through desc and default, and specify the type of the variable in the Type column.

We have defined two URL parameters, year and month, which specify the years and months in which the log needs to be downloaded. Press next to the next step.

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.