• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

URL Rewriting

 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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);

%>
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Make sure all of your links, form actions, and redirects have the session id encoded in them.
See:
http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/http/HttpServletResponse.html#encodeURL(java.lang.String)
 
author and cow tipper
Posts: 5009
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Politics n. Poly "many" + ticks "blood sucking insects". Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic