This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Hi, I'm trying to use anchor targets in the <forward> tag of and <action> in the struts-config.xml. I using the following approach: <forward name="success" path="/client/ClientInfo.jsp#details" redirect="true"/> Although the page is presented, the anchor target is ignored. I already tried accessing the page directly from the browser address and the anchor target works fine. It's only ignored when I try to access it from the struts-config file. Any Idea? Thanks [ October 21, 2003: Message edited by: Bear Bibeault ]
I'm trying to do a similar thing and also can't get this to work. I tried building a new ActionForward by appending on the anchor tag in an action class, but that also does not work. In the depths of the Struts RequestProcessor code, they use a RequestDispatcher to do the actual forwarding. The API for RequestDispatcher says that it "sends them to any resource (such as a servlet, HTML file, or JSP file) on the server". So, it looks like whatever path the ActionForward is sent to is the actual file name destination. (i.e. If ActionForward path is "/someplace/foo/Bar.jsp#MyAnchor", the RequestDispatcher will actually look for that filename, including the #MyAnchor, on the server.) I proved this out by putting an actual file name including the anchor out there, and it does find it. Has anyone figured out a way to deal with anchors in the Struts framework? TJ