Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

URL "protected"  RSS feed

 
Ricardo Gil
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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"
tnks/////
 
Tim Holloway
Bartender
Posts: 18662
71
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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.
 
Ricardo Gil
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!!!
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!