Loading ...
Sorry, an error occurred while loading the content.

virtual links

Expand Messages
  • Stelios Eliakis
    Hi, I would like to ask if I could use this www.mysite.com/products?id=345 or this www.mysite.com/products/345
    Message 1 of 5 , Oct 11, 2006
    • 0 Attachment

      Hi,
      I would like to ask if I could use this www.mysite.com/products?id=345
      or this  www.mysite.com/products/345
      in order to take the information of the product with id=345.

      Generally I would like to ask how could I use logical links.
      For example if I had a php page (products.php)  someone would execute this url: www.mysite.com/products.php?id=345, the server would take the id parameter, would do the process and would return for example a xml document.
      If I would like to use this approach, www.mysite.com/products/345,  which file(programme) would have the control of this request? How could I make this logical link?
      I'm a little bit confused :)

      Thanks in advance,

      --
      Stelios Eliakis
    • Benjamin Carlyle
      Stelios, ... It is up to your server to decide what your URL structure should look like, and which part to interpret as the product id. If the only way you
      Message 2 of 5 , Oct 11, 2006
      • 0 Attachment
        Stelios,

        On Wed, 2006-10-11 at 19:46 +0300, Stelios Eliakis wrote:
        > I would like to ask if I could use this www.mysite.com/products?id=345
        > or this www.mysite.com/products/345
        > in order to take the information of the product with id=345.

        It is up to your server to decide what your URL structure should look
        like, and which part to interpret as the product id. If the only way you
        will get to product 345 is via direct links from other web pages on your
        site and the sites of others, then the second form is fine and preferred
        by many. However, existing HTML forms technology prefers urls to have a
        query part. As such, if you want your user to type "345" into a form and
        get your URL you should use the first url.

        As a guess, I would think that this won't be a constraint for this
        particular case. It would usually only affect the URLs that a search
        form looks up. These are more likely to be something like
        <http://example.com/search?terms=cuddly+bear+toys&maxprice=15>.

        Benjamin
      • Stelios Eliakis
        This is the approach that I am interested in. Benjamin wrote: If the only way you will get to product 345 is via direct links from other web pages on your
        Message 3 of 5 , Oct 12, 2006
        • 0 Attachment
          This is the approach that I am interested in.
          Benjamin wrote:
          "If the only way you
          will get to product 345 is via direct links from other web pages on your
          site and the sites of others, then the second form is fine and preferred
          by many"


          As I mention to my previous mail, I don't know how I can do that.
          If I had for example this request
          http://www.mypage.com/search.jsp?query=java ,
          a jsp page (search.jsp) would handle this request and I would take
          the query parameter (request.getparameter(query)).

          If I had this request: www.mypage.com/search/java how could I handle
          this in order to search for the word:"java"
          Which page would take this request?

          Generally how could I handle logical links?Any reference?



          On 10/12/06, Benjamin Carlyle <benjamincarlyle@...> wrote:
          > Stelios,
          >
          > On Wed, 2006-10-11 at 19:46 +0300, Stelios Eliakis wrote:
          > > I would like to ask if I could use this www.mysite.com/products?id=345
          > > or this www.mysite.com/products/345
          > > in order to take the information of the product with id=345.
          >
          > It is up to your server to decide what your URL structure should look
          > like, and which part to interpret as the product id. If the only way you
          > will get to product 345 is via direct links from other web pages on your
          > site and the sites of others, then the second form is fine and preferred
          > by many. However, existing HTML forms technology prefers urls to have a
          > query part. As such, if you want your user to type "345" into a form and
          > get your URL you should use the first url.
          >
          > As a guess, I would think that this won't be a constraint for this
          > particular case. It would usually only affect the URLs that a search
          > form looks up. These are more likely to be something like
          > <http://example.com/search?terms=cuddly+bear+toys&maxprice=15>.
          >
          > Benjamin
          >
          >


          --
          Stelios Eliakis
        • Hugh Winkler
          ... You re asking a J2EE question, not a REST question. Using J2EE, you would create a servlet, expose it at /search, and in the doGET etc methods, call
          Message 4 of 5 , Oct 12, 2006
          • 0 Attachment
            On 10/12/06, Stelios Eliakis <eliakis@...> wrote:
            This is the approach that I am interested in.
            Benjamin wrote:
            "If the only way you
            will get to product 345 is via direct links from other web pages on your
            site and the sites of others, then the second form is fine and preferred
            by many"


            As I mention to my previous mail, I don't know how I can do that.
            If I had  for example this request
            http://www.mypage.com/search.jsp?query=java ,
            a jsp page (search.jsp)  would handle this request and I would take
            the query parameter (request.getparameter(query)).

            If I had this request: www.mypage.com/search/java how could I handle
            this in order to search for the word:"java"
            Which page would take this request?

            You're  asking a J2EE question, not a REST question.  Using J2EE, you would create a servlet, expose it at /search, and in the doGET etc methods, call request.getPathInfo() to extract the search term "/java". This approach is more appropriate to your "product number" example than it is to a search service.


            Generally how  could I handle logical links?Any reference?



          • Stelios Eliakis
            Yes you are right, it was a J2EE question :) Thanks a lot for your replies. ... -- Stelios Eliakis
            Message 5 of 5 , Oct 12, 2006
            • 0 Attachment
              Yes you are right, it was a J2EE question :)
              Thanks a lot for your replies.


              On 10/12/06, Hugh Winkler <hughw@... > wrote:


              On 10/12/06, Stelios Eliakis <eliakis@...> wrote:
              This is the approach that I am interested in.
              Benjamin wrote:
              "If the only way you
              will get to product 345 is via direct links from other web pages on your
              site and the sites of others, then the second form is fine and preferred
              by many"


              As I mention to my previous mail, I don't know how I can do that.
              If I had  for example this request
              http://www.mypage.com/search.jsp?query=java ,
              a jsp page (search.jsp)  would handle this request and I would take
              the query parameter (request.getparameter(query)).

              If I had this request: www.mypage.com/search/java how could I handle
              this in order to search for the word:"java"
              Which page would take this request?

              You're  asking a J2EE question, not a REST question.  Using J2EE, you would create a servlet, expose it at /search, and in the doGET etc methods, call request.getPathInfo() to extract the search term "/java". This approach is more appropriate to your "product number" example than it is to a search service.


              Generally how  could I handle logical links?Any reference?






              --
              Stelios Eliakis
            Your message has been successfully submitted and would be delivered to recipients shortly.