Use servlet to convert JSP file contents to HTML. The code is as follows:
Package examples;
Import Java.io.ByteArrayOutputStream;
Import Java.io.FileOutputStream;
Import java.io.IOException;
Import Java.io.OutputStreamWriter;
Import
First, JSP Technology overview
After Sun officially released JSP (JavaServer Pages), this new WEB application development technology quickly caught people's attention. JSP provides a unique development environment for creating highly dynamic WEB
The source of the demand is this: Upload a large Excel file to the server, the server will parse this Excel, and then a piece of the insert into the database, the whole process will take a long time, so when users click Upload, you need to display a
Today, every developer using Servlets knows JSP, a web technology that Sun invented and spent a lot of effort to implement and build on the servlet technology. JSP removes the HTML code from the servlet to speed Web application development and page
1, what is the Dynamic Web page.
Dynamic Web pages are programs or Web pages that run on the server side, and they return different pages with different customers and at different times.
NOTE: Insert flash in the static Web page, although Flash is
JSP custom tag tag
the benefits of customizing the tag tagProgrammers can customize some specific function of the tag, to encapsulate the code, to achieve division of labor, reusability and other benefits.how to store tag tagsThe tags folder is
Method One: The simplest is the most used method
<%@ page language="java" pageEncoding="GBK" %>
or
This method is used for Chinese display in JSP pages.
Method Two: Use the filter
Filters are used primarily for form submissions, and data is
Js|xml
One, XML related definition
1,html is just a static document and cannot adapt to requirements. A set of specifications created by the Internet Consortium for XML, for software developers and content creators to organize information on Web
Js|servlet| problem
Why did Genericservlet add an init () method on the basis of Init (ServletConfig config)?
The init () method is called by the Genericservlet.init (ServletConfig config) method.
The init () method facilitates the
js| Data | database | database connection
A database connection is the most important part of a dynamic web site, and the technology for connecting to the database in Java is JDBC (Java Database Connectivity). Many database systems have JDBC drivers,
The first step: we will do some preparatory work-software download and installation:
JDK is 1.4 download: http://java.sun.com/j2se/1.4/index.html
All is the default installation method (tips best to set the JDK directory into a simple situation such
js| Program | random
Color getrandcolor (int fc,int BC) {//random color for a given rangeRandom Random = new Random ();if (fc>255) fc=255;if (bc>255) bc=255;int R=fc+random.nextint (BC-FC);int G=fc+random.nextint (BC-FC);int B=fc+random.nextint
Introduction: This article is the first part of the new JSP Best Practices series, which describes the JavaServer Pages include mechanism. Follow the Java programming expert Brett McLaughlin Learn how to use include to add static header and footer
One of the most overlooked features of JSP is its ability to apply reusable code blocks--aka "tag libraries"-adding new functionality to a JSP application.
These tag libraries, declared using XML type tags, provide ready-made tools that can be
How does the container handle the request resource path?
For example, in the browser address bar type : IP address path /abc.html.Step1. The default Access is a servlet, which looks for a matching servlet from Web. Xml.Web. XML
In the JSP often encounter the JS variable assigned to Java variables, or the Java variable assigned to the JS variable case, the general processing method summarized as follows: Java variable to js good, var a= ""; note that the quotation marks
SummaryIn a password-protected web application, it is not only necessary to call the invalidate () method of httpsession to correctly handle the user exit process. Now most browsers have buttons for moving back and forward, allowing
new document
Servlets filter is newly added to the servlet 2.3 specification. It intercepts the requests submitted by the user from the client and runs when the required resources are not reached. It operates requests from the client, intercepts
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.