Hi Antonio
it took me a while to turn the ideas to a real - that's why i answer so late
If you *really* need to generate the files statically,
yes i think i need to .. see below
- You can simply use the session ID as identifier, you do not need the user name.
i do use session id as the identifier but i had to extend it with instance identifier ... see below
- You should take care of cleanup on session expiry/invalidation. Think "Listener" for that.
i call him "static Thread victor_the_cleaner;" :) it's not fully implemented yet it's gonna be my favourite part of code :)
- You can store the file creation time in your HttpSession so you need not use a database for such a temporary purpose.
But...
- Is the file so "difficult" to create that you can't build it every time? IMHO, that would save you trouble.
yes it is quite difficult - i gotta run a recursive select, store the resulst as javascript code and do some statistics about it, so finally it takes sa while to get the page in a browser
- If it is, that's many times because of a too hard query to a database, or too many small queries. Can't you optimize that big query, or reduce the amount of them? Query optimization can lead you to really improved times. If you go this path, please let me know.
I decided to make a compromise: I've got a few small selects called only
a couple of times. the rest of selects is rather long but as plain as
possible (max 1 nesting). Whereby i try to store a racional amount of info from these queries in servlet variables which are stored in ArrayLists:
1. a list of all single users logged in the webapp, which contains request and response variables (i.e. session identification) and
2. a sublist of instancies (i.e opened windows) of the single user
which contains for example connect_string to a dbase
If it's faster, I keep user specific data in files so the matrix is represented by directory structure:
<path>/<username>/<session_id>/<instance_id>/file.extention
where i had to extend the identification by session_id with instance_id
because if user opens another browser window then the session_id remains
the same so the connect strings would be overwritten if user decides to connect to another dbase server
Or...
- You could use a generic caching system. Some time ago, I came across http://www.opensymphony.com/oscache/ but I have not tried it yet. I do not know if it would match your needs.
i didn't really check it. it didn't atracted me enough somehow
thx again
EOF
Bost
Yours,
Antonio Fiol
Rostislav Svoboda wrote:
> Hi pple
>
> I make an information system: dbase(data) + tomcat(processing in > servlets) + browser(html GUI) = The COOL
>
> I use <iframe src="path/udp.html"> where "udp.html" is dynamicaly > generated in a servlet and depends on an user logged in. (it displays > navigation tree)
>
> It seems like I need to have a matrix of:
> udp.user_1.session_id_1.html ... udp.user_1.session_id_N.html
> ...
> udp.user_M.session_id_1.html ... udp.user_M.session_id_N.html
>
> and I must check the time-of-change of certain tables in dbase against > session-create-time under tomcat and regenerate the content of > "udp.user_I.session_id_I.html" if outdated.
>
> - principialy I doubt this is the right approach to display such kind > of a page but I dunno any other :( Any ideas?
> - the technical problem: I dunno how to setup/configure my tomcat to > display
> requested "udp.user_I.session_id_I.html". If I create a file in a > servlet on a HDD (even properly located) I get an error message in the > iframe:
>
> HTTP Status 404 - /webapp/tree/index.ADMIN.html
> The requested resource (/webapp/tree/index.ADMIN.html) is not > available.
>
>
> EOF & thx in advance
>
> Bost
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
