  | Mailing List | | Home | | Forum Home | | JBoss - Java Application Server | | Tomcat - JSP/Servlet container | | Struts - A MVC web framework | | iText - An open source PDF Java Library | | JDOM - JDOM XML Parser | | JSP - A mailing list about Java Server Pages specification and reference | | J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition | | J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog | | Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology | |
Struts & Hibernate
|
|
|
  | | | JSP and JAVAScript - dynamic content | JSP and JAVAScript - dynamic content 2005-04-05 - By J=?ISO-8859-1?Q?=F6rg?= Wiesmann
Back Hi @ all,
i am trying to find a solution for the following problem: We want to show a website with different content without realoding the page. I tried to solve this problem with a combination of javascript and jsp, but i can not get it working.
here the code i tried. I want to call the jsp function more than once, but it do not work. It is just called when the page has been loaded or is reloaded. Any suggestions ?
is it possible ? or do the server interprets the code just once and then never again? it should be possible, or not ?
the javascriptfunctions: ~~~~~~~~~~~~~~~~~~~~~~~~ function start() { timerID = setTimeout("getEventJScript()", 2000); } function getEventJScript() { document.InputForm.TelephoneInputField.value = "test..."; <jsp:scriptlet> String reqAtt1 = "Instance"; String reqAtt2 = "uniqueName"; Server MyServer = (Server) request.getAttribute( reqAtt1 ); String userNameGiven = (String) request.getAttribute( reqAtt2 ); EventHandling event = MyServer.getEvent(userNameGiven); String myStatus = event.getStatus(); </jsp:scriptlet> statusJS = "<jsp:expression>myStatus</jsp:expression>"; document.InputForm.TelephoneInputField.value = statusJS; document.InputForm.TelephoneInputField2.value = "<jsp:expression>userNameGiven</jsp:expression>"; document.InputForm.TelephoneInputField5.value = count; count = count +1; timerID = setTimeout("getEventJScript()", 2000); }
Best regards J?rg Wiesmann
==========================================================================To unsubscribe: mailto listserv@(protected) with body: "signoff JSP-INTEREST". For digest: mailto listserv@(protected) with body: "set JSP-INTEREST DIGEST".
Some relevant archives, FAQs and Forums on JSPs can be found at:
http://java.sun.com/products/jsp http://archives.java.sun.com/jsp-interest.html http://forums.java.sun.com http://www.jspinsider.com
|
|
 |