Servlet Configuration

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Servlet Configuration

Ian Upright-2

Lets say I have a number of paths defined in my VisualWave configuration, and certain servlets are specified.  Now, for all other cases, I want to specify a default servlet to use.. 

Mainly I want this to trap errors, such as trying to access paths or parts of the site that are non-existant, etc.,but I don’t want to do this by trapping the errors, in the web configuration.

I want my own code to determine how to gracefully handle the errors.

 

How do I achieve this?


Thanks, Ian

 

Reply | Threaded
Open this post in threaded view
|

RE: Servlet Configuration

Boris Popov, DeepCove Labs (SNN)
Have you tried setting a 'home' in your site.ini file?

-Boris

--
+1.604.689.0322
DeepCove Labs Ltd.
4th floor 595 Howe Street
Vancouver, Canada V6C 2T5

[hidden email]

CONFIDENTIALITY NOTICE

This email is intended only for the persons named in the message
header. Unless otherwise indicated, it contains information that is
private and confidential. If you have received it in error, please
notify the sender and delete the entire message including any
attachments.

Thank you.

-----Original Message-----
From: Ian Upright [mailto:[hidden email]]
Sent: Wednesday, May 03, 2006 12:30 PM
To: [hidden email]
Subject: Servlet Configuration

Lets say I have a number of paths defined in my VisualWave configuration,
and certain servlets are specified.  Now, for all other cases, I want to
specify a default servlet to use..  

Mainly I want this to trap errors, such as trying to access paths or parts
of the site that are non-existant, etc.,but I don't want to do this by
trapping the errors, in the web configuration.

I want my own code to determine how to gracefully handle the errors.

 

How do I achieve this?


Thanks, Ian

 


smime.p7s (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

RE: Servlet Configuration

Boris Popov, DeepCove Labs (SNN)
In reply to this post by Ian Upright-2
From the WebAppDevGuide.pdf,

Site-Specific Configuration Files

The following sections are defined for the site-specific INI files:

[configuration]

...
home = specify a file name for the home page
...

Hope this helps,

-Boris

--
+1.604.689.0322
DeepCove Labs Ltd.
4th floor 595 Howe Street
Vancouver, Canada V6C 2T5

[hidden email]

CONFIDENTIALITY NOTICE

This email is intended only for the persons named in the message
header. Unless otherwise indicated, it contains information that is
private and confidential. If you have received it in error, please
notify the sender and delete the entire message including any
attachments.

Thank you.

-----Original Message-----
From: Boris Popov
Sent: Wednesday, May 03, 2006 1:43 PM
To: 'Ian Upright'
Subject: RE: Servlet Configuration

Not as a 'home' site, but a 'home' option within the site. You have your
web.ini that lists various sites via,

[sites]

wite = site.ini

Then within site.ini you can specify a default 'home' destination. Not sure
it'll do the trick, but worth a shot.

Cheers!

-Boris

--
+1.604.689.0322
DeepCove Labs Ltd.
4th floor 595 Howe Street
Vancouver, Canada V6C 2T5

[hidden email]

CONFIDENTIALITY NOTICE

This email is intended only for the persons named in the message
header. Unless otherwise indicated, it contains information that is
private and confidential. If you have received it in error, please
notify the sender and delete the entire message including any
attachments.

Thank you.

-----Original Message-----
From: Ian Upright [mailto:[hidden email]]
Sent: Wednesday, May 03, 2006 1:35 PM
To: Boris Popov
Subject: RE: Servlet Configuration

So even if I did..  such as:

[sites]

        home = home-site.ini

Where does that get me?

Then in [logical-names] of home-site.ini, what would I put?

Ian

-----Original Message-----
From: Boris Popov [mailto:[hidden email]]
Sent: Wednesday, May 03, 2006 1:18 PM
To: Ian Upright; [hidden email]
Subject: RE: Servlet Configuration

Have you tried setting a 'home' in your site.ini file?

-Boris



smime.p7s (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Servlet Configuration

Alan Knight-2
In reply to this post by Ian Upright-2
The general facility to do this doesn't exist, although adding it has been on the task list for a while.

Boris suggests setting the home, but that only affects requests to the main page, not requests for non-existent files.

As it stands now, those are trapped in three places.
  - If the request looks like a server page (i.e. ends in .ssp, .jsp, or .asp) then it will be trapped in ASPHandler>>fileError:
  - If the requests looks like a servlet (i.e. the path is of form .../servlet/ClassName/...) then it will be trapped in ServletHandler>>newServlet, which normally will have the request served by MissingServlet.
  - If it looks like neither, it will be handled by WebSiteFile, which if it can't find the file will call notFoundAnswerFor:

So at the moment what you'd have to do is intercept those places by either modifying the code or subclassing and have it call your application.

At 03:30 PM 03/05/2006, Ian Upright wrote:
Lets say I have a number of paths defined in my VisualWave configuration, and certain servlets are specified.  Now, for all other cases, I want to specify a default servlet to use.. 
Mainly I want this to trap errors, such as trying to access paths or parts of the site that are non-existant, etc.,but I don’t want to do this by trapping the errors, in the web configuration.
I want my own code to determine how to gracefully handle the errors.
 
How do I achieve this?

Thanks, Ian
 

--
Alan Knight [|], Cincom Smalltalk Development

"The Static Typing Philosophy: Make it fast. Make it right. Make it run." - Niall Ross
Reply | Threaded
Open this post in threaded view
|

RE: Servlet Configuration

Ian Upright-2

Thanks Alan.  I looked into it briefly, but it looked like I might have to subclass umpteen dozen classes, just to get away from having to introduce overrides into the equation.  I thought I must be misunderstanding something obvious, thus I’m still seeking advice.  Perhaps the easiest would be to create some subclasses, and have a minimal number of overrides.  It does seem like a bit of an ugly mess to fix properly.  I believe I need to fix all three cases you’ve listed below.

 

Thanks, Ian

 


From: Alan Knight [mailto:[hidden email]]
Sent: Thursday, May 04, 2006 11:54 AM
To: Ian Upright; [hidden email]
Subject: Re: Servlet Configuration

 

The general facility to do this doesn't exist, although adding it has been on the task list for a while.

Boris suggests setting the home, but that only affects requests to the main page, not requests for non-existent files.

As it stands now, those are trapped in three places.
  - If the request looks like a server page (i.e. ends in .ssp, .jsp, or .asp) then it will be trapped in ASPHandler>>fileError:
  - If the requests looks like a servlet (i.e. the path is of form .../servlet/ClassName/...) then it will be trapped in ServletHandler>>newServlet, which normally will have the request served by MissingServlet.
  - If it looks like neither, it will be handled by WebSiteFile, which if it can't find the file will call notFoundAnswerFor:

So at the moment what you'd have to do is intercept those places by either modifying the code or subclassing and have it call your application.

At 03:30 PM 03/05/2006, Ian Upright wrote:

Lets say I have a number of paths defined in my VisualWave configuration, and certain servlets are specified.  Now, for all other cases, I want to specify a default servlet to use.. 
Mainly I want this to trap errors, such as trying to access paths or parts of the site that are non-existant, etc.,but I dont want to do this by trapping the errors, in the web configuration.
I want my own code to determine how to gracefully handle the errors.
 
How do I achieve this?

Thanks, Ian
 


--
Alan Knight [|], Cincom Smalltalk Development

"The Static Typing Philosophy: Make it fast. Make it right. Make it run." - Niall Ross