Java Web 10 Development Practical small knowledge _java

Source: Internet
Author: User
Tags java web

1.${CTX} and ${pagecontext.request.contextpath} both are meant to get the current root directory.

The difference is ${ctx} for the short version of ${pagecontext.request.contextpath, after verifying that this is true, found in a document of the project has such a passage

The configuration

Copy Code code as follows:

<c:setvar= "CTX" value= "${pagecontext.request.contextpath}"/>

Note that when using ${CTX, you must not forget to put the

Copy Code code as follows:

<c:setvar= "CTX" value= "${pagecontext.request.contextpath}"/>

File into the current page.

2.oracle clob field conversion to Varchar:to_char (substr (a.mcontent,1,3800))

3.

1. In fact, when processing the Clob field, direct To_char, when the length of more than 4000, will be an error, prompt column is intercepted;

2. The direct use of substr to intercept the CLOB field is not able to play any role;

3. The Clob field can be intercepted using Dbms_lob.substr (clobcolumn,4000), and the length of the Intercept is 4000 or 2000 depending on the character and the data stored in the decision length.

4.tomcat Memory Optimization: Add directly after arguments:

-xms1024m-xmx1024m-xx:permsize=128m-xx:maxnewsize=64m-xx:maxpermsize=256m

SQL statements for querying tree data in 5.oracle

Copy Code code as follows:

Select Dept_id,dept_name,level from test_dept start and dept_id= ' 0 ' connect by prior dept_id=parent_id;

After my verification, the above is to query all the data, that is, the head office. The method of inquiring branch 1 is:

Copy Code code as follows:

Select Dept_id,dept_name,level from test_dept start and dept_id= ' 1 ' connect by prior dept_id=parent_id;

6.MySQL problem resolution for MySQL server has gone away

Copy Code code as follows:

Mysql>show Global variables like ' max_allowed_packet ';
Show:max_allowed_packet 1048576

Workaround:

 Mysql>set Global max_allowed_packet=1024*1024*16; Mysql>show 
Global variables like ' max_allowed_packet ';
Show:max_allowed_packet 16777216

Ok.

7.oracle workaround for a database that cannot be deleted from the current connection

Description problem: Users in Oracle cannot delete, prompting "Unable to delete currently connected users"

Workaround:

1. View User Connection Status: Select username,sid,serial# from V$session

2. Locate the SID and serial of the user to be deleted and delete: Alter system kill session ' 532,4562 '

3. Delete users: Drop user username Cascade

– currently logged in user SELECT user from DUAL; SELECT sys_context (' USERENV ', ' Session_user ') from DUAL;
– The current login SID SELECT sys_context (' USERENV ', ' Sid ') from DUAL;

8.tomcat incoming background, Chinese will appear in the page garbled

Reason Analysis:

The Tomcat default encoding is Iso8859-1

Solution

Configure a uriencoding= "UTF-8" in the connector in Tomcat's Server.xml

Modify the Server.xml of Tomcat and add the urlencoding parameter to the connector tag:

maxsparethreads= "enablelookups=" "false" redirectport= "8443"
Acceptcount= "debug=" connectiontimeout= "20000"
Disableuploadtimeout= "true" uriencoding= "UTF-8"/>

The difference between facets and artifacts in idea of 9.Intellij

Facets indicates what features the module has, such as web,spring and hibernate;

Artifact is a concept in Maven that indicates how a module is packaged, such as the war exploded, war, jar, ear, and so on;

A module with artifacts can be deployed to the application server!

10.Intellij idea there are a lot of type options when configuring artifacts for a project, what does exploed mean

Explode here you can understand the meaning of unfolding, not compressing. The directory structure before the output of war, jar and so on is not compressed. It is recommended that this pattern be used when developing, and that the effect of modifying the file is immediately apparent.

By default, Idea's Modules and artifacts's output directories are already set up, no changes are required, and when the war package is made, the classes directory is automatically produced in the Web-inf directory, and the compiled files are put in.

The above content is small series to introduce the Java Web 10 development of practical small knowledge, hope to help everyone!

Related Article

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.