This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes Servlets and the fly likes url parameters Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "url parameters" Watch "url parameters" New topic

url parameters

khurrum abdullah

Joined: Oct 31, 2000
Posts: 6
i am using parameter in my url through links for example /mypage.jsp?id=12&name=abc.
now users can see these parameters in url and they can change the values (eg. /mypage.jsp?id=34&name=def). this can cause pages to behave differently. i want to detect if user has changed id and name by himself. what would be best approach in sovling this problem.
Desai Sandeep
Ranch Hand

Joined: Apr 02, 2001
Posts: 1157
Hi khurrum,
I would suggest, you validate the id and the name on every JSP page for which you would want the user to access.
When client requests a page, he would be assigned and id and a name by your web server.You may consider storing this in some temparary variables, probably in the Session implicit object to validate it with the id and name, in case the user makes anu changes.
Hope this helps.

Sandeep Desai

  1. Sun Certified Java Programmer Scored 93 per cent
  2. Oracle JDeveloper Rel. 3.0 - Develop Database Applications with Java Scored 56 out of 59
  3. IBM Enterprise Connectivity with J2EE Scored 72 per cent
  4. Enterprise Development on the Oracle Internet Platform Scored 44 out of 56
It is sorta covered in the JavaRanch Style Guide.
subject: url parameters
jQuery in Action, 3rd edition