getQueryString in JSP/JSTL

Dear Friends,

Please help how to get the query string of the url ( such as that getQueryString() of the Servlet) in JSP/JSTL.

I would like to get the query String for the below URL

http://localhost:8282/MyJSP/index.jsp?locale=en_US

then I attach at the end of the below <a href ...> link

<a href="/index.jsp">Test</a>

So that the URL for link becomes /index.jsp?country=en_US

Thank you in advance

[466 byte] By [Sharifa] at [2007-11-27 10:02:30]
# 1
The HttpServletRequest object is implicitly referenced as 'request' inside JSP pages. You can just use it.
BalusCa at 2007-7-13 0:36:47 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

You want to take a parameter to the page and pass it as a parameter in a hyperlink?

The parameters are available in EL through the implicit variable "param"

${param.locale} would get the value of the lcoale parameter sent in the url.

Generating a url for it to go to?

// generate the URL string

<c:url var="myURL" value="/index.jsp">

<c:param name="country" value="${param.locale}"/>

</c:url>

// make the link tag

<a href="${myURL}">Test </a>

//or if you don't have a JSP2.0 container (Tomcat 5)

<a href="<c:out value="${myURL}"/>">Test </a>

evnafetsa at 2007-7-13 0:36:47 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...