1

i have opened url "pathofServer/bookingSlot.jsp?slot=Slot2"

var clickedSlotNo=this.getElementsByTagName('p')[0].innerHTML;
        var url="bookingSlot.jsp";
        url +="?slot=" +clickedSlotNo;
        window.open(url,"_self");

the above code is part of javascript fuction present in xyz.jsp file,from this iam opening a new jsp named bookingSlot.jsp ,and i am able to open page but i am not getting how to get the value of slot in new bookingSlot.jsp. Please help me..

user6654733
  • 13
  • 1
  • 7
  • have you tried `<%=request.getParameter("slot")%>` or ``? – mr.tarsa Jul 31 '16 at 08:05
  • If you need the argument in JavaScript: look at [this](http://stackoverflow.com/questions/901115/how-can-i-get-query-string-values-in-javascript) SO question. – Jeroen Heier Jul 31 '16 at 08:07
  • If i have another parameter with same slot ,which is used in another jsp file?Will it be an exception?just having doubt – user6654733 Jul 31 '16 at 08:15

1 Answers1

0

In your bookingSlot.jsp file, add following snippet:

<%
    String slot = request.getParameter("slot");
%>
Sky
  • 7,343
  • 8
  • 31
  • 42