js| Skills | essence
1.JSP page Input content display tag text and line Wrap processing
Enter two lines of text from the input page's text entry box:
Lt;br>huuhh<br>lt;b></b><br>
|
After the confirmation to the next confirmation page, found that line information has been automatically removed, in addition, the tag text is processed in the manner of HTML processing, does not display the input information correctly.
Solution
The question on the confirmation page to be displayed is as follows: Suppose the information to be displayed is saved in a string variable comment, which is treated as follows before it is displayed:
LT;TD bgcolor= "#ffffff" valign= "top" >lt;% String comment = Ifkbncomment.getvalue (); comment = Comment.replaceall (" < "," < ")//" < "in the string is used" < "to substitute comment = Comment.replaceall (" > "," > "), or" < "in the string for comment = Comment.replaceall ("\ n", "<br>");//%>lt;p><%= the "\ n" in the string with "<br>" comment%></p>lt ;/td>
|
Note the process of replacing the "\ n" in the string with "" must be done at the back, otherwise the tag text will be replaced with line breaks;
2. About the JSP page Input method conversion prohibition and the processing method
The "Fetch first コード" field in the following code requires a half-width numeric type data
TR>LT;TD nowrap class= "f10b" ></td><td class= "f10b" >:</td>lt;td nowrap><input type= " Text "size=" maxlength= "8" name= "Torisakicd" style= "ime-mode:disabled" "value=" <%= torisakicd%> "></TD" >lt;/tr>
|
We add the attribute style to the entry and place the value to "ime-mode:disabled" so that the input method cannot be converted when the item data is entered.