PDA

View Full Version : Using anchors in flow names.


sergebg
Apr 17th, 2006, 10:53 AM
Hello!

I have found the webflow does not support anchors in view names. I have tryed to use the view name of the following kind:
<end-state id="finish" view="flowRedirect:browse#100">
The '#' character is escaped in resulting url, so the view names with anchors do not work.

I have found this problem was in spring-mvc: "Anchors in RedirectViews" (http://forum.springframework.org/showthread.php?t=13632&highlight=redirect+anchor)
There was the issue: SPR-799 (http://opensource.atlassian.com/projects/spring/browse/SPR-799). This issue is resolved.

Is it a problem for the webflow? Can I use anchors by some another way?


Thanks,
Serge

sergebg
Apr 18th, 2006, 01:29 PM
The answer is in FlowRedirect class. This class has just the flowId and a parameters map. It has no any support for the anchor. The class functionality can be extended, but this is the subject for a spring develpers discussion.

amahajan
Apr 20th, 2006, 09:23 AM
I wonder if you could pass an extra variable.
viewname.jsp?anchor_loc=100

Then in jsp itself check anchor_loc's value and do a jsp redirect to itself with anchor value.
Not sure if jsp redirect will cause server state and client state to go out of sync.

sergebg
Apr 22nd, 2006, 01:27 AM
Thanks,

That anchor injection is not a problem. But I am thinking we need appropriate framework support.

Your method is not quite good. At this situation I prefer to use some dispatching page instead of redirecting to the same page. From the other hand, I think, I'll try to avoid such approach at all.

Really there is no problem. We can use java-script + additional parameter. This is very simple to implement. And we can to modify flow navigation components. It is more complicated way. We will do this latter.