uoxton wrote:
> [...]
> I did scrutinize my code further, and it seems that the problem comes
> using the bean from within an include action (why is it that a bean
> isn't made available inside an include even though it's set on the page
> that calls the latter?)... when I try calling the bean from non-include
> page it works fine. is this possible? I'm going to try with an include
> directive instead, and see what happens.

If you set the scope to "session" or "request", you should be able to
access the bean even in a page included by the include action. Which
container are you using? If it's not the latest version, try upgrading
and see if that helps. Sounds like a container bug to me.

> [...]
> not to abuse of your good will, but may I add my earlier posts'
> questions here? (I haven't found a solution for them yet)
>
> - if I have a FileInputStream called from within a bean, where does it
> look for the file? I tried having the target file put in several
> different directories (in the same one as the bean class, /WEB-
> INF/classes/, /WEB-INF/lib/, /WEB-INF/, the root weapp directory...) and
> it just doesn't find it. i triple checked the file name and even tried
> different files

You must use an absolute path to the file if you use the regular File,
and related, classes. I recommend that you use ServletContext.getResource()
or getResourceAsStream() instead. Both methods works with a context-
relative path, so to get a file in WEB-INF, you use a path like
"/WEB-INF/foo.txt". Note the starting slash! The getResourceXXX() methods
also have the advantage that they work even if the application is
served directly from a WAR file, i.e. not unpacked in a file system.

> - I have to restart tomcat (vs 4) everytime I do an update to a custom
> action, for the changes to take effect. is this normal? I figured this
> couldn't be, since it would make tomcat completely unviable for real
> production purposes... but then again that has been said of it, so is
> this one of the causes for this view?

AFAIK, Tomcat 4 should be able to automatically reload changed classes
if they are located in WEB-INF/classes or in a JAR file in WEB-INF/lib,
assuming that the application is configured to do automatic reloading,
i.e. has "reloadable=true" in the server.xml file. I believe default is
false, so you probably have to define the application explicitly in
server.xml, not just drop it in the webapps directory. See the Tomcat 4
dos for details. Also make sure that the WEB-INF directories are not
part of the CLASSPATH for the account that starts Tomcat! The Tomcat
start scripts adds them automatically, and having them in the CLASSPATH
as well may cause problems with auto-reload.

> thank you very much for your book, btw. it's been an incredible help in
> my quest to learn j2ee. it makes it seem a lot less scary now... but i
> do know I have a loooong way to go.

I'm glad you like the book. Good luck with your project.

Hans
--
Hans Bergsten           [EMAIL PROTECTED]
Gefion Software         http://www.gefionsoftware.com
Author of JavaServer Pages (O'Reilly), http://TheJSPBook.com

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

Reply via email to