20 issues encountered during the 2014 work: 120-140

Source: Internet
Author: User
Tags cdata



121.Tomcat increases JVM startup parameters.
Set java_opts=%java_opts%%logging_manager%
Set java_opts=%java_opts%-dp2p.config_path=file:c:/users/administrator/git/p2p2/yiqihao


Java_opts after the "=", the left and right sides can not appear space.
It seems like I've summed up this problem before, and this time I made the same mistake, comparing it with the Tomcat default configuration above, and quickly remembered the problem.


122. The picture does not respond, always 404, obviously did the mvc:resource mapping.
<mvc:resources location= "file:${setting.upload_root_path}/ueimg/ueditor/jsp/upload/" mapping= "/ueimg/ueditor/ jsp/upload/** "/>
Dispatchservlet only intercept *.html, picture requests will not go springmvc, so mvc:resources can not be static mapping.

How do you intercept URL requests in a directory exactly?
The slice access path is/ueimg/ueditor/jsp/upload/image/*/*.png,
Is this access intercepted?
<servlet-mapping>
<servlet-name>theDispatcher</servlet-name>
<url-pattern>*.png</url-pattern>
</servlet-mapping>

/ueimg/*,/ueimg/**,/ueimg/*.png is no good.

123.Git Push Error "error writing request body to server"
Default git settings http Post cache is 1M
Workaround: Increase the HTTP POST cache, and if you use the GIT command, set the parameters command as follows:
#增加为 500MB git config http.postbuffer 524288000
If you are using the Eclipse git plugin, you will need to find the Team---Git configuration interface in Windows---Preferences, and click "A" in the System Settings tab page. DD Entry ... " button to add a configuration item:


Key is: Http.postbuffer value is: 524288000
Reference: http://blog.sina.com.cn/s/blog_002e20310102v1nn.html


124.mysql-front importing data in Excel2003 (. xls) format, you sometimes encounter errors.
Import multiple tabs in one excel at a time, that is, the structure and data of multiple tables, occasionally encountering errors.
In this case, my attempt was to save Excel as. CVS and import Mysql-front again.
Or, import only 1 tables in Excel.
If 1 tables can be imported successfully, then import all of them, and just overwrite them directly with the successful import.


125.Jeesite Enterprise Information Framework has "init-db.bat" script, used to initialize the database, I only configured the maven_home variable,
Then you can not find ant and other kinds of things, do not bother to do, directly manually import SQL files and Excel data.


126.Boss Import Maven project, always prompt nullpointerexception.
Tried many times, not all.
Finally my advice is to import as an ordinary project and then convert to Maven project.
The reality is that, as an ordinary project, Eclipse automatically identified him as Maven project, just fine.


The 127.Mybatis Resulttype is case-sensitive.
<select id= "Listpage" resulttype= "Java.util.Map" >
"Java.util.map" is no good.


128.Mybatis write fuzzy query like.
Like #{search}), the front-end incoming search is "a" This, Java program plus "%a%".
I do not want to go through Java, but in the MyBatis script, directly write%%,2 methods are not.


Method one: and (Card like <![ cdata['%#{search}% ']]> or name like #{search})

Method Two: <if test= "Search! = null and search! = '" >
and (Card like <![ cdata['%#{search}% ']]> or name like #{search})
</if>
With the "<! [cdata[], MyBatis no longer handles the label inside.


129. Determine if the string is empty.
Org.apache.commons.lang3.StringUtils.isEmpty
Org.apache.commons.lang3.StringUtils.isBlank
These 2 methods are different.
"" IsEmpty is False,isblank to true.


Hyperlinks in 130.JavaScript a click no response.


<script type= "Text/javascript" >
function Click () {
Console.log ("click");
}

</script>
<a target= "_blank" onclick= "click ();" >a</a>


Reason: Click is the keyword of JavaScript, change a name.
Originally is a demo small program, test a thing, the result has risen posture again.


131. The package name does not match.
Move a package to another item, "Com.p2p.cms.controller", the name of the package is called this, rather than com/p2p/cms/controller this hierarchical directory structure.
To the disk directory to see, only to find this problem.
DescriptionResourcePathLocationType
The declared package "Com.p2p.cms.controller" does does match the expected package "Com.p2p.cms.controller"
Postcategorycontroller.java/cms/src/main/java/com.p2p.cms.controllerLine 1Java problem


Well, copying this error to the text shows that the error is still obvious.
But in Eclipse's marks view, what you see is not obvious.


132.JS syntax issues.
<a href= "javascript:;" onclick= "Doremove (${article.id}, ' ${article.title} ');" > Delete </a>
If the parameter passed into the Doremove method is a string, you must add "single quotation marks".

The 133.Freemarker include is still very good.
The page has the same HTML or FTL code, can be taken out separately, and then introduced, only need to maintain a copy of the template.
In this way, the code in the page looks a lot less. Cool ~


134. Jump to the login page, the URL has extra space.
<bean class= "Com.p2p.base.interceptors.BaseLoginInterceptor" >
<property name= "Logincenterurl" >
<value>http://login.yiqihao.com:${p2p.port}/login-center/login.html</value>
</property>
<property name= "Loginbackurl" >
<value>http://user.yiqihao.com:${p2p.port}/user-center/home/index.html</value>
</property>
</bean>


"<value>...</value>" must be in a row, never change line!!!
Http://login.yiqihao.com:8080/login-center/login.html%20?backUrl=http://user.yiqihao.com:8080/user-center/home/index.html

135.UEditor set the path of the picture, I use the Linux on the "~/img/", in fact, is not found.

Because of this path, eventually there is processing in the Java program. With the full format, the absolute address is better:/root/img.


Original starting: http://fansunion.cn/article/detail/533.html




The 136.Mybatis SQL element can be used to define reusable SQL code snippets that can be included in other statements. Like what:
<sql id= "Tenderreturncolumns" >
Id,tid,no,uid,lid,principal,amount,time,status,is_flow,return_type,extra_interest,updatetime
</sql>

<select id= "Listpage" resulttype= "Java.util.Map" >
Select
<include refid= "Tenderreturncolumns"/>
From P2p_tender_return ORDER BY id DESC
</select>

137. A colleague encountered the problem of LF and CRLF.
The LF format is wrapped as a newline and cannot be submitted to git, prompting the need to be replaced with CRLF.
Open with Notepad and save as CRLF.


138. This is not the correct wording.
${item.oktime?exist?number_to_datetime}


139.freemarker how to determine the object type.
#if MyVar.class.simpleName = = "Object Type" >
...
</#if >
This is said online, if the object type, can be obtained through the. Class.simplename.
But if it is the original type, number, it will be an error.
This is only a custom method: http://www.iteye.com/topic/1121429.


Not enough, I think the custom method is now too troublesome, not to go further.


140. The value of the form submission is always null.
<input type= "hidden" name= "Transferid" value= "${transfer.id}"/>
Transfer.id always has a value of 5, and back-end data debug does.
However, the front end is always null when the value is echoed back to the backend.


Finally found that 2 transferid were defined
<form>
<input type= "hidden" name= "Transferid" value= "${transferid}"/>//previous code, still in


<input type= "hidden" name= "Transferid" value= "${transfer.id}"/>//directly adds a
</form>


When the form is submitted, only the previous one is submitted?


To view the browser's headers record:
Transferid:
Transferid:5
TRANSPWD:
PAYPWD:
Captcha


found that the browser submitted 2, should be SPRINGMVC receive time, only processing the 1th.

20 issues encountered during the 2014 work: 120-140

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.