File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes How to forward to jsp page and then jump to anchor of the page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How to forward to jsp page and then jump to anchor of the page" Watch "How to forward to jsp page and then jump to anchor of the page" New topic
Author

How to forward to jsp page and then jump to anchor of the page

Usera User
Greenhorn

Joined: Jul 13, 2005
Posts: 21
I want to forward to jsp page and then jump to anchor of the page. I have defined the anchor <a name='insert'> in the destination page and using the forward defination in action element in struts-config.xml

<forward name="Success" path="view_data.jsp#insert">

But it doesn't work, the error is page not found.

Has any idea ?
Jason Menard
Sheriff

Joined: Nov 09, 2000
Posts: 6450
Try the following...

<forward name="Success" path="/view_data.jsp#insert">
Usera User
Greenhorn

Joined: Jul 13, 2005
Posts: 21
It does not work. It seems that the server want to find the file "view_data.jsp#insert". The "#insert" is part of the filename.
sarvesh khatri
Greenhorn

Joined: May 05, 2005
Posts: 4
Instead of putting the anchor in struts-config.xml, append it at calling time
Following example might help

<action name="BaseForm" path="/viewdata" scope="request" type="BaseAction">
<forward name="Success" path="view_data.jsp">
</action>

When calling above action
/viewdata.do#insert
Srilakshmi Vara
Ranch Hand

Joined: Jul 21, 2004
Posts: 169
My situation is same, any ideas
Jan Groth
Ranch Hand

Joined: Feb 03, 2004
Posts: 456
don't know if it's the best solution, but if you executed



based on a condition which you evaluated in the jsp, it will make IE (not FF...) jump to the anchor.

the hard way, i know, but it works...

jan
 
wood burning stoves
 
subject: How to forward to jsp page and then jump to anchor of the page