JSP links to other pages

Hi,
I have a web app that does not use a framework. I do try to follow the MVC pattern though by having all requests go through one Controller Servlet.
I have a Home page jsp, which only has links to other pages. The Home JSP does not have a <form>. Just <a href's.
These links take the user from the home page to other pages which do work and submit forms. However, some of these pages (jsp's) need to be prepopulated with data. For example, I have a page which gives a random phrase from the Database when clicking on the submit button. But when I first get to the page by following the link from Home Page, it is empty. I want to arrive at the page and have it already gotten the first phrase for me.
One option I thought of is to have the link from the Home Page which took me to the Random Phrase page, go through the Controller servlet initially and have the Controller servlet, after having done the work of retrieving the phrase redirect to the Random Phrase page.
If this is the correct approach, how can I accomplish this? How do I have a <a href link in a jsp, redirect to a servlet right away without submitting a form or something?
Thanks.

So I put this in my home.jsp:
<a href="/Household/randomPhrase.php">Random Phrase of The Day</a> In web.xml I have this:
<servlet>
       <servlet-name>VHController</servlet-name>
  </servlet>
  <servlet-mapping>
       <servlet-name>VHController</servlet-name>
       <url-pattern>*.php</url-pattern>
  </servlet-mapping>According to the above, when I click on this link it should take me to the Servlet's doGet() method.
However, when I actually click on it, I get the following exception in the browser:
java.lang.NullPointerException
     com.myapp.servlet.VHController.doPost(VHController.java:47)
     com.myapp.servlet.VHController.doGet(VHController.java:35)All I do in the doGet() method is:
          response.setContentType("text/html");
          PrintWriter out = response.getWriter();
          out.println("URL: " + request.getRequestURL());
          out.println("URL: " + request.getRequestURL());
          out.println("METHOD: " + request.getMethod());Could anyone suggest what the problem may be? Why I am not getting the expected behavior?
Thanks.

Similar Messages

  • How can I create links to other pages in iBooks that will function in PDF?

    Hi,
    I know some people have asked previously how to create links to other pages of their book within iBooks. I having an issue with this myself that I haven't been able to resolve. I am able to create the links, and they seem to function within the program, however, once I export the document as a PDF file (the format in which I need to have this ebook!), the links seem to be non-functional. Does anybody have a fix for this?
    Thank you so much for any suggestions you may have!! I really need to figure this out for my client.
    Regards,
    Meggyn

    Exporting as a PDF does alter/lose/remove certain functions. Adobe Acrobat has its own page navigation system.
    A lot of the hidden engine of iBooks Author is basically very similar to building a website! so links and books marks are an "internal" function.
    IF you  have Acrobat and not just the Adobe Reader, you can make links.  I have never needed to try, but  I see a working link related index  in the many software manuals  I have.

  • Create links to other Pages documents

    I am a singer and have been using a binder with all my lyrics in it for shows. I got an iPad for my birthday and want to use it in the binder's place. With each show the set list changes and I'd like to be able to create a setlist document in Pages with links to other Pages documents with the corresponding lyrics. The lyrics documents would be static; the setlist document would always be changing. The links in the setlist document would be like hyperlinks of sorts, except instead of taking you to the web, they would take you to other Pages documents in the My Documents folder in Pages.
    I've searched all over the place for a solution. I've even tried using spotlight to search for the lyrics documents as a workaround, but spotlight doesn't find the Pages documents. Is this something I can set up on my MacBook and then transfer to my iPad? Is there other software besides Pages that can do this?
    Thank you in advance!

    I think it would be much simpler to save your lyrics as pdfs and use one of the many dedicated music apps that allow you to create setlists. I use forScore (love it!), but you might also check out Unreal Book and Music Reader.
    If you have a Mac, of course it's a cinch to print any file to PDF. For windows, possibly the free version of CutePDF would work for you.
    EDIT I see you already have these printed out in binders. Just scan to PDF, then.

  • Build a blank/other type of page which can show links to other pages

    Can someone please tell me how to build a blank/other type of page which can show links to other pages? I mainly want a page to show 3 links, once someone clicks on it, then it will go to a specified page. I tried using URL, but that did not work. Any advice is greatly appreciated. Thank you very much for your help in advance.
    -Grace

    Do a region (probably a HTML-based one is fine), enter in the HTML for your links, and that should be it. What didn't work about this?
    Your links probably should appear like this in your coding (use substitution variables):
    f?p=&APP_ID.:3:&APP_SESSION.
    In the above example, "&APP_ID." will resolve dynamically to the application ID that you are in, "3" is page 3 (change this to whatever page you want the link to be), and "&APP_SESSION." is the existing session number (if you don't include this, the user will receive a new session ID if the destination page is public or will be intercepted annoyingly to log in and get a new session ID which you probably don't want).
    Do not include the full http path. Just start with f?p... and everything is assumed to be relative to Apex on the current environment.
    Those are effectively the minimum requirements for a URL in Apex to go from one page to another in an app. You can add to that the additional URL parameters for Request value, Set items with values, clear cache, reset pagination, etc. if you need to. Check the Apex online help under "understanding URL syntax" for details on these.

  • How to create links to other pages i create??

    I have finished my "homepage" and it has 5 buttons on it.("home",
    "Contact us", etc.).
    I have no idea how to create links to other pages i create.
    For example, if the user clicks on "Contact us", i wnat contact information
    to appear. So, do i create another html document that will contain contact
    information and then call that page whenever the user clicks "Contact us". Or
    do i just create another applet that contains contact information and display
    the applet in the appropriate area, whenever the user clicks "contact us".
    Hope that wasnt confusing. Bascially, I am sitting here looking at my buttons, not knowing
    what code to put under the actionPerfomed part of each button.
    thanx
    trin

    ... judging from your question... the best way i think is to create another page...
    .... so when ur user clicks on Contact Us..... he/she will be taken to another page...
    there are other techniques besides this.... but it is always better to stick with the easiest one
    ... so you need to create separate pages for all of your links....
    ... if you have any questions... let me know
    .... have fun

  • Linking to other pages with JSP

    Hi guys,
    I'm just getting my feet wet with creating Java portlets, so sorry if this question has been answered many times before and seems ridiculously simple.
    Say I have two pages in portal. Page A has JSP portlet 1. Page B has portlet 2, also JSP.
    What I want to do is create a link in portlet 1 on page A, clicking on which will navigate the browser to page B and pass a parameter (through the querystring?) to portlet 2.
    How do I go about doing this? If anyone has an answer, or a place i can find documentation about this, I would be thrilled.
    TIA

    Hi,
    The JPDK parameters & events sample does exactly the same thing. Register the event provider & add these portlets to your page. The provider.xml for event provider is located at %OC4J_PORTAL%/j2ee/home/applications/jpdk/jpdk/WEB-INF/providers/event
    Also go through the eventform.jsp & publicparam.jsp in the WEB-INF/htdocs/ folder. However, before starting with this, if you are not too familiar with the "Parameters and Events" concept, you should start from the document overview.parameters.events.html at %PDK_EXTRACT%/pdk/articles
    Hope this helps,
    Abhinav

  • Click on a textbox, display alert and link to other page.

    hi, here i wanna do is when i click on a textbox, onFocus on it, then call a function to perform checking, and then if the textbox data have breakdown record then display an alert to the user and link to breakdown page.
    [Display out in a table]
    <%for(int c=0; c<progPect.size(); c++){%>
    <td id=progPect><input type="text" size=5 id="progPect" value='<%=progPect.elementAt(c)%>' onFocus="chkBreakdown(pass in 3 parameter);"></td>
    <td id=progQty><input type="text" size=5 id="progQty" value='<%=progQty.elementAt(c)%>' onFocus="chkBreakdown(pass in 3 parameter);></td>
    <td id=progLump><input type="text" size=5 id="progLump" value='<%=progLump.elementAt(c)%>' onFocus="chkBreakdown(pass in 3 parameter);></td>
    after calling the chkBreakdown function and found out that it has record, then pop up an alert that tell the user this record have breakdown, and then link to the other page with the same window.
    so the problem is how to identify user click on which row in the table.

    Vuze installs ask.com's tool bar also. Check for a Vuze plug in. Thanks for the fix.

  • Menus created using manual won't link to other Pages

    Created a site and had a menu created using manual which was linked to sub pages within the site. The menu was for specific pages not requiring access from the sites top level menu.
    The menu was working but now it is not possible to edit or replace the menu as there does not seem to be any way of adding the link to the required page. The dropdown box to the side of hyperlink stays greyed out and can't be accessed. This is only happening to links added using the menu widget under manual, ordinary text links seem to be OK.

    Welcome to the Apple Discussions. Confirm that there are no objects overlaying the navbar. How did you change the background, from the Inspector/Page/Layout pane?
    Happy New Year

  • Linking to other pages is not working

    I have a slice that I want to link to another page. I selected the slice and in the drop down that displays in the property inspector for the Link field, I select the page I want it to go to. However, when I test the page, it does not work, and in Safari, I get this message:
    No file exists at the address “/Users/MediaFred/Library/Application Support/Adobe/Fireworks CS5/FWTemp/4193627/page2.htm”.
    What is wrong with this?

    Did you try previewing all the pages in browsers?
    Click on File>Preview in Browser>Preview all pages in your_browser_name.exe.

  • Does pages 6.0 support internal links to other pages?

    I want to create links inside of Pages 6 to take the reader to other locations in the document. I need to have these fully functional links exported with the document into pdf. Has anyone actually tried this in 6.0? Des it work?

    Keynote is a version number ahead of Pages, because it was the first iWork app that came out. Numbers was the last and is one version behind.
    Pages '09 has Bookmarks that do the internal linking.
    It is Pages 5.2.2, the current version, that is brain dead.
    Peter

  • Blog page in iweb site not responding or linking like other pages

    Hi
    This is a new issue for me. I have multiple pages that I created in my iweb site through my personal domain ... studio8films.net
    All page hyperlinks will work properly, but the BLOG page seems to stall and when I look at the bottom of the window it is trying to access www.me.com where ALL THE OTHER PAGES show the access to web.mac.com
    Can someone tell me why this is the case? It doesn't make sense. And it is a new issue.

    Furthermore ...
    When the BLOG page finally loads, I click on the 'add comment' and a message comes up that says 'We're sorry. We are having a problem processing your request.
    Is there something going on with mobile.me and iweb blog pages or is there something wrong on my end?
    m

  • Menu items linking to other pages?

    I have built a menu using the forms menu tool in Dreamweaver, and now I would like to link each menu item to a different page. Can this be done and how? does it require SPRY?

    No, you don't need Spry to link pages.
    Highlight the text or image that you want to use as the link.
    Insert > Hyperlink
    Complete the Dialog Box... you can use the little folder icon/button at the right of the Link: field to navigate to the file you want to open with this link
    Clicking the "Help" button there will get you more information about Hyperlinking.
    Or:
    Highlight the text or image you want to use as the link.
    Just to the right of the Link field in the Property Inspector, drag the target icon over to the Files Panel and tap on the file you want to link to
    Of course, you say that you have used the "forms menu tool". Do you mean the "Jump Menu?" That has its own way of working: http://help.adobe.com/en_US/Dreamweaver/10.0_Using/WScbb6b82af5544594822510a94ae8d65-7c1ca .html
    I hope some of this helps!
    Z

  • Link to other pages of rows in APEX Interactive Report

    In my Interactive Report I would like to add a way to click on page results other than just clicking the > to advance to the next set of results.  I have my rows per page set to 15 by default and would like to keep it that way, but want a way to add links to page 4 or page 5 or page 10 as well.  Has anyone done that before, and if so ideas would be greatly appreciated.  I need to keep my rows per page to 15 because of parameters I send to another page, so increasing the rows per page is not an option. Thanks.

    Hi,
    The next button in your pagination fires a javascript function:
    gReport.navigate.paginate('pgR_min_row=16max_rows=15rows_fetched=15')
    You can create a page button or link containing that javascript function. Replace the number 16 by the rownumber you want to start your result set.
    Kind regards,
    Vincent Deelen

  • Selectable items within an image that has links to other pages

    Hello All,
    I have recently started to learn Dreamweaver CS5 and need some help.  I have a jpeg of a floor plan and want the user to be able to click on the different rooms within the floor plan.  Once you click on the room it would take the user to another page with more details about that room.  For example, I have a floor plan and want to learn more about the Family Room. I would click on the room that says Family Room and it would take me to another page with details about the Family Room.  Any help would be appreciated.
    Thanks,
    Knowledge Seeker2

    I have recently started to learn Dreamweaver CS5 and need some help.
    The best approach would be to put DW away, and focus on learning HTML and CSS.  That will make picking up DW again ever so much easier.
    I would click on the room that says Family Room and it would take me to another page with details about the Family Room.  Any help would be appreciated.
    Use the hotspot tool to apply hotspots to the image.  Link each hotspot to the associated pages by selecting the hotspot and applying the link with the "Link" field of the Property inspector.

  • How to use tab to link to other page in other application

    Hi all,
    I noticed that tabs does not have the option URL for the Target. It only has current page.
    Is it possible to link a tab to a page in another application in the same workspace?
    Thanks.
    Allen

    Hi Allen,
    Lists are more useful and flexible in that case, you can apply a tab template on them.
    Out of the box, tabs don't allow you to navigate to url's like you want to do. What you can do, navigate to a page in your current app and have in the header a redirect to the other app.
    Make sure you transfer your session (and authentication) to the other app, otherwise you need to login again.
    Regards,
    Dimitri
    http://dgielis.blogspot.com/
    http://www.apex-evangelists.com/
    http://www.apexblogs.info/

Maybe you are looking for

  • How to populate PO Open Interface table to create encumbrances?

    We want to bring in our POs from an external system, and we want them in an "approved" status. Is there any way to bring in the data, and "batch approve" them, and do the funds checking/encumbrance piece as well? There are some fields in the interfac

  • Sharing iTunes on a Mac with VMware Fusion

    I want to share my iTunes library on the Mac side of my MacBook Pro with the Windows VMware Fusion machine. I'm hoping to just point the Windows side to my shared Mac iTunes folder. I can see the folder (under Edit...Preferences...Advanced - it shows

  • Microsoft word does not exist. Please installe Microsoft Word 2000 or later

    Hi, I am running RoboHelp X3 and recently upgraded to Windows XP running Word 2003 and now cannot generate printed documentatation because of problems with Word. Despite changing the registry as suggested in another forum post (which I think was actu

  • Startup issue with a Zen Vision

    The problem I am having is that my player will act as though it starts up and the blue power light will come on, but there will be nothing that shows up on the screen. If I press the reset button the same thing will happen. I can plug the player into

  • No text shown in ALERT-Message in RWB-Inbox and via eMail

    Hi, we configured Alerting in XI giving conatiner elements in the title and long and short texts like &SXMS_ERROR_CAT& (actually we put all inside for testing purposes!). But when receiving the error message via eMail or in Alert-Inbox we only receiv