You are viewing a plain text version of this content. The canonical link for it is here.
Posted to websh-user@tcl.apache.org by Lost One <th...@yahoo.com> on 2009/10/24 19:26:58 UTC

Question about interpreters

Hi

Ok I finally compiled everything, I reinstalled Tcl so that .tcl was put in the extension path.
Then I started experimenting with Websh again, I'm sorry if my questions seem to be kinda stupid but the last time I ignored interpreters I got stuck.

I have the following problem(s)
When I try to visualize the configuration.html document it doesn't display full. I tried to change the code in htmlhandler.ws3 to this

 web::initializer {
       web::config putxmarkup tag
}

restart the server but it ends up only working for only ONE time, then no more. Apache seems to constantly crash and get back up on it's own. I remember having the same problems with the older versions too.
If i change the following:

web::interpclasscfg "$webshroot/conf/htmlhandler.ws3" maxrequests 1

or to another number then my  Vista keeps asking me either to close apache or to "find a solution" for the program, Apache starts automatically up so it's kinda annoying.. 

I don't know what the heck is wrong, or how to use the interpreters or why they're needed, where they're needed .. how to combine them cause it seems not to display my pages correctly. I read the quick reference before but it took me lots of hours to figure out some things. Could it be because I'm on vista? Even sessions seemed to work weird, and without a proper interpreter I felt lost so I stopped using Websh.

Regards,
Andrei



      

Re: Question about interpreters

Posted by Ronnie Brunner <ro...@netcetera.ch>.
> I have the following problem(s)

[...]

> I don't know what the heck is wrong, or how to use the interpreters
> or why they're needed, where they're needed .. how to combine them
> cause it seems not to display my pages correctly. I read the quick
> reference before but it took me lots of hours to figure out some
> things. Could it be because I'm on vista? Even sessions seemed to
> work weird, and without a proper interpreter I felt lost so I
> stopped using Websh.

I don't see anything that's obviously wrong in your code. (Well, there
isn't much code ;-)

Does the sample installation w/o changing anything (except maybe
settning webshroot correctly in websh.conf) work? What is the
output of using the sample as-is? Any logs in the Apache error log?

The poin twith the interpreters is: with 

proc web::interpmap {file} {
     # return interp class for request to file
     return $file
}

you define which interpreter(s) handle which requests. The sample uses
2 defined interpreter classes (i.e. interpreterr that run the same
code for same set of requests) and all *.ws3 requests are handled by
their own class):

  otherhandler.ws3: running requests to any file called other.html

  htmlhandler.ws3: running requests to any *.html file (except the above)

  *.ws3: each *.ws3 has it's own interpreter, which just runs the file itself

So the interpreter thing lets you decide which requests should be
handled by which code.

proc web::interpmap {file} {
     return myCode.tcl
}

Would instead run every request through the same code no matter which
request is sent to mod_websh from the server (configured with the
AddHandler directive...)

hth
Ronnie
-- 
Ronnie Brunner | ronnie.brunner@netcetera.ch
phone +41-44-247 79 79 | fax +41-44-247 70 75
Netcetera AG | 8040 Zürich | Switzerland | http://netcetera.ch

---------------------------------------------------------------------
To unsubscribe, e-mail: websh-user-unsubscribe@tcl.apache.org
For additional commands, e-mail: websh-user-help@tcl.apache.org