Commit aa2254c67b99cefd58e377499fb8fd1008e6ba7e
1 parent
6d3367ca
上传路单转义html实体字符
Showing
1 changed file
with
5 additions
and
4 deletions
src/main/java/com/bsth/service/impl/TrafficManageServiceImpl.java
| ... | ... | @@ -24,6 +24,7 @@ import com.bsth.webService.trafficManage.geotool.services.Internal; |
| 24 | 24 | import com.bsth.webService.trafficManage.org.tempuri.Results; |
| 25 | 25 | import com.bsth.webService.trafficManage.org.tempuri.WebServiceLocator; |
| 26 | 26 | import com.bsth.webService.trafficManage.org.tempuri.WebServiceSoap; |
| 27 | +import org.apache.commons.lang.StringEscapeUtils; | |
| 27 | 28 | import org.apache.commons.lang.StringUtils; |
| 28 | 29 | import org.apache.commons.lang.time.DateUtils; |
| 29 | 30 | import org.slf4j.Logger; |
| ... | ... | @@ -373,7 +374,7 @@ public class TrafficManageServiceImpl implements TrafficManageService{ |
| 373 | 374 | counter = 0; |
| 374 | 375 | sf.append("</DLDS>"); |
| 375 | 376 | str = sf.toString().replace("'","");// 去掉'号 |
| 376 | - Results results = ssop.setLD(userNameOther, passwordOther, str); | |
| 377 | + Results results = ssop.setLD(userNameOther, passwordOther, StringEscapeUtils.unescapeHtml(str)); | |
| 377 | 378 | if(results.isSuccess()){ |
| 378 | 379 | result = "success"; |
| 379 | 380 | }else{ |
| ... | ... | @@ -387,7 +388,7 @@ public class TrafficManageServiceImpl implements TrafficManageService{ |
| 387 | 388 | if(counter > 0){ |
| 388 | 389 | sf.append("</DLDS>"); |
| 389 | 390 | str = sf.toString().replace("'","");// 去掉'号 |
| 390 | - Results results = ssop.setLD(userNameOther, passwordOther, str); | |
| 391 | + Results results = ssop.setLD(userNameOther, passwordOther, StringEscapeUtils.unescapeHtml(str)); | |
| 391 | 392 | if(results.isSuccess()){ |
| 392 | 393 | result = "success"; |
| 393 | 394 | }else{ |
| ... | ... | @@ -413,7 +414,7 @@ public class TrafficManageServiceImpl implements TrafficManageService{ |
| 413 | 414 | String result = "failure"; |
| 414 | 415 | try { |
| 415 | 416 | String tmp = readXmlFromFile("E:/ld.txt"); |
| 416 | - Results rss = ssop.setLD(userNameOther, passwordOther, tmp); | |
| 417 | + Results rss = ssop.setLD(userNameOther, passwordOther, StringEscapeUtils.unescapeHtml(tmp)); | |
| 417 | 418 | if(rss.isSuccess()){ |
| 418 | 419 | result = "success"; |
| 419 | 420 | } |
| ... | ... | @@ -435,7 +436,7 @@ public class TrafficManageServiceImpl implements TrafficManageService{ |
| 435 | 436 | private String readXmlFromFile(String fileName) throws Exception { |
| 436 | 437 | StringBuffer sf = new StringBuffer(""); |
| 437 | 438 | File file = new File(fileName); |
| 438 | - InputStreamReader reader = new InputStreamReader(new FileInputStream(file),"utf-8"); | |
| 439 | + InputStreamReader reader = new InputStreamReader(new FileInputStream(file),"GBK"); | |
| 439 | 440 | BufferedReader bufferedReader = new BufferedReader(reader); |
| 440 | 441 | String lineTxt = ""; |
| 441 | 442 | while((lineTxt = bufferedReader.readLine()) != null){ | ... | ... |