• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

Problem with anchor tag # when trying to open pdf

 
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I have a requirement to open a PDF document (to open an existing pdf on server not creating) with showing the appropriate section which user clicked and also need to update the count in database.

In order to do this i have followed these steps:
Ex: Lets say XYZ.pdf file which has a, b and c sections. To show section a in the URL it is some thing like ../../XYZ.pdf#a


1. First, i called my controller class when user clicks the link (to update the count in database) and in controller i used Spring MVC redirect function to open XYZ.pdf#a. But the problem is its removing the # from URL and showing entire XYZ.pdf opening first page instead of showing #a section. That too this is happening in IE browser not in Firefox.
2. I have tried another way by calling a dummy jsp from controller and onload of that jsp i did location.href function to show the pdf document. It worked but the problem is with back button, if i use POST method back button displays page cannot be displayed message, if use GET method back is not working i will be in same page forever it wont allow you to go back.

I hope i cleared explained my problem, Could any one please help me.

Thanks in advance!

- Vamshidhar Nimbagiri

 
vamshidhar nimbagiri
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

After trying many alternative solutions. At last i found one which is working.

In my controller i setting the location to response header like this:

response.setStatus(Response.SC_MOVED_TEMPORARILY);
response.setHeader("Location", docLoc); // where docLoc is the absolute path of the location of the document.


 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic