PathParam not working

UI Components for JSF
Post Reply
grubi
Posts: 11
Joined: 15 Nov 2012, 12:52

23 Oct 2015, 17:14

JBoss 7.1.3, Mojarra 2.1.29, PrimeFaces 5.3, Atmosphere 2.4.0-RC6

I've tried to code something using PFP, but it was not working. The simple testcase includes the following xHTML and endpoint class, that you can find at the end of my posting.

I would expect, that the _guidUser is set to abc, but instead it is still null. Everything else works. all @On*-callbacks are invoked.

I also installed the showcase 5.1, 5.2 and 5.3 to test the chat example which also uses @PathParm. The same happend for 5.2 and 5.3. Nothing was working and the username was empty. But 5.1 worked.

It looks like an bug since 5.2 in the PFP framework.

Code: Select all

<h:form id="frmPush">
	<p:socket channel="/pagelock/user/abc" widgetVar="mySocket"
		 onOpen="console.log('Connected')"
		 onClose="console.log('Disconnected')" 
		 onMessage="function(data){console.log(data);}"
		 onError="console.log('Error');"
		 onTransportFailure="console.log('Transport failure');"
		 onReconnect="console.log('Reconnect');"/> 
			
	<a href="#" onclick="PF('mySocket').push('My Message');return false;">Send</a>
				
</h:form>

Code: Select all

@PushEndpoint("/pagelock/user/{user}")
@Singleton
public class UserNotificationChannel {

	@PathParam("user")
	private String _guidUser;
	
	public UserNotificationChannel() {
		System.out.println("UserNotificationChannel created");
	}
	
	@OnOpen
	public void onOpen(RemoteEndpoint remote) {
		System.out.println("Channel opened for user '" + _guidUser + "'");
	}
	
	@OnClose
	public void onClose() {
		System.out.println("Channel closed for user '" + _guidUser + "'");
	}
	
	@OnMessage
	public void onMessage(String message) {
		System.out.println("Incoming message for user '" + _guidUser + "': " + message);
	}
}

grubi
Posts: 11
Joined: 15 Nov 2012, 12:52

26 Oct 2015, 10:34

I think I found the root cause and reported it to the developers
https://groups.google.com/forum/#!topic ... 6cRpg2DMgI

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: Seo-Ul-But and 21 guests