Forums Register Login

pass paramter between jsp page

+Pie Number of slices to send: Send
how can i pass the parameter to another jsp from jsp based on the clicking linkage.

as i retrieve data from the resultset,so the linakage should be
<% while rs.next()){%>
<%=rs.getString("ID")%>
<%}%>

when the user click on the link, then pass the ID value to second.jsp accordingly.
+Pie Number of slices to send: Send
You've got Java code in a JSP? Doing database access?

You should really read up on modern JSP. Putting java code in a JSP has been a discredited practice for over 8 years now.

In any case, regardless of where the data comes from, the answer is the same: put the value as a request parameter in the query string of the link URL.

The <c:url> JSTL tag can help you properly format and encode the URL.
+Pie Number of slices to send: Send
as the page is already in the frame of another page.
so when the user click on the linkage, the target should be _self.
the URL still be the page file contain this frame.
no change of the url when user click the linkage.

by the way, if i don't get the resultset and then read it on jsp.
what should i do?

one of the advantage using jsp is it can be conbime java and html.
why not.

sorry, i am beginner to use jsp,so i ask more about this programming language.
+Pie Number of slices to send: Send
 

Ll Gii wrote:one of the advantage using jsp is it can be conbime java and html.
why not.


No, that is a distinct disadvantage and leads to a horrible horrible mess.

Modern JSP best practices dicate no Java on JSP pages. If you are just leaning JSP, you should learn how to do it correctly, right off the bat.

You might want to read this article and this article.

Back to your question: what do you mean by "no change of the url when user click the linkage". If you cannot change the URL, you cannot accomplish your goal.
+Pie Number of slices to send: Send
i have a home.jsp containing 3 frame in the page(top ,left, and then right)
the page content.jsp is in the right frame contain the following code:

just change the

if i change to
<%=rs.getString("ID")%>+"'" target="_self">

the url at the browser will not be change ,still is home.jsp after clicking the link.

so how to get that ID value from aaa.jsp pass from content.jsp
The airline is called "Virgin"? Don't you want a plane to go all the way? This tiny ad will go all the way:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1416 times.
Similar Threads
to pass values between jsp
Why isn't redirct working?
jsp:param vs request.getParameter()
Question about Struts hidden tag
Help with navigation in JSF portals in websphere
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 23:29:34.