Store URL in oracle database and access the link from html web page on click of a but

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ajay13785
    New Member
    • Oct 2013
    • 10

    Store URL in oracle database and access the link from html web page on click of a but

    I want to store url in oracle database and when ever I click button from my html page it should navigate to that url page. Is is possible?
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    Is is possible?
    yes .

    Comment

    • ajay13785
      New Member
      • Oct 2013
      • 10

      #3
      Originally posted by Dormilich
      yes .
      Hi Could you please give the idea how to store URL in database and retrieve it each time when I click on links from my html webpage.

      Thanks in advance.

      Comment

      • Dormilich
        Recognized Expert Expert
        • Aug 2008
        • 8694

        #4
        have you ever worked with a server-side language?

        Comment

        • ajay13785
          New Member
          • Oct 2013
          • 10

          #5
          Originally posted by Dormilich
          have you ever worked with a server-side language?
          I am new to programming but I am working on java/jsp and javascript. I need idea how to do that.

          Comment

          • Frinavale
            Recognized Expert Expert
            • Oct 2006
            • 9749

            #6
            This has to be done by your server-side code (this would be your java code). JavaScript cannot store data into a database.

            In the appropriate server-side method you will need to use Java to insert the url into your database.

            -Frinny

            Comment

            • ajay13785
              New Member
              • Oct 2013
              • 10

              #7
              Thanks I have already done the programming To insert the url in the database , but I want to access the url and navigate to the page when button is clicked . The url will be stored in the oracle database ,but how to access the url on click of the button from my webpage .

              Comment

              • Frinavale
                Recognized Expert Expert
                • Oct 2006
                • 9749

                #8
                After your Java code stores the url into the database, have it send a response back to the browser to redirect it to the url provided.

                Comment

                • ajay13785
                  New Member
                  • Oct 2013
                  • 10

                  #9
                  Can please give me the code

                  Comment

                  • Frinavale
                    Recognized Expert Expert
                    • Oct 2006
                    • 9749

                    #10
                    It is unfair to ask people for do your work for you.

                    Please attempt to solve the problem first and then if you have a particular question about the implementation you have attempted ask for help.

                    Start by researching the suggested solutions that have been discussed so far.

                    For example, the first result in a google search for "jsp response redirect" came up with this article: jsp - page redirecting. It explains how to use Java code send a redirect to the browser (which you can use after you save the URL into your database).


                    -Frinny
                    Last edited by Frinavale; Oct 25 '13, 01:34 PM.

                    Comment

                    • Frinavale
                      Recognized Expert Expert
                      • Oct 2006
                      • 9749

                      #11
                      I think I miss read your question.

                      You wanted to know how to access the URL from a button click?

                      What URL?

                      As you know, your button will submit the page to the server for processing. Are you trying to store the URL of the page that the button submitted to? I'm really not sure why you would want to do this but this is possible.

                      First we need to cover a few things...

                      JSP pages and other Java hosted web applications require a web server component to handle page requests from browsers. The web server I used to use many years ago wasTomcat Apache. I'm pretty sure it is the server you are using now.

                      When Apache receives a request it determines what code should be executed to handle the request and then creates a context for the Java code to run under. In your Java code, you can use the PageContext you can access the requested URL through PageContext.req uest.contextPat h property.

                      If you are trying to store some other URL that is somehow submitted to your jsp code, then you need to explain where you are getting that URL from.

                      It has been a very very long time since I've developed Java applications and I don't know how much further I can help you.

                      I moved your question to the Java forum since your question has nothing to do with JavaScript.


                      -Frinny
                      Last edited by Frinavale; Oct 25 '13, 01:55 PM.

                      Comment

                      Working...