"The set strikes me as something like the set of potatoes, radishes, farming, and lunch. " - a colleague's way of comparing both overlapping and disparate groups. made me laugh and thought of the ranch
i mean the parameters......which we pass from the url.....
<a href="/airways1/bank.jsp?flightid=<%=f1%>"> <%=x %></a>
now i would like the value of flightid to be retrieved again on this jsp...n i have used request.getparameter().it should work according to me.but its not getting any value when i click the hyperlink.....when i display it on the console window it is showing a null value.that means it is not passing the value.or have i made a mistake.please help and suggest.
kavita mehra wrote: will this statement give a value if called on the same jsp....or will we have to retreive it from another jsp...
what you mean by same jsp? Where ever the request is being sent to (JSP/Servlet etc..) would be able to use that. If you post your code it'll be easier to answer the questions on that.
This message was edited 1 time. Last update was at by Vijitha Kumara
yes sir it is showing a null pointer exception.......how do i retrieve the value....sent by the hyperlink on the same jsp.i.e the jsp in which im using the hyperlink is the one which is being called.
kavita mehra wrote:yes sir it is showing a null pointer exception.......how do i retrieve the value....sent by the hyperlink on the same jsp.i.e the jsp in which im using the hyperlink is the one which is being called.
Can you just elaborate this a bit perhaps using your code (that would be really easy to answer) - How you call the jsp etc.. ?
This message was edited 1 time. Last update was at by Vijitha Kumara
kavita mehra wrote:yes sir it is showing a null pointer exception.......how do i retrieve the value....sent by the hyperlink on the same jsp.i.e the jsp in which im using the hyperlink is the one which is being called.
check if request.getParameter("flightid") is null ? if yes, you cant do much..just to wait for someone to click the link for your second request with data for flight id..
But Still this question remains same , why do you want to do that in same jsp? and exactly what you want to achieve ? if you elaborate , perhaps there are many other ways than this
Are these above 2 statements available in same JSP ? why do you want to send "n" as request parameter and get the same in the next line and use it. this is total of mess of design and not a way to use JSP.
you miss basics here
1) When this jsp is executed , line1 is translated and value of n (if there is one) is rendered as html
2) "request" is the ServletRequest object containing request information that is sent when you call this jsp. (line2)
3) you should note that <%=n %> is executed in the server itself before sent to the browser. so when it reaches the client browser , it looks like this
4) so now you should understand that line 1 and 2 are executed in server end . Right click and see view source and check what is the value and see it yourself.
This message was edited 1 time. Last update was at by Balu Sadhasivam
What a mess. This is exactly the reason that putting scriptlets in a JSP went out in 2002. Perhaps this article can help you understand how web apps can be structured more cleanly and possibly help you in the future.
ok.. so you are saying that the hyperlink is executed in the server before it reaches the client browser.. i got that.. thanks..
but is it possible if i place the request.getParameter() in a condition such that it is called only after a hyperlink is pressed.. Then can i retreive the value passed by hyperlink through request.getparameter()...?? please explain
kavita mehra wrote:
but is it possible if i place the request.getParameter() in a condition such that it is called only after a hyperlink is pressed.. Then can i retreive the value passed by hyperlink through request.getparameter()...?? please explain
NO !! and even if there are shortcuts.. that would be jsp "crap" which is useless .
This message was edited 1 time. Last update was at by Balu Sadhasivam