File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes Passing data to JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Passing data to JSP" Watch "Passing data to JSP" New topic

Passing data to JSP

Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
I would like to pass another data parameter to store.jsp
within the following command:-
<a href='store.jsp?prodid=<%="data1" %>'>
something like this:-
<a href='store.jsp?prodid=<%="data1" %> manid=<%="data2" %>'>
Can anybody help.
Paul Wetzel
Ranch Hand

Joined: Nov 02, 1999
Posts: 107
is it as easy as putting an '&' between the lass parameter value and the next parameter name? like this:

I removed the double quotes aroung the vars and put double quotes around the href value.
I hop ethat was what you were looking for
Martin Lawrence

Joined: Oct 20, 2000
Posts: 14
Hi Paul,
Thanks for your prev help. I still have a problem with the
following code:-
<b><input type="text" SIZE="20" name=data2 ></b>
<% String data1="first"; %>
<br><a href="store.jsp?prodid=<%=data1%>&manid=data2">link here</a>
The output displays the content of data1 ok, but displays
data2 as "data2", instead of it's content.
Raj Kumar Gopal

Joined: Oct 20, 2000
Posts: 6
It should be :
<br><a href="store.jsp?prodid=<%=data1%>&manid=<%=data2%>">link here</a>
I agree. Here's the link:
subject: Passing data to JSP
It's not a secret anymore!