2

I want to add two variables to URL in JSP

<a href="buyOrSell.do?symbol=<%=trade.getSymbol()%>&mktPrice="<%=trade.getCurrentMktPrice()%>>Buy</a>

ex - http://loclhost:8080/myProj/buyOrSell.do?symbol=anySymbol&mktPrice=price

but I am not able to get second variable.

1 Answer 1

3

Seems like you had a quote mark placed wrong in your code. Test the line below instead

<a href="buyOrSell.do?symbol=<%=trade.getSymbol()%>&mktPrice=<%=trade.getCurrentMktPrice()%>">Buy</a>
Sign up to request clarification or add additional context in comments.

2 Comments

Glad to help, if you found the answer useful, feel free to mark it as "answer" :)
can accept any answer after 10 minutes, so i was waiting to mark it, thnx for ur fast response :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.