如何在JSP中使textarea中的java关键字着色

时间:2015-03-31 15:47:32

标签: html jsp

伙计我在JSP页面中的Textarea内部着色Java相关关键字时遇到问题。怎么做?

<html>
<head>
    <title>OnlineJEditor</title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <style>
        h1{
            background-color: black;
            color: white;
            font-family: monospace;
            font-style: normal;
            padding: 5px;
          }
          p{
              font-size:large;
          }

          input{
              background-color: #d0d4f5;
              padding: 5px;

          }
          textarea{
              font-size: large;
              color: black;
              font-family: monospace;
              font-stretch: expanded;
              border: solid;
              border-color: dimgray ;

          }
          body{
              background-color: #9aa0dc;
              padding: 5px;
          }
    </style>
</head>
<body>
   <%! String s;%>
    <h1>Welcome! To Online Web Editor for beginners in Java</h1>
    <form action="NewAction.jsp" method="GET">
        <p>Please write in your main class name </p>
        <input type="text" name="filename" value="Example" required>
        <p><i>Please write your code here :</i></p>
        <textarea name="jcode" rows="15" cols="70" spellcheck="false" draggable="false" autofocus>

   import java.io.*;
   import java.util.*;

   class Example
   {
   public static void main(String[]args)
    {
    }
    }

        </textarea>
        <br>
        <br>
        stdin:
        <br>
        <textarea name="arg" rows="1" cols="40">No Arguments</textarea>
        <br>
        <br>
        <input type="submit" name="Submit" value="Submit">

    </form>

</body>

当用户点击输入或到达Textarea中名称为&#34; jcode&#34;的

时,我想在textarea中添加行号。

0 个答案:

没有答案