包含标签:Java 的文章
-
Java format() method: format string
Grammar 1 format(String format,Object……args) Example String str = String.format("%d",400/2); String str2 = String.f…… -
JSP application. Removeattribute() method: removes the specified attribute
removeAttribute(String name) Example <% application.setAttribute("user","lzw"); application.removeAttribute…… -
Java Connection. Close() method: close the connection object
close() Example Connection conn = …… //省略部分代码 conn.close(); //将连接关闭 -
Jsp: setproperty: property value setting tag
< jsp: setproperty name = "bean instance name" {property = "*" | property = "propertyname" | property = "propertyna…… -
JSP Response. Containsheader() method: judge whether the HTTP file header with the specified name already exists
addIntHeader(String name,int value) Example <%=new Date()%> <% response.addheader("Refresh","1"); …… -
Implementation of Java multithreading
Inherit thread class public class Thread implements Runnable public class NewThreadName extends Thread { //New…… -
JSP PageContext. GetException () method: get the current exception object
getException() Example <%@page language="java" errorPage="error.jsp" pageEncoding="GBK"%> <% Integ…… -
JSP PageContext. Getsession () method: returns the current session object
getSession() Example <% HttpSession s = pageContext.getSession(); s.setAttribute("user","C语言中文网"); %&…… -
Java List. Iterator () method: iterates over the list elements
iterator() Typical application public static void main(String[] args){ List<String>list = new ArrayList&l…… -
JSP Page. Equals () method: compare two objects
equals(Object obj) Example <% boolean b = page.equals(page); out.print(b); %> -
Java Connection. Commit() method: commit the transaction
commit() Example Connection conn = …… //省略部分代码 conn.setAutoCommit(false); //先将事务设为手动提交 Statement…… -
JSP Request. Getheaders () method: returns all the values of the request header with the specified name
getHeaders(String name) Example <% Enumeration cts = request.getHeaders("accept-encoding"); while(cts.hasMo…… -
Java length() method: get the length of the string
length(); Example String strCom2="C语言中文网"; int length=strCom2.length(); Typical application Define the string …… -
JSP Request. Getdateheader () method: get the long value of the build date object
getDateHeader(String name) Example <% out.println(request.getDateHeader("Expires")); %> -
Other println methods for JSP out objects
public abstract void println(boolean b)throws IOException public abstract void println(char c)throws IOException publi…… -
Java substring() method: evaluate substring (intercept string)
Grammar 1 substring(int beginIndex) Example String strCom = "I Like Java"; String strResult = strCom.substring(3); …… -
JSP application. Getrealpath() method: get the real path of the virtual path
getRealPath(String path) Example <% String path=application.getRealPath("index.jsp"); out.println(path); %…… -
Java UDP communication: Java datagram socket class and datagram packet class
Datagram packet class Datagram socket class Example 1 public static void main(String[] args) { DatagramSocket …… -
Java Map. Clear() method: removes all mapping relationships from the map collection
clear() Example public static void main(String[] args){ Map map = new HashMap(); //定义Map集合 map.put("昨天"…… -
What is a URL? And URL class and urlconnection class
URL concept protocol://resourceName http://www.sun.com/ 协议名://主机名 http://localhost:8080/Test/admin/logi…… -
JSP from simple to deep (12) — form editing
For example, the flag library from the blazix server cannot be used in your system environment, so what about not usin…… -
Several problems easily confused by java beginners
1. String class and StringBuffer class are both classes that handle strings, but they have one biggest difference,…… -
JSP from simple to deep (6) — JSP declaration
Now the JSP you write will become a class definition. All the scriptlets you write should be placed in a method of thi…… -
Establishment of Tomcat environment
Tomcat is another excellent JSP server developed on the basis of sun's jswdk. It not only supports servlet, but also p…… -
JSP from shallow to deep (9) — JSP sessions
On a classic website, visitors can browse several web pages and perform some interactive behavior. If you are writing …… -
Note: Lecture 7 swing user interface design
[thinking before class] 1. What is swing? What are its advantages over AWT? What are the differences in use? 2. What a…… -
JSP from shallow to deep (11) — tag library
JSP 1.1 proposes a method of extending JSP flag, which is named "flag library". These libraries allow additional flags…… -
Feel the characteristics of Java data object JDO 2.0 query language (1)
The improvement of query language is jdo2 0 specification. This paper expounds jdo2 from a higher level Some new featu…… -
JSP from shallow to deep (8) — JSP Tags
Another important syntax of JSP is tags. JSP tags does not use <%, but only the < character. JSP tag is a bit li…… -
Note: Lecture 4 exception handling and I / O flow in Java
[thinking before class] 1. What are exceptions? What are the two exception handling mechanisms in Java? 2. What are th…… -
Note: Lecture 3 object oriented features in the Java language
[thinking before class] 1. What are objects? What are classes? What are packages? What are interfaces? What are intern…… -
Note: Lecture 6 Java threads and Java applets
[thinking before class] 1. What is a thread? What is the difference between it and a process? What is the applicable d……