I have three JSP pages:
dbview.jsp -- grid style for browse record
query.jsp -- define query condition and return
edit.jsp -- freefrom style for add/update
User usually operate as following:
1.Enter function module
2.Execute query and select record
3.Execute Update/Add/Del operation
I hope to share query condition between there pages,for example,when user execute a query and return dbview UI, then click Keyword href link and enter edit UI, when return from edit UI, I hope the dbview only display the records using current query condition.But how to store query condition, I still do not find the way. Now I use
dbview?queryCond = "<%=strQueryCond%>"
to pass query condition between pages.
But It is bad because a long parameter will appear at browser address and it is not safe.
Hope to get your comments!
You have some options
1. You could user hidden form variables.
2. You could use Query String.
In the Second.jsp you could retrieve the values using request.getParameter("user"). This would give you the user value and request.getParameter("pass") would give you password field.
As for your query coming in the Browser header in the form use method="post". This prevents the query to be printed in the Browser header.
I found the reason is href.I test using the code:
<form name = "t" action="t.jsp" method="post">
<input type = "Text" name="t1">
<input type="Submit" value="Submit">
if you click "Test" link, it will display null, but if you click submit button, it will display you the value of t1 field.
If you want to pass parameters to t.jsp using href. You only use href="t.jsp?".
so question still exists!
It works for me. Try it out.
You might want to take a look at this thread for some ideas