CrazyEngineers
  • URL Rewriting In JSP & Advantages

    greatcoder

    Member

    Updated: Oct 26, 2024
    Views: 982
    Hello Experts,

    I have heard a lot about URL rewriting. Can u plz tell me
    1) How to implement URL rewriting in JSP
    2)WHat are the advantages of URL rewriting?

    Regards
    GC
    0
    Replies
Howdy guest!
Dear guest, you must be logged-in to participate on CrazyEngineers. We would love to have you as a member of our community. Consider creating an account or login.
Replies
  • Ankita Katdare

    AdministratorApr 2, 2012

    #-Link-Snipped-# Good question indeed. I have no knowledge about the implementation part. However, I too have read quite a bit about it.

    URL rewriting can be termed as a way of supporting 'anonymous session tracking'.
    Meaning to say, the local URLs can be loaded with additional information by modifying/rewriting them. This extra information is usually limited to a unique session ID. I think it must be a tiresome task to rewrite the URLs.

    The real benefit, as they say, is "search engine optimization" or SEO for budding OR NEW websites. Substantially old websites do not want to indulge in this, because that might not reflect very well in their search engine rankings, because the spiders will have to be made known about your new page locations.

    Hence, URL rewriting will work only for the websites whose pages are not already listed on Google, Yahoo and the likes.
    Are you sure? This action cannot be undone.
    Cancel
  • PraveenKumar Purushothaman

    MemberApr 6, 2012

    IDs and Anonymous Session Tracking? New to that here... 😛

    Anyways, the main use is like what you said is SEO. Another thing is, it is better to remember URLs like facebook.com/crazyengineers other than having facebook.com/?page_id=10000000456788 right? That's another main use... 😀
    Are you sure? This action cannot be undone.
    Cancel
  • Sahithi Pallavi

    MemberApr 6, 2012

    Good question and good answers.

    So what facebook,twitter profile page URLs' uses is URL rewriting, right?

    Now I want to know about implementation part. Anyone here can hint about it?
    Are you sure? This action cannot be undone.
    Cancel
  • PraveenKumar Purushothaman

    MemberApr 6, 2012

    Sada
    Good question and good answers.

    So what facebook,twitter profile page URLs' uses is URL rewriting, right?

    Now I want to know about implementation part. Anyone here can hint about it?
    Why are you going to that extent? Simple! Even our CrazyEngineers Forum uses URL Rewriting. There is no URL like #-Link-Snipped-#, but actually the URL is #-Link-Snipped-# (or something similar, purposely didn't reveal the original one). It can be done only by the server.

    In CE's case, it is the Apache Server and it uses mod_rewrite.
    In Windows, it would be IIS 7 or later, with the URL Rewrite Module installed.
    In case of JSP, it is web.xml, where you give the routes.
    In case of Rails, it is Rake Routes... 😁
    Are you sure? This action cannot be undone.
    Cancel
  • sookie

    MemberApr 9, 2012

    You can use "response.encodeURL(String url)" in JSP to apply URL rewriting.

    And regarding more info about "URL rewriting" read this article #-Link-Snipped-# . Good one!
    Are you sure? This action cannot be undone.
    Cancel
  • PraveenKumar Purushothaman

    MemberApr 9, 2012

    sookie
    You can use "response.encodeURL(String url)" in JSP to apply URL rewriting.

    And regarding more info about "URL rewriting" read this article #-Link-Snipped-# . Good one!
    Buddy, response.encodeURL has lots of bugs, and it won't work if output has been buffered... 😔
    Are you sure? This action cannot be undone.
    Cancel
  • ysr shk

    MemberApr 23, 2012

    URL rewriting is sometimes used to hide the attribute values to be displayed in the address bar.
    Suppose I have 2 attributes,which I am sending from a html page.
    then after that page name that are added,if I had been use method GET.
    like, xyz.com/abc.html?fist_attribute=something&second_attribute=something.

    Sometimes in JSP it is not supported to use POST method so we has to use GET.
    And it is not secure that your user name or password to be displayed in URL,it's break the privacy of that user.
    So we have to encode that URL by rewriting it.

    You can use the method as told by #-Link-Snipped-#

    URL rewriting is same as DNS concept.
    In DNS,we automatically replace the Name to corresponding IP or vice-versa.
    Are you sure? This action cannot be undone.
    Cancel
Home Channels Search Login Register