我的想法是 用户输入一段文本在textfield 中,判断输入是否有空格,有就从空格处将输入分段,没有则不变,现在报错 应该是s没有实例化....应该怎么写,
<script type="text/javascript">
   String s[];
   request.setCharacterEncoding("gb2312");//改变传递时的编码 来处理汉字乱码
   String name=request.getParameter("textfield");
   if(name.IndexOf(" ")>0)
   {
        s = name.split(" ");
    }
if(name.IndexOf(" ")<0){
 s=s;

   
</script>-谁给看看 哪里出了 出错
An error occurred at line: 26 in the jsp file: / check.jsp
Generated servlet error:
s cannot be resolved