0

I am currently trying to devlop a single sign-on feature for my company. We have a bunch of applications that each reside within their own application server and/or EAR. We even are going across platforms as not all of the web applications use WebSphere.

Is there a way in Websphere to allow a user to type any address within a context root and, if the page doesn't exist, execute one common page?

For example:

http://myhost/MyApp/login.jsp  

This will exist and going to that address will take you to the login.jsp page

http://myhost/MyApp/foo.jsp     

This will NOT exist, but going to it or any other page that does not exist will go to foobar.jsp. The user should still see

http://myhost/MyApp/foo.jsp

in the URL, but execute the foobar.jsp page.

Does this type of functionality exist and, if so, how can you provide an example?

Brian Tompsett - 汤莱恩
  • 5,195
  • 62
  • 50
  • 120

1 Answers1

1

mod_rewrite is the first thing that comes to mind to have the user see one URL but the server respond with the content of a different one. You'd probably have to list all the valid URLs for your rewrite pattern to ignore.

With just WebSphere, you could use a custom Filter to detect all the known URLs, but I don't know how you'd (easily & efficiently) send the results of a different JSP. I'm pretty sure this is not some built-in, easy capability. How crucial is that part of the behavior? Without it, a Filter plus a Redirect would meet the basic requirement of sending people to a common page when they visit an unknown one.

Another framework that might provide you some useful capabilities is Spring Security.

Finally, consider philosophically whether you really want non-existent URLs respond as if they do exist. That wouldn't be a normal HTTP pattern.

dbreaux
  • 4,709
  • 1
  • 20
  • 56