WebSphere Application Server & Liberty

WebSphere Application Server & Liberty

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
  • 1.  Escape special character in Application URL

    Posted Wed May 18, 2022 01:51 PM

    Hello There,

    I'm trying to access my spring MVC application using this URL - servername:portname/userportal/login.
    But there is requirement to use older URL as  - servername:portname/"application Context name"/login.jsp. However, it seems that if i try to use this URL my application doesn't allow it.

    Is there any way to configure this on WAS console so that when ever user enters URL as - servername:portname/userportal/login.jsp, it should change URL or redirect it to servername:portname/userportal/login.

    Any solution/leads would be highly appreciated. 



    ------------------------------
    Sumit Tiwari
    ------------------------------


  • 2.  RE: Escape special character in Application URL

    Posted Thu May 19, 2022 01:36 AM
    hi, this should be done at the web server level, not the WAS level.  If you want to do something at the WAS level then you will need a servlet/jsp called login.jsp that redirects to login.

    Brian

    ------------------------------
    Brian S Paskin
    Sr. Cloud Engineer
    IBM Cloud Engineering
    ------------------------------



  • 3.  RE: Escape special character in Application URL

    Posted Thu May 19, 2022 10:31 AM
    If, for some reason, you do not want to do this in your reverse proxy as Brian suggested, you can also achieve the same thing via Servlets.
    There's a tutorial for this right here: Servlet Redirect vs Forward | Baeldung

    If you happen to have a lot of those redirects or need a broader syntax, you can also use the urlrewrite dependency (a servlet filter) which accepts Apache httpd / IHS (IBM httpd server) syntax.

    Let us know if either of those solutions where helpful!

    ------------------------------
    Benjamin Marwell
    System Engineer
    Finanz Informatik
    Hanover
    ------------------------------