Get relative and absolute paths in Servlet and class
Obtain relative and absolute paths in JSP
Absolute path corresponding to the root directory: request. absolute path of the getrequesturi () file: application. getrealpath (request.
To upload files in Wen development, you need to complete the following two steps:
1. Add an upload entry (JSP page or HTML page) to the web page)
2. Read the uploaded data in the servlet and save it to the local hard disk.
Add an upload
Method 1:
Call the Windows doscommand to read the MAC address from the output:
Public static string getmacaddress (){
String address = "";String OS = system. getproperty ("OS. Name ");If (OS! = NULL & OS. startswith ("Windows ")){Try {String
Iii. File and stream problems
About the operation of files, an Elder wrote very full, I copy: http://www.cnblogs.com/lovebread/archive/2009/11/23/1609122.html
1) load all files under the specified directory
1 // Get the target file
How far can we go series (8)
Nonsense:
How far can we go? I want to remind myself not to stop learning and blog updates. This series will always be related to web development. My goal is to write 100. Let's take a look at the progress of 15 goals.
Address: http://coolshell.cn/articles/4758.html
I think there are a lot of cool ShellsArticleBut the most visited part is the article "6 abnormal Hello World", and it can be on the right side of the site"Popular"," How to encrypt source code ",
/** Set the system attributes of the specified key-pair Value* Setproperty (string prop, string value );** Number of shards:* Prop-name of the system property.* Value-value of the system attribute.** Return value:* If there is no previous value in
1. Purpose
If you encounter words that won't be split, you have to replace them with pinyin. However, in this case, we found five reverse lookup tools on the Internet. Finally, I found a good website-not only has five codes corresponding to each
Take the project name/demoweb as an example:The accessed JSP is: http: // localhost: 8080/demoweb/test/index. jsp.
1. Obtain the relative and absolute paths of the current application in JSP.(1) obtain the Project name: request. getcontextpath
After a long time, I finally successfully deployed the openfire source code. Now I have recorded my experiences as follows:
1. Download the source code www.jivesoft.org from the official website.
2. decompress the package and copy it to myeclipse
The JVM will generate three classloader at runtime, bootstrap classloader, extension classloader, and appclassloader. Among them, bootstrap is written in C ++ and we cannot see it in Java. It is null. It is used to load the core class library and
Log Server, the game server is an instance, an important database server, game server, and gateway server... generally, logs are processed by log4j, log4c in C, and log4cpp in CPP. Of course, these log tools are the mainstream open-source frameworks,
Jdk6.0 introduces a new function of dynamic compilation, which allows you to dynamically write a class in the program and then compile it. After being compiled into a class file, you can load the dynamically compiled class into the memory by loading
Comparison of JRE versions with Java
Many programs adopt JDK Development of Higher versions. These programs may use higher versions.
The features of the JDK version cannot be run on the JDK of a lower version or are displayed properly.
To determine
Four Test Machines access the Internet through routers, and the routers access the Internet through dialing. After automatic dial-up, the IP address changes. You must go to the data center to view the public IP address of the router before you can
1. Source of Chinese problems
The computer's initial operating system supports single-byte character encoding. Therefore, in the computer, all processing programs are initially processed in English based on the single-byte encoding. With the
In development tools, for example, a Java file name is called Cat. java.
Right-click cat. Java and choose Properties> resource options. You can see path:/myhibernate/src/cjq/hibernate/tutorial/EG/domesticcat. Java
Type: file (Java source
In Java Development, garbled code is often encountered. Once such a problem is encountered, it is often difficult for everyone to admit that there is a problem with their own code. In fact, the coding problem is not so mysterious, so it is
1: The first method is very simple.
c3p0.driverClass=com.mysql.jdbc.Driverc3p0.jdbcUrl=jdbc:mysql://localhost:3308/databasec3p0.user=rootc3p0.password=root
File Name: c3p0. properties (put under the src directory)
// The program I wrote is
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.