Java Web Utility Tip 01

Source: Internet
Author: User

  1. ${ctx}With ${pageContext.request.contextPath} these two as a means, both get the current root directory.
    The difference is ${ctx} for ${pageContext.request.contextPath} the abbreviated version, after verification is true,
    Found in a file in the project there is a configuration <c:setvar="ctx"value="${pageContext.request.contextPath}"/> of such a phrase
    Note When using ${ctx, be sure not to forget to put the configuration
    <c:setvar="ctx"value="${pageContext.request.contextPath}"/>
    The file is introduced to the current page.

  2. Oracle Clob Field converted to Varchar:to_char (substr (a.mcontent,1,3800))

  3. 1.实际上处理CLOB字段的时候,直接TO_CHAR,当长度超过4000的时候,会报错,提示列被截取;
    2.直接使用SUBSTR对CLOB字段进行截取,是不能起到任何作用的;
    3.可以使用dbms_lob.substr(clobcolumn,4000),对CLOB字段进行截取;截取的长度是4000还是2000根据存储的是汉字和数据决定长度。

  4. Tomcat Memory optimization: Add directly after arguments:

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

  5. SQL statements for querying tree data in Oracle
    select dept_id,dept_name,level from test_dept start with 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 for querying branch 1 is:
    select dept_id,dept_name,level from test_dept start with dept_id=‘1‘ connect by prior dept_id=parent_id;

  6. MySQL about MySQL server has gone away problem solving method

    Mysql>show Global variables like ' max_allowed_packet ';

    Show:max_allowed_packet 1048576

    Solution: 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 Resolution for a database that cannot delete the current connection

    Description problem: The user cannot be deleted from Oracle, prompting "Unable to delete the currently connected user"

    Workaround:
    1. View the user's connection status: select username,sid,serial# from V$session

    2. Locate the SID and serial of the user you want to delete 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;
    – Current login SID SELECT sys_context (' USERENV ', ' SID ') from DUAL;

  8. When Tomcat is in the background, Chinese will appear garbled on the page

    Cause Analysis:

    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="75" enableLookups="false" redirectPort="8443" acceptCount="100" debug="99" connectionTimeout="20000" disableUploadTimeout="true" URIEncoding="UTF-8"/>
  9. The difference between facets and artifacts in Intellij idea

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

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

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

  10. Intellij idea has 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. That is, the war, jar and other outputs of the directory structure before compression. It is recommended to use this mode at the time of development, so that the effect of modifying the file immediately appears.

    By default , the output directory of Idea's Modules and artifacts has been set up, no changes needed, and a war package will automatically produce the classes directory in the web-inf directory , and then put the compiled files in.

Java Web Utility Tip 01

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.