Implementation of ASP uploading image to database function Generic no-component upload class, the upload process is to save the picture to the specified folder, at the same time save the path to the database field. Show The picture is displayed
In many Web applications, in order to do different jobs, one HTML form tag may have two or more submit buttons, and Struts2 provides another method, this allows you to execute different methods in the same action class without any configuration (the
1: Install the mysql database on the data server. This is required. On your own ssh or virtual machine, you can see related prompts on data mysql, indicating that the installation is successful:
2: I am using a tomcat server. Here, I need to
1. What is static import?
Static import refers to embedding an external file into the current JSP file and parsing the JSP statement on this page. It also contains other compilation commands on the target page.Include static import command
In jsp learning, variables on the other jsp page are often called on one jsp page. The following is a summary of the learning over the past few days.
There are multiple methods to call variables between jsp pages:
1. Get parameters through the
The initial space (-Xms) is 1/64 of the physical memory, and the maximum space (-Xmx) is 1/4 of the physical memory.You can use options such as-Xmn-Xms-Xmx provided by JVM to set
Example:Copy codeThe Code is as follows:JAVA_OPTS =
There are several methods for jsp to obtain the session value from the action:
For example, there is a session ("sessionid", "sessionValue") in my action ")
1. Obtain it using the struts Tag:
Ii. session is also one of the built-in objects and
Due to the introduction of package commands and other processing in JSP, the source code of the rendered page contains many line breaks. There are many ways to solve the problem in the past, such as 1. Pay attention to the format in the source code,
Preface
This document describes how to use Tomcat as the j2ee container and Sqlserver2005 as the database. Struts version 2.3.15.3Struts Introduction
Struts is an open-source project sponsored by the Apache Software Foundation (ASF. Struts is an
SQL injection attacks are introduced to Web applications by constructing special input as parameters. These inputs are mostly combinations in SQL syntax, attackers can execute SQL statements to perform the operations they want. The main reason is
There are several methods for jsp to obtain the session value from the action:For example, there is a session ("sessionid", "sessionValue") in my action ")1. Use the struts tag to obtain: Ii. session is also one of the built-in objects and can be
Generally, the following two packages must be referenced to develop jsp custom tags:
ImportJavax. servlet. jsp .*;
ImportJavax. servlet. jsp. tagext .*;
First, we need to get a general idea of the interface and class hierarchy involved in the
(1) Install Tomcat7 in Ubuntu:
It is very easy to install tomcat7 in ubuntu. Just refer to [1],
(1) type the command:
Sudo apt-get install tomcat7,
(2) check the website http: // localhost: 8080/
In my version it is showed like this:
(2) If
Unlike the compilation command, the compilation command notifies the Servlet engine to process messages, and the Action Command is only a script action during running. The compilation command works when compiling JSP into Servlet: The processing
Possible reasons why the Struts2 verification framework does not work1. Whether the name complies with the Conventions:-Validation. xml-- Validation. xml2. Check whether the validation. xml tag is correct, such as whether to disable all tags and
1. the jsp sends a value to the action. The jsp sends the value to the action.
1. form submission method
2. href Method
"> Delete
Ii. Pass a value to the action in jsp. method accepted by the action
1. Define form attributes in the Action class.
DebuggingInterceptor: the interceptor processes the seventh position of defaultStack. It can be called for debugging. I personally think that although the interceptor contains the most code, it is the most useless Interceptor. This interceptor
ScopedModelDrivenInterceptor: the interceptor is in the eighth position of defaultStack. Its main function is to retrieve the corresponding model settings from the specified scope to the Action. This class has three related attributes: scope: where
The StrutsConversionErrorInterceptor interceptor is at the position of defastack stack 16th and is used to handle type conversion errors. The interceptor inherits from ConversionErrorInterceptor and most of its functional logic is in
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