• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

include js in jsp

 
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hy guys,
some questions about a js that i must include in my jsp :
I read with this javascript the cooki write by java cookie this is the code java in the jsp:

<%

Date now = new Date(System.currentTimeMillis());

DateFormat formatter = new SimpleDateFormat("dd/MM/yyyy hh:mm:ss.SSS");


String date = formatter.format(now);

Cookie cookie_registrazione = new Cookie("RegStep1_cookie", date);

response.addCookie(cookie_registrazione);


%>
now i must include a file js to read this cookie ok??


var nome = "RegStep1_cookie";

if (document.cookie.length > 0) {
alert("in document");
c_start = document.cookie.indexOf(nome + "=");
if (c_start != -1) {
c_start = c_start + nome.length + 1;
c_end = document.cookie.indexOf(";", c_start);
if (c_end == -1) c_end = document.cookie.length;

ret_cookie = unescape(document.cookie.substring(c_start, c_end));


return ret_cookie;

}
}

Ok how i can to view this cooki in the frame but the include file must to be an js?
Someonte can help me?

thank you
dora di donato

 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic