Reload servlet to a specific area on the page

Hi, gang
I have a servlet that refreshes at user defined rate and displays a bunch of different things on the page.
I would like to the user to be able to click on a link that would take him to (for instance) a middle of the page, and when the servlet refreshes again the user will still be in the same area, and not at the top of the page.
I am using meta-refresh to refresh the servlet, and I know I have to use the "A HREF" and "A NAME" commands, but I am unable to do it dynamically.
The simplified segments of my code look like this.
protected void service(HttpServletRequest request, HttpServletResponse response)
throws ServletException, java.io.IOException {
response.setContentType("text/html");
java.io.PrintWriter out = response.getWriter();
int time = (new Integer(request.getParameter(REFRESH_RATE))).intValue();
out.println("<html><head>");
out.println("<meta http-equiv='refresh' content='"+time+";URL=MyServlet?"+REFRESH_RATE+"="+time+"' frame='self'>");
out.println("</head><body>");
out.println("<A HREF='#MIDDLE'>Jump to Middle</a>");
out.println("<A NAME=TOP>");
out.println("<FORM NAME=setTime METHOD=GET ACTION="MyServlet?"+REFRESH_RATE+"="+time+"'>");
out.println("<input type=textfield name='"+REFRESH_RATE+"' value='"+time+"'>");
out.println("<input type=submit value='Refresh after this many seconds'>");
out.println("</form>");
out.println("<P>Blah blah blah<P>");
out.println("Back to Top");
out.println("<A NAME=MIDDLE>");
out.println("<P><P>More Blah Blah Blah<P><P>");
out.println("</body>");
out.println("</html>");
out.close();
Thank you in advance,
Val.

Try this... modify your initial part of the code as below
response.setContentType("text/html");
java.io.PrintWriter out = response.getWriter();
String time = request.getParameter(REFRESH_RATE);
String area = request.getParameter("area");
out.println("<html><head>");
out.println("<meta http-equiv='refresh' content='"
+time
+";URL=MyServlet?REFRESH_RATE="
+time
+ "#"
+ area
+"' frame='self'>");
out.println("</head><body>"); and the part where you hav links as shown below...
out.println("<A HREF='MyServlet?"
+REFRESH_RATE
+"="
+time
+"#MIDDLE'>Jump to Middle</a>");
out.println("<A NAME=TOP>");
out.println("<FORM NAME=setTime METHOD=GET ACTION='MyServlet?"+REFRESH_RATE
+"="
+time
+"#MIDDLE'>");
out.println("<input type=textfield name='"+REFRESH_RATE+"' value='"+time+"'>");
out.println("<input type=submit value='Refresh after this many seconds'>");
out.println("</form>");Just a giude line... Hope this may help you.

Similar Messages

  • When using the "Fill & Sign PDF" feature, is there a way to stretch to size the text box, for a specific area on the page...instead of it going on in one straight long line...?

    When using the "Fill & Sign PDF" feature, is there a way to stretch to size the text box on a specific area of the page...instead of the text box going on in one straight long line....? I'm not seeing there's an option or ability to do so, just wanting to confirm.

    Improving the handling of multiple line text fields is in our plans, but for now, you will have to add manual carriage returns (Enter).
    Thanks,
    Josh

  • OIM11gR2 - Is it possible to create a direct link to a specific area in the oim plattform?

    hi,
    is it possible to create a direct link to specific area in the oim self service plattform? for example a link to the users account list, or a link to a specific resource account?
    br,
    max

    Hi,
    Yes, Its very much easy in R2 as compared to R1. You can use following link to achieve your requirement:
    http://docs.oracle.com/cd/E27559_01/dev.1112/e27150/uicust.htm#BABIDJAB
    ~J

  • Repainting specific areas of the canvas

    Hello, ive been trying all day to search for good examples on how to repaint specific areas of the screen. I know there are som atributes to the repaint() method, but im trying to repaint an area of 20x20 px on the left corner of the screen with a thread. Can someone pleeeeeeez guide me maybe to how to accomplish this. Thanks in advance.

    Well you would call repaint(0,0,20,20), instead of just repaint().
    But more importantly is that you set up your paint() method so that it can recognize that you're only repainting part of the screen. Something like:
    public void paint(Graphics g) {
      // you use the Graphics.getClip????() methods to find out the clipping region for this paint request:
      int clipX = g.getClipX();
      int clipY = g.getClipY();
      int clipW = g.getClipWidth();
      int clipH = g.getClipHeight();
      // now, if you called repaint(0,0,20,20) then clipX=0, clipY=0, clipW=20 and clipH=20
      // so you can now use these variables to set up code that only repaints the appropiate part of the screen
    }Even if you don't set up the paint() method this way, it will still work, because anything you paint outside the clipping region won't show up on screen. But I imagine that you want to repaint just part of the screen because you need the painting to be faster, so unless you take the clipping region into account, all the paint code will be executed and you won't gain too much speed by only repainting part of the screen.
    shmoove

  • Can I set a specific point on the page to go with a button?

    I got a page of 1024x3072 and i need set a button to go on a specific point of the page, for example, from 650px to 724px just using a button.
    So, my question is ¿can i do that?, ¿how?...Thanks

    Not supported.
    Bob

  • What I'm trying to do is when I scroll down the page have the images that are on the page stay the same look as I scroll

    What I'm trying to do is when I scroll down the page have the images that are on the page stay the same look as I scroll

    Use the scroll motion tools and set the settings all to 0

  • The margins of section # are set outside the printable area of the page.

    Hi i have a Hp 7410 all in one officejet. I have just gone from Xp Pro to Windows 7 64 bit. I have installed correct drivers and Hp's own tool tells me i have the current drivers. But i just went to print in Microsoft Word 2007 and am getting the error The margins of section # are set outside the printable area of the page. Do you want to continue?. If i continue i am missing the bottom section of my document. How can i fix this as this printer worked perfectly in XP but now in Windows 7 it is not working. this is the only trouble IM having......

    Hi,
    I'm not sure that changing from XP to Windows 7 should have a detrimental effect on your ability to print. I did check out the 7410 printer manual at the following location:
    http://h10032.www1.hp.com/ctg/Manual/c00235090.pdf
    On page 74 there is a reference for adjusting page margins in connection with MAC users & 2-sided printing.  However, perhaps if you go to the page layout tab in MS word & click on the margins section.  It offers a selection (Normal, narrow, moderate, wide & mirrored) so maybe if you select one of these the system will right size the document for printing.
    As I say I can't explain how this may have happened but hopefully choosing a margin setting will help.
    ---- If my answer was helpful please click the Kudos star.
    If your problem is solved please click the Accept as Solution button so other forum users can use the solution.---->
    (I am an HP employee) I am not a expert on all our products, but I'll do my best to help you.

  • The margins of section # are set outside the printable area of the page. Do you want to continue?

    Hi i have a Hp 7410 all in one officejet. I have just gone from Xp Pro to Windows 7 64 bit. I have installed correct drivers and Hp's own tool tells me i have the current drivers. But i just went to print in Microsoft Word 2007 and am getting the error
    The margins of section # are set outside the printable area of the page. Do you want to continue?
    If i continue i am missing the bottom section of my document. How can i fix this as this printer worked perfectly in XP but now in Windows 7 it is not working. this is the only trouble im having.

    FYI, this is for my place of work. I put a lot of effort into getting this fixed but I am stuck. I would greatly appreciate any ideas or help. Thanks again.

  • When I create a tablet/desktop/phone version of a site, why are all the pages blank?

    Hello, longtime listener/user, first time caller
    I've been using Muse since jumping on the Creative Cloud train a couple years ago, but to date all my experience had been in maintaining and updating a desktop version of a couple small sites.  I loved the idea of Muse being able to assist in the creation of separate desktop/tablet/mobile layouts (ie responsive design), and this past week was my first experience in using it as I worked on a ground-up rebuild of http://www.eridusociety.org.  I started with a Phone layout, with the intention of getting that right and then expanding outward to a tablet version, and once that was finished, adding a desktop layout.
    After completing the mobile site and testing it on Business Catalyst (thanks to all involved in that seamless integration, by the way), I clicked on the +Tablet button and proceeded to build out the tablet layout of the site.  To my dismay, all the pages it built were blank.  I tried deleting and re-doing it with different combinations of the options checked, to no avail.  Then I raced off to the nearest web browser and started searching - surely I missed a step, or the great collective brain of the internet could alert me to some way to achieve this.  Alas, no such luck. 
    The blank pages are intentional, and the way to populate those blank pages is to go back to the phone layout, open the page, then copy all the content, then switch back to the tablet layout, open the corresponding page on the tablet layout, and paste in the content from the source layout... and of course, rinse and repeat for the desktop layout as well (though for my workflow, I copied the finished tablet layout pages to create the desktop version).
    For me, starting with all the page elements from the source layout is much easier than starting from scratch on each and every page.  That way I know I have all the elements on the page, and I can add to (or subtract from) as well as modify the layout in fairly short order.  I've been driving myself a little crazy with all the bouncing back and forth between layouts to copy/paste elements as I work on my site, and for future reference I'd like to know if there's some way that can be avoided in the future?
    Ideally, I would like to see an option in the create layout dialog box to be able to copy content (and choose the source layout to copy from). 
    Beyond that, another great option for this dialog would be to let me choose to switch all the page links to the new layout.  That is, when it copies and pastes all the page content from source layout, Muse would then also update the links to pages within the site so that they link to that layout's pages.  So when I build a phone version and click +Tablet, I can check a box to copy page content from source, specify that source, and then check another box to update links for layout.  After Muse does its magic, I have a tablet layout that's already got page content on it, and it's linking to other pages on the tablet layout (and not to the source/phone layout pages).
    Thanks to everyone on the Muse team for a pretty great product, and to the people manning the Twitter account for responding to my tweet and directing me here.

    Sanjit, I think one of us is missing the point.  It could be me - is there some way to easily and quickly pop open multiple layouts and pages?  Because for me (running a 12-core Mac Pro with 64GB RAM and FirePro D700 GPU's), Muse lets me switch between one layout view and the next (not open them simultaneously), and takes several seconds to do this every single time.  Opening and closing pages (to create separate tabs/windows) is also incredibly tedious. 
    I can appreciate that select and drag works just as well as selecting all and using copy/paste shortcut keys, but that is the least time consuming part of the process.
    Without copying the page contents from the source layout and transpose internal page links to new layout, Muse falls short of the mark of making it really easy to build responsive sites.  It's kind of like trying to take a cab to a destination across town that makes you get out and walk halfway.  No matter quickly or easily the cab made it through town, it still only got you half way there.

  • Click on a image in the swf and go to a specific section of the page

    Can any one help me with this.
    I do have an SWF file (in the main html page) with 6 time
    frames. Each frame has 3 images. On the other hand I do have a
    second html page that is nothing but the main title and 18
    sections. Every section describes one the SWF’s images.
    What I am looking for is whenever I click on one of the
    images of the SWF file; I want to go to the specific section that
    describes the image I have just clicked on.
    Thanks alot

    I am trying to do this as well. I have a drop down menu that
    I have as an embedded SWF in my html page, and I want one of the
    buttons to take you to a specific part of the html page. Does
    anyone know how to do this? Using the #name like in html does not
    appear to work. Can't find the answer anywhere!!!
    Text

  • Adobe Reader will not center the printable area on the page

    Hi there,
    I have posted a few times about this issue already but have still not gotten an answer so I'm trying again. Adobe Reader will not center PDF files on the page if the printable area is less than 8.5" X 11". I make sewing patterns for a living and have always drafted them on 7.5" X 10" artboards (printable areas)....the art boards are centered on the page when they are drafted. Up until a few months ago there has never been an issue for me or my customers to print the patterns in either landscape, portrait (depending on the particuar PDF's orientation) or autoportrait/landscape orientation. Then about 2 or so months ago I started getting complaints about the top left hand side of the page getting cut off. When I tried printing one of the PDF's myself that was drafted in landscape orientation, and I printed it in "landscape" orientation, the top left side of the pdf did indeed get cut off. When I printed in autoportrait/landscape orientation the pdf printed fine, and for many of my customers this seems to fix the problem. But for many of them it doesn't fix the problem and the pdf still prints with part of it getting cut off regardless of which box is checked for orientation. I've found that if I go to the "pages to print" box and click "other options" then select "current view" this often solves the problem...but then the user does not seem to be able to select which pages to print. This is becoming a major problem for my business (lots of complaints) and would really like to know if anyone has looked at this issue and if the problem will be solved anytime soon. It is not just me but many of my colleagues and 100's of customers. Help! Thank you:)

    iMac G4, Mac OS X (10.4.9)
    Make sure you have the latest Adobe Reader installed for your OS.
    http://www.adobe.com/support/downloads/product.jsp?platform=macintosh&product=10
    Did you try using Preview. If you control click on the PDF on your desktop you can use the "open with" option.

  • How to create links that guide you to a specific title on the page and not the beginning of the page?

    I'm trying to create links so that when you click on a title in the table of contents it guides you to the title on the specific page. However, when I do that it always sends me to the beginning of the page even if the title is in the bottom. Anyone knows how to do if I want to get to the title and not to the beginning of the page? When I use Finereader it create links from the table of contents automatically and those links send me to the title no mater where it is on the page. I've tried do edit the settings to look like those links created in Finereader but it doesn't work.
    I'm using Adobe Acrobat XI on a Mac Book Air.
    Regards,
    Andreas

    In you first query you can only have 1 column listed in your subselect, used ResourceID.
    http://www.enhansoft.com/

  • I can't link menu items with the areas in the page:

    I download a theme over imternet and menu and the page areas not linked how can i do that ?
    When i press the communication button i stays constant
    but there is communication section and i can't linked them.

    You cannot link default menu items , default menu includes the link to pages ( site structure).
    You would need to create a manual menu if you want to link new pages to menu items. Please let me know if you are not looking for this answer.
    Thanks,
    Sanjit

  • Where are all the pages in Pages Templates?

    Hi--When I mouse over templates in the template chooser in pages, I can see that the template has many pages....cover, table of contents, glossary etc., but when I pick a template and open it, there are only two pages in each template.  Where are the rest?  Thanks.

    They are here
    or here

  • Is it possible - when a pop up occurs while in a site - to have the pop up always open in a certian predetermined area on the page?

    Is it possible - when a pop occurs while in any site - to have the pop up window always open in a certain predetermined area on the web page?

    Do you have that problem when running in the Firefox SafeMode?
    [http://support.mozilla.com/en-US/kb/Safe+Mode]
    ''Don't select anything right now, just use "Continue in SafeMode."''
    If not, see this:
    [http://support.mozilla.com/en-US/kb/troubleshooting+extensions+and+themes]

Maybe you are looking for

  • Multiple form fill-ed's open at one time - crashing

    I have many form fill-ed documents created using Live Cycle.   Issues have been reported regarding adobe shutting down in the middle of filling out a form.  Tow of our employees have this crashing issue.  They both have Windows 7; Adobe Reader XI, an

  • Skype blue screen big error's

    (pardon my english, not from English country) So, i've been having real big issues with my skype for over a year now. Story: I have used skype (ver. 6.16 i think) on my computer (HP pavilion G6, Windows 7 Home Premium) for a very long time, suddenly

  • HR - Get inactive personnel

    Hi All, Im using PNP logical databese to retrieve certain records from table PA0009 based on the company code provided in the selection screen. However, I realize using GET PERNR, it seem the personnel under status Eg. Terminate, withdrawn. are not b

  • Where is AirDrop on the mac mini? Not in the side bar...

    I cannot find AirDrop on mt mac mini. It is not in the sidebar, and it does not appear in the list  of sidebar items in Finder Preferences/Sidebar/Advanced. The computer is connected by ethernet to cabe modem and has wireless on. On the other hand, I

  • HDMI bad resolution on second monitor macbook pro retina

    I just bought a second monitor for my macbook pro retina and connected it through a HDMI cable. To my surprise it did not play the full resolution it only plays 1360 x 768.... I already tried the alt trick when showing display preferences, but no win