getParameter() from METHOD=Post vs HREF

Hi

I've got a jsp that checks for parameters from a calling HTML.

When the calling HTML uses the <FORM> tag with METHOD="POST"

and <INPUT type="text" name="email" value="">

<form action="logon.jsp" method="post">

<table>

<tr><td>E-mail<td><INPUT type="text" name="email" value="">

<tr><td>Password<td><INPUT TYPE=PASSWORD name="mypassword">

<tr><td><input type="submit" value="Logon" class="submitButton">

<td><a href="NewAccount.jsp">New Account</a>

</table>

</form>

In the code when the submit button is used, all works fine. I can get access to the "email" parameter.

But when the link is use "New Account", the paramter "email" always returns null.

So when a jsp page is called, is there a way to access the objects on the page that send the request ?

Thanks

[1230 byte] By [CarelDuToita] at [2007-11-27 8:43:40]
# 1
<a href="logon.jsp?fieldname=<% =value%>"></a>Try this
a1ba at 2007-7-12 20:44:10 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

Hi,

aib: You are right...

Toit:

<form action="logon.jsp" method="post">

<table>

<tr><td>E-mail<td><INPUT type="text" name="email" value="">

<tr><td>Password<td><INPUT TYPE=PASSWORD name="mypassword">

<tr><td><input type="submit" value="Logon" class="submitButton">

<td><a href="NewAccount.jsp">New Account</a>

</table>

</form>

Replace

<a href="NewAccount.jsp">New Account</a>

to

<a href="NewAccount.jsp?a1=<%=email%>&a2=<%=mypassword%>">New Account</a>

use a1 and a2 strings --> submitted page.

ss1_ss1a at 2007-7-12 20:44:10 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
OK Thanks for the helpTried that .. now I'm getting the errorcannot resolve symbolsymbol : variable email location: class org.apache.jsp.checkLogon_jspout.print(email);^
CarelDuToita at 2007-7-12 20:44:10 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4
retrieve the value as <%String email= request.getParameter("a1");if(email!=null){%>out.print(email);<%}%>Regards,Satish R
ss1_ss1a at 2007-7-12 20:44:10 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5
Hi,I guess, a little late on this, but you can always use....request parameters directly.<%if(request.getParameter("a1") != null){out.print(request.getParameter("a1"));}%>Ta.Message was edited by: jini4java
jini4javaa at 2007-7-12 20:44:10 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...