Re: Allowing users of web app to upload files

2004-09-21 Thread Kevin D. Offet
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Justin Jaynes wrote:
| Well,
|
| As Yaov said this list was ok for JSP development,
| here I go.
|
| I am having a great time using Tomcat on SuSE 9.1 with
| SSL and all is working fine.
|
| I would like users of my web applications to be able
| to upload image files to directories that Tomcat is
| serving files out of.  This must happen THROUGH the
| web application.
|
| Therefore I have two questions:
|
| 1.  How would I get a file off a remote users hard
| drive (which they specify by typing the file name and
| location into a text box in a form) to move to my
| server and be renamed (using my own file naming
| convention)?
|
| 2.  How do you open a Browse File dialog box in a web
| browser (I would guess this would be easily done using
| Java Script.  may not be an appropriate question here,
| so only answer if you happen to have the answer on
| hand)  If possible, pointing me to a location on the
| web where this is done and the script is readily
| apparent, would be a fine answer.
|
|
what you are asking is not jsp specific.
all you need is the html element
INPUT TYPE=file ...
set within a html form.
then you need to process the form accordingly when it is submitted.
you might want to check out jakarta commons's FileUpload utilities to
help with the processing.
Kevin
|
|
|   
| __
| Do you Yahoo!?
| New and Improved Yahoo! Mail - Send 10MB messages!
| http://promotions.yahoo.com/new_mail
|
| -
| To unsubscribe, e-mail: [EMAIL PROTECTED]
| For additional commands, e-mail: [EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFBUMvrJ7Xd6MyEGu4RAkH4AKDWmr1ynQ3i0DR+/HiPbT2ifQNwUACfaJKP
9rmInme5NXvJuYolQ4rXIqo=
=JY3a
-END PGP SIGNATURE-
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Tomcat reboot runtime

2004-05-15 Thread Kevin D. Offet
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
a daemon thread is just an ordinary thread that has been set as a
daemon. their purpose is to be servant threads. when there are only
daemon threads left a program will exit.
as such, it executes in the same jvm instance as it's parent.
parent spawns daemon,
daemon spawns shell,
shell runs command to kill parent
which kills daemon
which kills shell which kills command.
just a big circle.
i don't know about other OS, but the process control features of the
bash shell on linux would allow what i think you are trying to achieve.
don't worry about needing a thread. just try something like
String command = /where/your/script/lives/scriptname restart disown;
getRuntime().exec(command);
regards,
Kevin
QM wrote:
| It just hit me --
| what about a (protected) servlet that spawns a daemon thread, which in
| turn calls Runtime.exec( tomcat stop / start script)?
|
| Admittedly, I'm hazy on my Java threading right now, but if that would
| work then it's something that's completley within the container, and no
| more than a few lines of code.
|
| -or am I off my rocker? ;)
|
| -QM
|
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFApmyuJ7Xd6MyEGu4RAkNEAJ4qwRZp5bln3yilMmONhN9BHlEp4ACfdc8Y
lgmuKMq/TdyWn4ECzYNP1iM=
=/mzN
-END PGP SIGNATURE-
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]