关闭

mistake

标签: functionjspjavascriptjavainputclass
361人阅读 评论(0) 收藏 举报
分类:

I make a mistake:(9/13/2007 3:48:00 PM )

on jsp page: IN a javascript function, I invoke a java function in this page.   Then I get an error: Unable to compile class for JSPNote: sun.tools.javac.Main has been deprecated.
    when my colleague told to me that: java code has been execute when jsp page loading, where U want to execute java code after jsp page loading, that's wrong!

I study a function in javascript, that's eval(), like this:

function copyme(i){
     if(i==10) return;
     var myname = eval('formdata.score'+i);
     var toname = eval('document.all.score_left'+(i+1));
     var mytr = eval('document.all.rowscore'+(i+1));
     if(myname.value!=null && myname.value!=''){
      mytr.style.display='';
      mytr.disabled=false;
      toname.innerHTML=myname.value;
     }
   }

2: today I make another mistake:(2007-09-18)

xxx.java--1--> xxx.jsp              xxx.jsp---2--->xxx.java

过程1中可以传递request, if there are request.setAttribute(key, value) in xxx.java, when it forward xxx.jsp, we can get the just value

过程2中不可传递request 到xxx.java,前台到后台只能传递表单数据,要不就放到 hidden input 里。

0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:38296次
    • 积分:686
    • 等级:
    • 排名:千里之外
    • 原创:22篇
    • 转载:10篇
    • 译文:0篇
    • 评论:6条
    文章分类
    最新评论