从javascript中获取值并在jsp和mysql查询中使用?

时间:2019-03-01 07:46:41

标签: javascript jsp

我想在jsp中使用localStorage值,因为我要从数据库中获取数据并绘制图形。我该怎么办?

 //This will get Value  from localStorage:---

 <script type="text/javascript">

 var tableName = localStorage.getItem("table");

 </script>

 //Jsp Code;


 String tableName1=request.getParameter("tableName");
 out.println("Value:--"+tableName1); 


// and using this in sql Query


 String Query = "select data from " +  tableName1  + " where datetime is not 
   null;";


//  in this code that tableName1  is not acceccing value

0 个答案:

没有答案