Changeset 5
- Timestamp:
- 09/25/19 16:49:11 (5 years ago)
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
pom.xml
r4 r5 138 138 <groupId>junit</groupId> 139 139 <artifactId>junit</artifactId> 140 <version> 3.8.1</version>140 <version>4.12</version> 141 141 <scope>test</scope> 142 142 </dependency> -
src/main/java/geniusweb/runserver/RunNego.java
r4 r5 65 65 RunningNego session = new RunningNego(settings, 66 66 RunningNegotiationsRepo.instance(), log); 67 RunningNegotiationsRepo.instance().put(session);67 session.start(); 68 68 // set content type to prevent some browsers 69 69 // trying to parse this (eg as XML) -
src/main/java/geniusweb/runserver/RunningNego.java
r1 r5 36 36 37 37 /** 38 * Create new session wth unique ID. 38 * Create new session wth unique ID. You should call {@link #start()} to 39 * actually start this. 39 40 * 40 41 * @param settings the settings to use for this session … … 48 49 Reporter logger) { 49 50 this.log = logger; 50 protocol = settings.getProtocol(logger);51 this.protocol = settings.getProtocol(logger); 51 52 this.sessionid = "" + protocol.getRef().getURI() + (negoNr++); 52 53 this.repo = repo; 54 } 55 56 public void start() { 53 57 System.out.println("new session. logging to " + logdir); 58 repo.put(this); 54 59 protocol.addListener(evt -> handle(evt)); 55 protocol.start(new PartyConnectionFactory(log ger));60 protocol.start(new PartyConnectionFactory(log)); 56 61 } 57 62 -
src/main/webapp/newsession.xhtml
r4 r5 75 75 </div> 76 76 <div id="results" style="visibility: hidden"> 77 Your session started.<br /><a href="" id="logref">view the log77 Session completed. <a href="" id="logref">view the log 78 78 file</a> <br /> <a href="" id="plotref">render a utilities plot</a>. 79 79 </div> … … 311 311 312 312 // see https://www.w3schools.com/xml/dom_httprequest.asp 313 var xmlHttp = new XMLHttpRequest(); 313 document.getElementById("startbutton").disabled=true; 314 document.getElementById("started").setAttribute("style",""); 315 316 var xmlHttp = new XMLHttpRequest(); 314 317 xmlHttp.onreadystatechange = function() { 315 318 if (this.readyState == 4) { 316 319 if (this.status == 200) { 317 320 var logurl="log/"+this.responseText+".json"; 318 document.getElementById("startbutton").disabled=true;319 321 document.getElementById("logref").href=logurl; 320 322 document.getElementById("plotref").href="plotlog.xhtml?id="+this.responseText; 321 document.getElementById("started").setAttribute("style","");322 323 323 324 sometimeWhen(function() { return urlExists(logurl) },
Note:
See TracChangeset
for help on using the changeset viewer.