>
> Where does the server side classes called from JSP pages run from on the
> server?
>
Depends on the server, but JRUN runs from the jsm-default directory (ie.
wherever you were when you ran startjsm.sh). Two ways I've used to make file
I/O server independant:
1.
- build a file path using application.getRealPath(href) where href is
something like "/index.html"
or
- File here = new File(application.getRealPathrequest.getServletPath()))
gives me the filepath of the invoked servlet, from which a getParent() gives
me the directory
2.
- create a session bean class User (for example) with a setUser method you
initialize using getRemoteUser()
- implement getUserFile(name) and putUserFile(name) in the bean, so that
they create files in user-named subdirectories of some well-known location
(I set the directory using a Property)
- write getUserFile.jsp to take request parameter "file" and invoke
user.getUserFile(file) -- this lets client-side software get access to user
files as well, works fine with XML, jpg, html, etc.
NOTE: Method two prevents users from seeing each others' files, which method
1 may not...
_3
M
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets