JSP small junction 1, 2 points

zhaozj2021-02-17  49

1.

JSP

Page input content display

Tag

Text and wrap processing

Enter two lines of text from the text input box of the input page:

Huuhh

あ あ え お?

When it is confirmed, it is found to be automatically removed afterwards. In addition, the tag text is processed by handling HTML.

No input information is displayed correctly.

solution

In the confirmation page, the information you want to display is to solve the problem as follows:

Suppose the information to be displayed is saved in a string variable comment, doing the following:

??

??? <% string comment = ifkbncomment.getValue ();

??? ?? comment = comment.replaceAll ("<", "<"); // Use "<" in the string to use "<"

??? ?? comment = comment.replaceAll (">", ">"); // Use "<" in the string to use "<"

??? ?? comment = arrent.replaceAll ("/ n", "); // will" / n "in the string" ""

%>

??????????????????????

<% = comment%>

????????????????????

Note that the processing replaced in the string "/ n" "is sure to do it, otherwise it will replace the wrap in the TAG text; this is not a wrap.

2. About JSP page input method conversion prohibition and processing method

The "Take the first コ コ" field in the following code requires the input half-angle digital type data.

????????????????????????????????????????

???????????????????????????????? Take the first コ コ ド:

???????????????? ????????????????? (half angle 8)

?????????? ??????????????????

We add an attribute style to the input item and set it to IME-MODE: DISABLED, which cannot be converted when the input is entered.

?

转载请注明原文地址:https://www.9cbs.com/read-29101.html

New Post(0)