File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes URL Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "URL "protected"" Watch "URL "protected"" New topic

URL "protected"

Ricardo Gil

Joined: Aug 06, 2001
Posts: 14
my url is http://test.jsp?cod=3
it's ok!
but if anybody change it to test.jsp?sdjhsds, then return a error!
how i can "protect" it, returning my default error: "parameters incorrects"

** SCJP1.4 **
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17417

and provide an error page. That's one way to do it. The key here is that if the parameter wasn't sent, it will always be null.

An IDE is no substitute for an Intelligent Developer.
Ricardo Gil

Joined: Aug 06, 2001
Posts: 14
ok man!!!
it's work,,, and at top of my jsp i put
<%@ page errorPage="index.jsp" %>
and when error occurs it redirect to index page!!!
I agree. Here's the link:
subject: URL "protected"
It's not a secret anymore!