2012-04-24 35 views
0
<%@ taglib uri="/tags/struts-bean" prefix="bean"%> 

form.parentProcessNumberPresentation.value= "<"+ "<bean:write name="associatedProcessField" property="fieldInstruction"/>" + ">"; 

當我打印與它帶有"\ n""bean: write"文本,然後打破了將在形式分配給組件串Java的「豆:寫」 +的JavaScript =「未終止的字符串字面

。 ?

這怎麼可能過濾"\ n"跳過它 我已經試過:

form.parentProcessNumberPresentation.value= "<"+ "<bean:write name="associatedProcessField" property="fieldInstruction" filter="false"/>" + ">"; 
+0

對不起struts版本的困惑 – 2012-04-24 19:04:44

回答

0

問題是"<bean:write name="associatedProcessField" property="fieldInstruction" filter="false"/>"回一個,但它是與"\n"這樣的字符串會歸因於JavaScript變量不是有效的。