• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 163
  • Last Modified:

problem with getting request parameters.

Users input in the address bar of IE as follows.

1.http://localhost/index.jsp
2.html://localhost/index.jsp?search
3.html://localhost/index.jsp?search=para1
4.html://localhost/index.jsp?insert=para1

I want to redirect URL each case.

How can I determine?
0
iamjhkang
Asked:
iamjhkang
  • 2
  • 2
1 Solution
 
iamjhkangAuthor Commented:
I want a conditional statement for filtering each of them.
Thanks.
0
 
cheekycjCommented:
<%
   if (request.getParameter("search") != null) {
      response.sendRedirect("URL IF Search parameter exists");
   }
   else if (request.getParameter("insert") != null) {
      response.sendRedirect("URL IF Insert parameter exists");
   }

%>

and so on.

Now if you want to filter the values inside those parameters just nest if-then-else statements inside the ones above.

HTH,
CJ
0
 
cheekycjCommented:
Glad I could help and thanx for the "A"

CJ
0
 
iamjhkangAuthor Commented:
You're very welcome.
You deserve it.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now