(Requestpath)) {return true; } } return false; } }4. Effect viewWhen the project is started, the first access calls the Freeurlservice.findall () query database and puts the query results into the cache. The second and subsequent accesses will fetch the results that have been deposited directly from the cache.No more access to the database. You can print SQL to see that the database is queried in addition to the first access, and the subsequent queries are f
Android app needs to send a request to a specified page, but the page is not a simple page and can only be accessed if the user is logged in and the user name of the logged-in user is valid. If you use HttpURLConnection to access this protected page, the details that need to be processed are too complex. In fact, access to the Web application protected pages, the use of the browser is very simple, the user through the system provided by the login page login system, the browser will be respo
fetch the data directly from the cache3, take two times the results of the comparison of the address:Found two not the same object, yes, yes. If you use Ehcache, the memory address of both will be the same. That's because the caching mechanism used by Redis and Ehcache is not the same. Ehcache is based on the local computer's memory usage cache, so the cache is used to fetch data directly on the local computer. The conversion to Java object will be the same memory address, and redis it is on th
Java basic consolidation series (4): array reflection applications
For arrays, We can print all objects in the array through reflection:
Package com. test; import java. lang. reflect. array; import java. lang. reflect. field; public class ReflectTest {public static void main (String [] args) throws Exception {int [] a = new int [] {1, 2, 3, 4}; printObject ();} private static void printObject (Object obj) {Class clazz = obj. getClass (); if (clazz
method, the general application, the top-level interface, and then the abstract class implementation interface, finally to the concrete class implementation. Abstract classes can have non-abstract methods. There is no implementation method in the interface.(6) The variable defined in the interface is the public static final type by default, and must be given its initial value, so the implementation class cannot be redefined or changed. Variables in abstract classes are friendly by default, thei
to another transactionnon-repeatable read : In the same transaction, multiple reads of the same data are returned with different results, in other words,Subsequent reads can be read to the updated data submitted by another transaction. Conversely, "repeatable reads" are repeated in the same transactionWhen reading data, it is guaranteed to read the same data, that is, subsequent reads cannot be read to another transaction committed update dataPhantom reads : One transaction reads the insert dat
the functionby executing I (), a call to a function can be implemented, with the following code:Example 7: Because of the above case, in the assignment process, the function name does not make any sense, so you can removeWe call a function without a name as an anonymous function.Note: Even if the anonymous function is defined, the system will automatically return the first address of its function7. Self-invocation of anonymous functionsSelf-invoking anonymous functions:In the future project dev
type: note: integers by default are of type int, and floating-point numbers are double by default. long integers to be added L or L. Single-precision floating-point numbers are added F or f.
number According to type
byte
1 short
2
int
4
long"
8
FL" oat
4
double
8 char
2
boolean
1
Data type Conversions(1)
First step: Modify The effect of the popup window of the JSP pageStep two: in The PNG method is provided in Action , providing the ID attribute and the set methodStep Three: Configure Struts.xml5.4 Delete a process definition First step: provide the Delete button in the JSP page, specify the onclick eventStep two: in The Delete method is provided in the ActionStep Three: Determine whether the deletion was successful in the JSP page According to the deltag flag bitBOS Project 10th Day (Activiti
:alert ("vertical screen:" + Window.orientation); break;}} Style//Portrait style used when @media all and (orientation:portrait) {. css{}}//the style used in the horizontal screen @media all and (Orientation:landscape) {. css{}}
Audio elements and video elements do not play automatically in iOS and Andriod$ (' HTML '). One (' Touchstart ', function () {Audio.play ()})
iOS uses-webkit-text-size-adjust to disable font resizingBody{-webkit-text-size-adjust:100%!important;}
Cancel input under
() removes the element that matches the specified expression from the collection of matching elements $ (""). Slice ( Start,end) pick a matching subset2) Find$ (""). Children () the element collection ("") for all child elements. Find () searches all elements that match the specified expression. $ (""). Next () gets after a sibling element of $ (""). Nextall () gets all the sibling elements after. $ (""). Nextuntil () finds all sibling elements after the current element unt
The simple test is as follows:1: Accept the download apache-activemq-5.14.4 decompression Apache-activemq-5.14.4\bin\win64, run Activemq.batStart the local MQ server.The browser allows you to view information about the local MQ server.http://127.0.0.1:8161/admin/index.jsp2: Put data into MQ firstThe configuration is as follows:After that, the APACHE-ACTIVEMQ server will have a Queue called enrollMq444 (configured in the configuration file) , and the data is consistent with the number of bars in
Integration IdeasPrepare Environment: Import jar Package (Spring MyBatis dbcp connection pool MySQL driver package log4j)Engineering Structure:---------------------------1. Integrate DAOMyBatis and Spring are integrated
applicationcontext-dao.xml Configuration:1. Data sources2.SqlSessionFactory3.mapper Scanning DeviceCreate PO and mapper (reverse engineer, no demo here)For the comprehensive query Mapper, the general situation will have associated queries, the proposed custom mapperItems
# installation ntpyum-y install ntp# sync time ntpdate pool.ntp.org# Confirm Time is correct dateNow the master node is configured to replicate to two slave nodes when configured.wget HTTP://MIRROR.BIT.EDU.CN/APACHE/ZOOKEEPER/CURRENT/ZOOKEEPER-3.4.10.TAR.GZTAR-ZXVF zookeeper-3.4.10.tar.gz # Enter the Conf directory cp-p zoo_sample.cfg zoo.cfg# edit cfg file vi zoo.cfg# content modified to the following # The number of milliseconds of each tickticktime=2000# the Number of ticks that the initial#
);//(2) begin = System.nanotime (); StringBuffer s2 = new StringBuffer ("Hello"); S2.append ("World"); end = System.nanotime (); System.out.println (End-begin);}Second, Currenttimemillis ()Returns the current time in milliseconds. Note that when the time unit of the return value is milliseconds, the granularity of the value depends on the underlying operating system, and the granularity may be greater. For example, many operating systems measure time in dozens of milliseconds.Return:
the
need access to multiple resources. A: The way to avoid deadlocks in multiple threads is to specify the order in which locks are acquired, so that all threads acquire and release locks in the same order, thus avoiding deadlocks.4. There are several ways of stitching between strings (str1 and str2) , and what is the difference? answer : There are two ways,str1+str2 directly using + for splicing, or using StringBuilder the way" StringBuilder sb= new StringBuilder ();Sb.append (STR1);Sb.append (STR
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.