• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 498
  • Last Modified:

Web Server Strategy (Sun One WebServer)

Hi,

I currently have a problem that I need all of yours' opinions to solve.

We have a website that has a lot of services that are implemented using BEA WebLogic with combination of ColdFusion and other technologies. On top of that, we have Sun One WebServer playing the role as the webserver to manage the traffic to both BEA as well as ColdFusion server from the public.

Now, i have a requirement to implement a program in the webserver to check whether the BEA or CF pages that public requested are available or not upon clicking on the URL. If yes, proceed with the URL, if not, show some generic error message. Is there any mechanism in webserver (maybe not Sun One WebServer) to trigger Servlet execution if any of the URL is executed by public?

If you have a similar suggestion for non-J2EE, I am also okay. At this point, i just want to get more inputs for this :).

Thanks
David
0
suprapto45
Asked:
suprapto45
  • 7
  • 4
  • 4
3 Solutions
 
objectsCommented:
can you setup a custom 404 page to handle when its not there?

0
 
suprapto45Author Commented:
Hi objects,

Thanks. Unfortunately, no.

I am in charge of some BEA WebLogic apps so let me explain it in the BEA context. When Sun One redirect to the JSP pages that are not available in BEA, BEA will report 404. However, Sun One will think that the redirection is successful and will not be able to get this 404 error. But you are right, there is a 404 catch in Sun One.

If I want to do this in BEA apps, it is also tricky. We have like 40-50 small to medium projects deployed to WebLogic and to tackle 404, AFAIK, we have to implement this in every single apps. Am I right?

Thanks.
David
0
 
objectsCommented:
> Am I right?

not sure (we don't use BEA). If all the apps are running in the one BEA instance then you might be able to set a global 404, no idea how or if its possible.

Other than that I don't see any options that avoid Sun1 making an extra request to BEA to see if its available or not.

0
Easily Design & Build Your Next Website

Squarespace’s all-in-one platform gives you everything you need to express yourself creatively online, whether it is with a domain, website, or online store. Get started with your free trial today, and when ready, take 10% off your first purchase with offer code 'EXPERTS'.

 
suprapto45Author Commented:
Hi objects,

Thanks. I will keep this thread open for a while to see if anybody else has other opinions. In the meantime, I am also googling.

Thanks again.
David
0
 
ChristoferDutzCommented:
Well how about implementing some sort of proxy component on the Sun One server. When clicking a link (you could prefix all links that should be checked with "/check"). the Sun One then uses the Apache HTTPClient to check if the resource (without the "/check") is available and if it is, it sends back a html page with a META refresh redirect to the url without the "/check" prefix. The browser then loads the page directly. If a page is not available, you send an error page.

I know this is a sort of hacky approach, but I think I got from your post, that you have a lot of applications running and you want to add this feature for one special application. Am I correct?
0
 
suprapto45Author Commented:
Hi ChristoferDutz,

Thanks.

>>"Am I correct?"
Unfortunately no, i need to apply this to all applications. But I am open to any suggestions. So, if using your approach, i have to change all my URLs to append it with /check in order for them to be checked. Am I right?

Thanks
David
0
 
ChristoferDutzCommented:
Or you do it the other way around ... redirect all "/checked" and check only URLs with no "/checked" prefix. But I'd really suggest not doing this, because It would really stress your Sun One server with tons of requests it has to check.
0
 
suprapto45Author Commented:
>>"Or you do it the other way around ... redirect all "/checked" and check only URLs with no "/checked" prefix"
Hey, interesting point! I will explore that further.

Thanks
David
0
 
suprapto45Author Commented:
Hi ChristoferDutz,

By the way, what is the approach that you propose for checking the URL using HttpClient? Using Servlet's Filter or any other thing that you have in mind in Sun One?

Thanks
David
0
 
objectsCommented:
its still going to involve two requests as I mentioned earlier.

0
 
ChristoferDutzCommented:
HttpClient is a JavaBased HTTP client from Apache. But I would really suggest not to do this check, if ALL requests have to got through this mechanism. You would really get into performance problems and you would have to refactor your code if you also want to extend this mechanism for resources (Which would be really bad).

You would start double stressing the backend servers.

But I have to admit, that it's sort of strange, that the Sun One doesn't proxy the error pages as error pages. Usually they are served with the response code in hte header and there is no reason for the Sun One to forward a 404 as 200. Are you sure you have configured the redirection correctly?
0
 
ChristoferDutzCommented:
Ok ... I read your post once again ... your company wants to have unified error pages?
No matter whar resource is requested, no application specific error page is sent, this is replaced by the universal error page, preventing exposure of application details? Or am I on the wrong track here?
0
 
suprapto45Author Commented:
Thanks.

objects >> i agree with you on that.

ChristoferDutz >> Yes you are right. The error page will be unified and there will be no application-specific error page.

>>"But I have to admit, that it's sort of strange, that the Sun One doesn.....redirection correctly?"
Me too. I am still googling out as I believe that this is the problem in the WebLogic plugin. As I have informed objects before, when BEA reported 404, Sun one was not be able to catch this 404 and I find this is very strange. Additionally, when I check the access.log and it showed that the HTTP status is correct i.e. 404 instead of 200 but Sun One simply could not get it. Anyway, if the 404 occurred at Sun One side (JSP resides at Sun One) not BEA WebLogic, the error redirection works fine.

For now, I think that if I can catch the 404 in BEA WebLogic from Sun One, this will be solved. I am still trying and let you all know if i find the solution.

Thanks
David
0
 
objectsCommented:
if its a redirect then its the browser sending the request to WL, not Sun One
0
 
suprapto45Author Commented:
Ok, found the solution.

http://forums.sun.com/thread.jspa?threadID=5381736&start=0&tstart=0

After that, my SunOne is able to get the 404 from WebLogic. I am going to split the points anyway as both of your views are very helpful.

Thanks again.
David
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to Squarespace.com and use offer code ‘EXPERTS’ to get 10% off your first purchase.

  • 7
  • 4
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now