A summary of application techniques of JSP

Source: Internet
Author: User
js| Tips 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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.