I think the "why you want to do this" is an important topic which you need to evaluate.
However, keep in mind that whether your action to your servlet is a POST or GET doesn't really matter to the servlet - in both cases, you get access to the request parameters in the same way.
Why do you think your page can use GET but not POST?
anvi kon
Ranch Hand
Joined: Jan 08, 2010
Posts: 133
posted
0
Hi ,
This is my problem,
I have a browser which they can select day , mon and year submit the button,
Well the user doesn't want to browse and select the options thorough a browser.
They just want the url.
so I'm giving only the url by passing paramters to the query.
Yes, that's the correct way to format a GET request URL. Why are you looking for another way? That one works perfectly well.
anvi kon
Ranch Hand
Joined: Jan 08, 2010
Posts: 133
posted
0
But the user doesn't want to see the parameters on the url. Can I hide it some for the user?
Mark E Hansen
Ranch Hand
Joined: Apr 01, 2009
Posts: 639
posted
0
What is the result of the user clicking on that link? Does it show the page with the date selection controls showing the desired values by default?
If so, then why not just have the page controller (servlet) that prepares that page assign the default values when the page is rendered?
For example, rather than having the link take the user to employee.jsp, have the link take the user to a servlet. Have the servlet determine what the default values should be (in the same way you determined them when you originally constructed the original link), then have the servlet set session attributes (or whatever you want) and forward to the employee.jsp page. The JSP page can now use those session attributes to assign the values to the date controls.
No, you can't. But why does the user care? I know I don't care when my google searches have URL parameters on them and I wouldn't dream of asking Google to hide them.
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35237
7
posted
0
They just want the url.
But the user doesn't want to see the parameters on the url.
So they want the URL with parameters without parameters? Do they understand basic web technology? Sometimes one needs to educate clients on what is and is not possible.
I'm just guessing. I'll bet the site owner doesn't want users to be able to "forcefully browse" the site and change the date parameters in the URL.
If there are things they aren't supposed to see on other pages, then you need some access control scheme. This is not achieved by hiding parameters.
If the site owner wants to to enforce some kind of sequential order to the way people are browsing, then have some session variables to show that the user is allowed to progress to such and such a date.
and on the servlet side, you translate those codes into the month,day, and year?
Mahesh Kedari
Ranch Hand
Joined: Nov 28, 2009
Posts: 109
posted
0
Like Tim is suggesting, You can use URL encryption technique for hiding parameters.
But below sentence is confusing me
They just want the url.
so I'm giving only the url by passing paramters to the query.
Does that mean you want to publish this URL to client? If so then in that case encryption or parameter hiding does not make sense.
But if URL is getting fired on some event then encryption can be used. This is what most of the internet banking sites use.
Regards,
Mahesh Kedari - Fidus Technologies Ltd.
anvi kon
Ranch Hand
Joined: Jan 08, 2010
Posts: 133
posted
0
Can you please give me some examples? How would I enncrypt the url on jsp page?