• Post Reply Bookmark Topic Watch Topic
  • New Topic

which get. ? to use to direct within own site

 
mary morris
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I use the following to direct based on a remote address:
<%
String agent1 = request.getRemoteAddr();
if (agent1.startsWith ("142") || aget1.startsWith ("205")) { %>
<link rel="stylesheet" type="text/css" href="css/a.css">
<% } else
{ %>
<link rel="stylesheet" type="text/css" href="css/b.css">
<% } %>
But now I would like to redirect within own web site. if coming from A.jsp display one <tr>..
and if coming from B.jsp display a different <tr> on the page
For example:
<% String agent1 = request.get ??();
if (agent1. ??) {%>
display the following out.println <tr>....</tr>
<% } else
{ %>
display the following - out.println <tr> ...</tr>
<% } %>

any suggestions??
 
Brian Glodde
Ranch Hand
Posts: 171
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A hidden field is always easiest if the user POSTs to the destination page:
<input type="hidden" name="page" value="A">
or if they click on a link for the destination page, you can make the judgement based on the querystring:
somepage.jsp?page=A
or you could have a look at the request header and find the REFERER to make the decision:
HttpServletRequest.getHeader
 
mary morris
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, I will try the referrer, as I need to display two different table rows.
Mary
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!