Reply To: How to append Trailing Slash to the requested URL

Splash Forums Rewrite Users How to append Trailing Slash to the requested URL Reply To: How to append Trailing Slash to the requested URL

#25020

youngreymond
Participant

Hello, I’m trying to append Trailing Slash to the requested URL in the Rewrite way, but the physical page is showed instance of Join path.

this is my configuration

@Override
	public Configuration getConfiguration(ServletContext context) {
		return ConfigurationBuilder.begin()

				.addRule(TrailingSlash.append())
				.when(Path.matches("/{x}"))
				.where("x").matches("^(?!.*\\.xhtml.*).*$")
				
				.addRule().when(Path.matches("/")).perform(Redirect.temporary(context.getContextPath() + "/web/home"))
				.addRule().when(Path.matches("/web/")).perform(Redirect.temporary(context.getContextPath() + "/web/home"))
				
				.addRule(Join.path("/web/home").to("/faces/portal/home.xhtml"))
				.addRule(Join.path("/web/login").to("/faces/portal/login.xhtml"))
				
				.addRule(Join.path("/web/{modulo}").to("/faces/portal/home.xhtml"))
				.perform(PhaseOperation.enqueue(new IgnorePostbackOperation(Invoke.binding(El.retrievalMethod("sessionBean.processModuloSeleccionado")))).after(PhaseId.RESTORE_VIEW))
				.where("modulo").bindsTo(PhaseBinding.to(El.property("sessionBean.selectedModuloValue")).after(PhaseId.RESTORE_VIEW))
				
				.addRule(Join.path("/web/{modulo}/{servicio}").to("/faces/portal/{modulo}/{servicio}.xhtml"))
				
		;

	}

and this is the page that I trying to get http://localhost:8080/portal/web/home/

but I am getting this : http://localhost:8080/portal/faces/portal/home.xhtml/
I tried putting the TrailingSlash Rule to the end of Rules but I get the same behavior, are there something wrong with my configuration ?
I tried putting the / to the end to every Join.path but, the result is the same.