• 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

javascript called within JSP

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I want to test if user is logged in or logged out and put the logic on the header of my static html page (tomcat, apache)

I would put .js code like this in my html
document.getElementById("test").innerHTML= '<a href="/login.jsp>Login</a>
And if user is logged in then put link to LOGOUT dynamicaly.

I am using JSP page to check for logic login/logout:
<c:if test="${!empty user}">
<p><a href="/logout">Logout</a>

How do I call the javascript from this JSP page to display on my html page this logic.

the html pages must stay static and I can't use jsp on them

[ March 14, 2006: Message edited by: Mark Moore ]

[ March 14, 2006: Message edited by: Mark Moore ]
[ March 14, 2006: Message edited by: Mark Moore ]
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've read your question 4 times and I still can't make heads or tails out of it. You talk about a JSP page, and then about an HTML page that can't be JSP. Which is it?
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And, since is not a servlets question, moved to the JSP forum.
 
Mark Moore
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok, thx for checking,
basically:
jsp page calls javascript that displays on html page dynamicaly link to login or logout.

My question is how to do interact jsp with javascript to display onto html
I understand the jsp logic and the javascript logic on their own
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry, still not getting it. Your latest message is even briefer and more cryptic than the first. I was looking for elaboration.

As a general statement, there is no collaboration between JSP, which operates on the server in order to send an HTML page to the client, and Javascript that executes in the context of the client.
[ March 14, 2006: Message edited by: Bear Bibeault ]
reply
    Bookmark Topic Watch Topic
  • New Topic