Re: Bugs, Features, FAQs (1-10) + 3?

There are 3 more new things at the end, so it is not all talk backs. :-}

On Thu, 27 Mar 1997, Anselm Baird_Smith wrote:

> Alexandre Rafalovitch writes:
>  > 1) Once you setup VirtualHost resource, an editor would not let you access
>  > the resources sitting under VirtualHost resource (eg. MirrorDirectory).
>  > Instead it tries to access /Admin/Editor/mirror. This problems rises from

> I can't seem to be able to reproduce that. If you look at the lookup
> method of the VirtualHost resource, you will see that in case it's
> an internal lookup (the one the editor uses), than lookup is
> appropriately handled. I did (right now), setup VirtualHost and
> MirrorDirectory, and I am still able to accesss MirrorDirrectory
> attributes using the std path.

I have this 100% confirmed and I can't see why you can't reproduce it. Did
you set the root to point to vhost? These happens after you set it up (and
restart to get new root into effect?). What I see is that editor
references are skipping vhost part but have everything before and after
me. If you still can't reproduce it, send me private email and I will do
some look see in the bowels of an editor code.

 > 
>  > 2) LookupState.getRemainingPath() would not put / at the end of the
>  > directory. Therefore, if a resource uses getRemainingPath and then uses
>  > that to proxy to the other host, it would get into infinite loop as the
>  > redirection request by server (at least Jigsaw server) would get /
>  > stripped off again, etc. It can be worked around by checking IsDirectory
>  > flag and puting / at the end if it was, but I think this should be done by
>  > Jigsaw itself.
> 
> I guess I see your point. I didn't run into that since
> ForwardDirectory takes the full request URL (without touching it) to
> build the client-side request url. 
> I am still not convinced that having Jigsaw internals add an extra /
> at the end of the last component is a good idea: LookupState is really
> meant to parse the URL, and you shouldn't have to worry about slashes
> when using it (in the sense that / is a syntactic thingy saying
> isDirectory). What I mean is: if LookupState is to releive you from
> syntax, than isDirectory seems to me a better alternative than /.
> [I am not convinced by my own 'not convinced' argument though]

I know how you feel. I have two arguments (not worth having more). First:
getRemainingPath should be usefull even without LookupState around, so it
should not have to rely on LS remembering that it is a directory. (week
argument, I know). Second: Look at lookup() in ServletWrapper. Did you
mean it not to add '/' even if it is a directory? If you will have to
change
the code to make it work there, doesn't it mean that current state is
wrong.

 > 
>  > 3) This is in between a bug and FAQ entry: How can a container restrict
>  > the children it can have. 
> 
> That's a good point. Also you may want some resources to be included
> oinly in some specific kind of containers (ie ServletWrapper and
> ServletDirectory). I guess the only solution I can think of is to have
> registerResource throw an (explicit) BadChildException [this is an
> incompatible API change, btw]
> Should we go for that ? (yes until I hear some complaints - has
> entered the todo)

What about extra method. Isn't Jigsaw doing some heavy stuff _before_ it
calls registerResource. If it is possible to pass a class in and ask if it
is good enough. The problem here might be with subclasses. You either have
to use JDK1.1 feature to check if the class is a subclass of what you want
or to do parent walking (pain). I don't really know if it is possible, but
it is a thought.


> 
>  >  Things that were talked about, but I am not sure what the state on them
>  > is:
>  > 
>  > 5) When I mark my field Mandatory what does it do? Does it get checked
>  > anywhere and enforced? (FAQ?)
> 
> A resource editor is supposed to check that MANDATORY fields are not
> left blanks. I am not sure the current form based editor does ensure
> that constraint, so this can only be used as a hint right now (the
> idea is that if your resource cannot initialize itself if an attribute
> is not present, than that attr should be made MANDATORY).

I think it does it when you edit the resource, but not when you create it.
How hard (sensible) would it be to require entering resource editing
screen stright after resource has been added. Possibly only in Mandatory
cases.

>  > 7) Host names for VirtualHost require port number to be inluded.
>  > (FAQ?)
> 
> Added to the FAQ [oops, no FAQ entry on virtual host] Added to virtual
> host ref manual:
> ---
> Each child of the VirualHostResource must be named under the host name
> it will serve. If you have a machine A with names name.foo.com and
> alias.foo.com, and if the server is running on port 8001, then
> requests prefixed by http://name.foo.com:8001/ will be dispatched to
> the child resource of the virtual host resource named
> name.foo.com:8001 and requests prefixed by http://alias.foo.com:8001
> to child resource alias.foo.com:8001.

What about default port eighty? This is a bit tricky? Some requests might
come through with :80 and some not and it might get through security. Or
you do have a uniform way to deal with it?

>  > 10) I managed to get Jigsaw into state when it would not serve a
>  > particular page under any circumstances and does so not by returning 400,
>  > but by doing something real bad on the connection.
> 
> If ever you get that kind of situation, make your best to send me a
> thread dump. I ahven't seen that kind of problems, but I must admit
> that I haven't kept Jigsaw running on Win95 for long (I work under
> solaris and winNT mainly)
> 

I think I might have nailed it. HTTP resource delete method has a cast of
a parent into DirectoryResource. In my case it is not a subclass of
DirectoryResource, but of one above (ContainerSomething). When I do
delete on the resource, I evidently produce classCast exception that would
propogate all the way up. Once that is done, the rest of Jigsaw might
become unstable. Could that be it? I changed my resource code not to
call super in delete but do what HTTPResource _and_ its parent do and 
that stoped No_Document error for that instance. But this is a hack.
:-} Also, in general sense, what about a grep for DirectoryResource and
see if it is showing up in wrong places? ;-}

Other things (one above + 2 below = 3):

11) Create a PassDirectory, make target as a relative name. It would show
up as relative to current working directory of Jigsaw even though it
really would be relative to Jigsaw root. The reason is that PassDirectory
catches resource changing and makes it absolute, but FileField never
catches that and keeps the old relative path name. Also, editor does not
seem to notice that the resource got updated by internal means, during
setting of a value and just returns old content. (I am not sure about this
one)

12) TextField has an annoying habbit of accepting text in double quotes,
but not displaying it back. Reason is simple, during dump it just puts the
string value without doing escaping of special characters and browsers
think the value has finished as soon as first " is hit. I don't know how
much escaping should be done, but at least double quotes is important.

All for now,
    more later..... :-}
  Alex.
Ps. How does Jigsaw survive class cast errors in first place? Kills a
thread?

Received on Monday, 31 March 1997 08:27:52 UTC