Forums Register Login

Coming from multiple jsp to same servlet may be unsafe

+Pie Number of slices to send: Send
Hi everyone,

currently whenever i'm coming to same servlet from different jsp pages,
i use







so i got a doubt if in servlet i'm using the hidden element's value
for redirecting to different jsp pages like if

String action=request.getParameter("action");
if("student".equals(action))
{
//redirect to viewprivielegestudent.jsp page
}
else if("admin".equals(action))
{
//redirect to viewprivielegeadmin.jsp page
}

then if student in the browser does view source code and changes the hidden element's value to admin then he can go to
admin privielege page.


so please tell me the correct way to code so that i can go from multiple jsp pages to
same servlet without any compromise on authorization.


thanks in advance
+Pie Number of slices to send: Send
It sounds like you have no security in place to ensure that the admin area is accessed only by properly authorized users. Start reading at https://coderanch.com/how-to/java/ServletsFaq#security
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 604 times.
Similar Threads
Passing values between two JSPs
Is it possible to invoke servlet on click of non-submit button?
Cannot set attribute in request in jsp
Tompcat - calling servlet from JSP
issue with form submission from a jsf page
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 03:59:40.