当前位置: 代码迷 >> Java Web开发 >> jsp传递的url页面差数 能不能为类,该如何处理
  详细解决方案

jsp传递的url页面差数 能不能为类,该如何处理

热度:60   发布时间:2016-04-17 14:39:30.0
jsp传递的url页面差数 能不能为类
window.location= 'b.jsp?par=test '
par   这个参数只能为字符串?   是否可以象

session那样   存储一个类


如果要传递一个类   除了用session还有什么方法

------解决方案--------------------
如果两个页面都位于服务器端除了session还可以使用request传递对象。
如果想从客户端页面传递对象到服务器端页面是不可能的。


http://bbs.chinaunix.net/archiver/?tid-201062.html


Your javascript is on client side and the jsp are generated by the server. To pass values from client to server, the only way is to put them in a form as rollingpig suggested. You CAN NOT pass object from client to server, I guess, that is what you want to do about the "Array ". However, there is a way to pass object from jsp to jsp on the same app server, that is using request 's session object. So if your javascript 's array data was originally created from server, you can do it by using session object. If your javascript 's array data depend on client 's input, then simply you don 't have other choices.
------解决方案--------------------
不可以
  相关解决方案