1. 使用Spring MVC处理表单的提交。
2. 表单的提交方式为Post方式。
3. 在textArea中输入的提交的内容为:
NodeServer[@hostName in("sj-wv00-3854129.sjc.ebay.com","sj-wv00-6257537.sjc.ebay.com","ph-wv00-ed62fb7.phx.ebay.com","ph-wv00-fdc3389.phx.ebay.com","sj-wv00-3534570.sjc.ebay.com","sj-wv00-4af5961.sjc.ebay.com","ph-wv-839a237.phx.ebay.com","px-wv00-963e8e2.phx.ebay.com","px-wv00-86066a2.phx.ebay.com","px-wv00-42a0822.phx.ebay.com")]
4.提交到Spring MVC Controller中内容 为(类的相关属性)为:
ÂNodeServer[@hostName in("sj-wv00-3854129.sjc.ebay.com","sj-wv00-6257537.sjc.ebay.com","ph-wv00-ed62fb7.phx.ebay.com","ph-wv00-fdc3389.phx.ebay.com","sj-wv00-3534570.sjc.ebay.com","sj-wv00-4af5961.sjc.ebay.com","ph-wv-839a237.phx.ebay.com","px-wv00-963e8e2.phx.ebay.com","px-wv00-86066a2.phx.ebay.com","px-wv00-42a0822.phx.ebay.com")]
5. 表单内容为:
<form id="createRuleForm" name="createRuleForm" action="validator/createRule" method="post">
<input type="hidden" id="cmsClass" name="cmsClass"></input>
<input type="hidden" id="odbClass" name="odbClass"></input>
<!-- <input type="hidden" id="attributes" name="attributes"></input> -->
<!-- attributesDiv used to append the inputs of the attributes, and submitted to Server Side-->
<div id="attributesDiv" title="Please select attrs."></div>
<div class="container-fluid">
<label class="pull-left"><strong>Rule Name</strong></label> <input name="name" id="name" class="pull-right span3" type="text"
placeholder="Rule Name..." title="Please fill in the rule name."></input>
</div>
<div class="container-fluid">
<label class="pull-left"><strong>Creator</strong></label> <input name="creator" id="creator" class="pull-right span3" type="text"
placeholder="Creator..." title="Please fill in the creator name."></input>
</div>
<div class="container-fluid">
<label class="pull-left"><strong>ODB Collection</strong></label>
<input name="odbCollection" id="odbCollection" class="pull-right span3" type="text" placeholder="Enter the collection NAME..." title="Please fill in the ODB collection name."></input>
</div>
<div class="container-fluid">
<label class="pull-left"><strong>CMS Query</strong></label>
<textarea name="cmsQuery" id="cmsQuery" class="pull-right span3" placeholder="The format should be like..." title="Please fill in the CMS query."></textarea>
</div>
<input class="pull-left btn-warning" type="reset" value="reset" οnclick="classOnchange();"></input>
<input class="pull-right btn-primary" type="submit" value="submit" οnclick="return handleForm();"></input>
</form>
可能的原因
1)没有在表单上统一设置编码
解决办法:
只需要在该页面上指定编码为UTF-8:
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
2. 在往textArea中写内容的时候,在开始输入了空格,会被转译成Â