...
>For example the two dimensional array "test" has this data:
>
[quoted text clipped - 5 lines]
>
>These values (a,d) are displayed as hyper links to a page testpage.jsp.
...
'Row1, Col1'
<a href='thetarget.jsp?Col2=b&Col3=c'>a</a>
....
'Row2, Col1'
<a href='thetarget.jsp?Col2=e&Col3=f'>d</a>
>What I need to do is, when user clicks a , I need to set b and c in a
>variable array
'Variable array'? Why not simply include it as the
parameters of a (plain old) hyperlink?
...
>2. Do I need Javascript ? or it can be done in Java? I prefer to have all
>the code in Java.
Do it in HTML. Use whatever (server) side language you
like to generate the HTML, but leave JS out of it - it is an
unnecessary complication.
>3. How is it possible to access and change a request variable from
>JavaScript ?
Between pages? See above.
'In-place' in a single page - that would
require JavaScript.

Signature
Andrew Thompson
http://www.athompson.info/andrew/
Evrim - 18 Aug 2007 08:56 GMT
> 'Row1, Col1'
> <a href='thetarget.jsp?Col2=b&Col3=c'>a</a>
> ...
> 'Row2, Col1'
> <a href='thetarget.jsp?Col2=e&Col3=f'>d</a>
First of all thank you very much for your reply ....
In this case , I should have a java code that builds query string based on a
loop that goes through the 2-D array , correct ?
Any tips or reading material is extremely apprecited...
Evrim
Lew - 18 Aug 2007 14:40 GMT
>> 'Row1, Col1'
>> <a href='thetarget.jsp?Col2=b&Col3=c'>a</a>
[quoted text clipped - 7 lines]
> loop that goes through the 2-D array , correct ?
> Any tips or reading material is extremely apprecited...
JSTL (JSP Standard Tag Library) and JSF (Java Server Faces) to the rescue,
specifically, EL (expression language).
<c:forEach items="${outer}" var="${thing}" >
<a href="thetarget.jsp?Col2=${thing.b};Col3=${thing.c}">
<c:out value="${thing.a}" />
</a>
<br />
</c:forEach>
or some variation thereof. Nowadays, thanks to JSF, we'd prefer the enhanced
EL, that usually uses an octothorpe instead of a dollar sign to indicate an
expression:
<h:outputText value="#{thing.a}" />

Signature
Lew
Evrim - 18 Aug 2007 17:36 GMT
Thank you for your reply ... I will try implementing it the way you
suggested.