String encodeURL(String url)
Encodes the specified URL by including the session ID in it, or, if encoding is not needed, returns the URL unchanged.
不少开源项目里看到这个东东,学了jsp有半年多了吧,一直没太了解这个用法,因为工作上就没用过servlet。。。。今天又看了一遍尚学堂的视频。知道了作用。
在客户端禁用了cookie后,如果不用这个方法来ecnode一下URL,那么session就无法使用。
加了此方法后会在地址后面添加一个jsession=*******的信息,即使客户端没有开cookie,依然能通过此信息来找到session,完成业务。
Encodes the specified URL by including the session ID in it, or, if encoding is not needed, returns the URL unchanged.
不少开源项目里看到这个东东,学了jsp有半年多了吧,一直没太了解这个用法,因为工作上就没用过servlet。。。。今天又看了一遍尚学堂的视频。知道了作用。
在客户端禁用了cookie后,如果不用这个方法来ecnode一下URL,那么session就无法使用。
加了此方法后会在地址后面添加一个jsession=*******的信息,即使客户端没有开cookie,依然能通过此信息来找到session,完成业务。