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 Rewriting  RSS feed

 
Abhisar Singh
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have following code in a JSP file and I want the count to increment with "cookies turned OFF" in the Browser in other words what code I need to insert to implement URL Rewriting for the following code.....

<%
Integer count =(Integer)session.getAttribute("COUNT");
if(count==null)
{
count = new Integer(1);
session.setAttribute("COUNT",count);

}
else
{
count=new Integer(count.intValue()+1);
session.setAttribute("COUNT",count);
}

out.println("The count is "+count);

%>
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Make sure all of your links, form actions, and redirects have the session id encoded in them.
See:
java.lang.String&#41;" target="_blank" rel="nofollow">http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/http/HttpServletResponse.html#encodeURL(java.lang.String)
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could we ask which server you're using? Some don't support URLRewriting unless you state explicitly you need it. Go to lots of websites: if you've got cookeis turned off, they just won't let you in.

And remember, EVERY LINK needs the id encoded into it. With this approach, you can no longer have any URLs that are not dynamically encoded.
[ August 27, 2006: Message edited by: Bear Bibeault ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!