Re: communicating between 2 diffrent sessions
Hi, Is this right? In Java API, I found some useful information. There is one context per web application per Java Virtual Machine. (A web application is a collection of servlets and content installed under a specific subset of the server's URL namespace such as /catalog and possibly installed via a .war file.) I also test it with Tomcat 3.2.3.I create two webapps.one is 'test1',the other is 'test2'.In test1, there is a javabean with scope=application.All jsps in test1 can get the value of the javabean.But got nothing in test2. If I am wrong, please info me. %@ page contentType=text/html; charset=GBK % html head META HTTP-EQUIV=Pragma CONTENT=no-cache META HTTP-EQUIV=Cache-Control CONTENT=no-cache META HTTP-EQUIV=Expires CONTENT=0 title Jsp1 /title /head jsp:useBean id=Jsp1BeanId scope=application class=eim_domainadmin.Jsp1Bean / jsp:setProperty name=Jsp1BeanId property=* / body h1 JBuilder Generated JSP /h1 form method=post brEnter new value : input name=samplebr brbr input type=submit name=Submit value=Submit input type=reset value=Reset br Value of Bean property is :jsp:getProperty name=Jsp1BeanId property=sample / /form /body /html Regards Gang Liu - Original Message - From: Christof Soehngen [EMAIL PROTECTED] To: catalin [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, September 27, 2001 4:29 PM Subject: Re: communicating between 2 diffrent sessions The context is a container like a session, only that it's valid for the lifetime of the tomcat process and is accessible by all webpages. In JSP you refer to it as the application You could say in your Servlet: - public class TestServlet extends HttpServlet { ServletContext context = null; public void init (ServletConfig config) { context = config.getServletContext(); } public void doPost (HttpServletRequest request, HttpServletResponse response) { String parameter = (String) context.getAttribute(parameter_name); if (parameter==null) { parameter = Some standard value for the parameter context.setAttribute(parameter_name, parameter); } } } - Now, in your JSP, you should be able to access the parameter as a bean with scope = application Hope there are no typos, and it helps, this could be one way to solve your problem. Christof - Original Message - From: catalin [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, September 27, 2001 9:01 AM Subject: communicating between 2 diffrent sessions Hello, I have 2 apps (one in /webapps/myapp1-with jsp and other webapps/root/myapp2-with servlets) on a jakarta-tomcat-3.3-m4 on a win98 OS. My problem is that I need parameters that are in session of myapp2 to transmmit in session of myapp1. Can I do that? It is possible to set the same session for both apps? Thanks! -- Best regards, catalin mailto:[EMAIL PROTECTED]
UNSUSCRIBE
UNSUSCRIBE - Original Message - From: Huaxin [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, September 29, 2001 11:10 PM Subject: servlet to jsp how can i create a bean in a servlet, and then the serlet forward/include to a jsp, the jsp can read from the bean? thanks a lot
Re: Probable FAQ entry: Is Tomcat4+mod_webapp+Apache-1.3.xx ready for prime time?
Hello, Rodrigo, Does that mean that also the static pages (like for instance /examples/servlets/index.html) are served correctly by Apache? If so, are you sure that you don't see pages that are cached. So far, I only get the examples themselves working correctly, but not the static pages. (Tested with Apache 1.3.11 both on Linux and SGI Irix). Rob Rodrigo Reis wrote: Hello William, If your platform is Linux you can find a binary of mod_webapp in this URL: http://www.apache.org/dist/jakarta/jakarta-tomcat-4.0/release/v4.0/bin/ I'm using it and it seems OK. -- _ Rob W. van Swol National Aerospace Laboratory NLR Tel. +31 527 248252 P.O. Box 153Fax +31 527 248210 8300 AD Emmeloord E-Mail [EMAIL PROTECTED] The Netherlands http://www.neonet.nl/
Shutdown problems.
Hello. I am using Linux/Red Hat 7.1, jdk1.3.1, and Tomcat 4.0 How do I resolve the following error: [root@64-59-143-179 bin]# ./shutdown.sh Guessing CATALINA_HOME from catalina.sh to ./.. Setting CATALINA_HOME to ./.. Using CLASSPATH: ./../bin/bootstrap.jar:/usr/java/jdk1.3.1/lib/tools.jar Using CATALINA_BASE: ./.. Using CATALINA_HOME: ./.. Using JAVA_HOME: /usr/java/jdk1.3.1 Catalina.stop: java.net.ConnectException: Connection refused java.net.ConnectException: Connection refused at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:320) at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:133) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:120) at java.net.Socket.init(Socket.java:273) at java.net.Socket.init(Socket.java:100) at org.apache.catalina.startup.Catalina.stop(Unknown Source) at org.apache.catalina.startup.Catalina.execute(Unknown Source) at org.apache.catalina.startup.Catalina.process(Unknown Source) at java.lang.reflect.Method.invoke(Native Method) at org.apache.catalina.startup.Bootstrap.main(Unknown Source) Thank-you for your time. Sean.
RE: Probable FAQ entry: Is Tomcat4+mod_webapp+Apache-1.3.xx ready for prime time?
Hello Rob: I'm using Apache 1.3.20 and the static pages work fine. I've disabled the cache just to make sure that the pages are being served correctly. However, I'm having a similar problem like yours with a different configuration. I will post a mail to the list with the problem description soon. Best regards: Rodrigo Reis -Original Message- From: rob van swol [mailto:[EMAIL PROTECTED]] Sent: domingo, 30 de Setembro de 2001 15:19 To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: Probable FAQ entry: Is Tomcat4+mod_webapp+Apache-1.3.xx ready for prime time? Hello, Rodrigo, Does that mean that also the static pages (like for instance /examples/servlets/index.html) are served correctly by Apache? If so, are you sure that you don't see pages that are cached. So far, I only get the examples themselves working correctly, but not the static pages. (Tested with Apache 1.3.11 both on Linux and SGI Irix). Rob Rodrigo Reis wrote: Hello William, If your platform is Linux you can find a binary of mod_webapp in this URL: http://www.apache.org/dist/jakarta/jakarta-tomcat-4.0/release/v4.0/bin/ I'm using it and it seems OK. -- _ Rob W. van Swol National Aerospace Laboratory NLR Tel. +31 527 248252 P.O. Box 153Fax +31 527 248210 8300 AD Emmeloord E-Mail [EMAIL PROTECTED] The Netherlands http://www.neonet.nl/
AbstractMethodError or xalan problems with tomcat
I get the following Exception (NoSuchMethodError, AbstractMethodError) when i execute this line in a servlet: Transformer transformer = tFactory.newTransformer(xslDomSource); what i tried until now: execute this line in a normal class and there everything works fine. rename xalan.jar and xerces.jar to axalan.jar and axerces.jar so that they are set first in the classpath. when i do this i got the Exception java.lang.AbstractMethodError. Does anybody know what i have to do so that xsl-transformation work with servlets? many thanks, Hans-Jürgen java.lang.NoSuchMethodError at org.apache.xpath.DOM2Helper.getNamespaceOfNode(DOM2Helper.java:348) at org.apache.xml.utils.TreeWalker.startNode(TreeWalker.java:343) at org.apache.xml.utils.TreeWalker.traverse(TreeWalker.java:167) at org.apache.xalan.processor.TransformerFactoryImpl.processFromNode(Transforme rFactoryImpl.java:225) at org.apache.xalan.processor.TransformerFactoryImpl.processFromNode(Transforme rFactoryImpl.java:324) at org.apache.xalan.processor.TransformerFactoryImpl.newTemplates(TransformerFa ctoryImpl.java:865) at org.apache.xalan.processor.TransformerFactoryImpl.newTransformer(Transformer FactoryImpl.java:747) at formel1.Transform.XML2Html(Transform.java:156) at formel1.Ergebnisse.doGet(Ergebnisse.java:51) at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405) at org.apache.tomcat.core.Handler.service(Handler.java:287) at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372) at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:81 2) at org.apache.tomcat.core.ContextManager.service(ContextManager.java:758) java.lang.AbstractMethodError at org.apache.xpath.DOM2Helper.getNamespaceOfNode(DOM2Helper.java:348) at org.apache.xml.utils.TreeWalker.startNode(TreeWalker.java:343) at org.apache.xml.utils.TreeWalker.traverse(TreeWalker.java:167) at org.apache.xalan.processor.TransformerFactoryImpl.processFromNode(Transforme rFactoryImpl.java:225) at org.apache.xalan.processor.TransformerFactoryImpl.processFromNode(Transforme rFactoryImpl.java:324) at org.apache.xalan.processor.TransformerFactoryImpl.newTemplates(TransformerFa ctoryImpl.java:865) at org.apache.xalan.processor.TransformerFactoryImpl.newTransformer(Transformer FactoryImpl.java:747) at formel1.Transform.XML2Html(Transform.java:156) at formel1.Ergebnisse.doGet(Ergebnisse.java:51) at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405) at org.apache.tomcat.core.Handler.service(Handler.java:287) at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372) at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:81 2) at org.apache.tomcat.core.ContextManager.service(ContextManager.java:758)
Re: IllegalStateException on jsp:include in simple jsp page
This simple tst.jsp page: !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.0 Transitional//EN html head titleTst.jsp/title link rel=stylesheet type=text/css href=tst.css jsp:include page=tst.js flush=true / /head body h1Tst.jsp is OK!/h1 /body /html is producing an IllegalStateException on the inclusion of the tst.js file when using the current jakarta-tomcat-4.0 binary release. The same tst.jsp file works fine when using the jakarta-tomcat-3.2.3 release. I don't see that I have much control preventing the call to obtain the request output stream so how do I prevent this error, and is this valid behavior? The full exception is given below as well as the tst.css and tst.js files. The behavior is valid, but is easy to fix. Here, the JSP page uses a writer. Since the static page server is also a servlet, it can't use an output stream to output the data (you'll get that ISE if you call getOutputStream()). It will attempt to use the writer in that particular case, but only if the file being included is a text file (it's the case here, but there's no MIME type for .js). The test used is that the MIME type of the included file has to be starting with text. Adding the following mapping in your web.xml should make it work: mime-mapping extensionjs/extension mime-typetext/plain/mime-type /mime-mapping Remy
RE: servlet to jsp
u must use the requestDispatcher to forward the request onto the JSP page from the servlet. then you can use what ever in your JSP to access what ever beans your servlet instanciates and puts into the request object. request.putAttribute() -Original Message- From: Huaxin [mailto:[EMAIL PROTECTED]] Sent: 29. september 2001 21:11 To: [EMAIL PROTECTED] Subject: servlet to jsp how can i create a bean in a servlet, and then the serlet forward/include to a jsp, the jsp can read from the bean? thanks a lot
RE: servlet to jsp
sorry I was going to write this into the other email ...but accidentaly clicked send... use this to forward the request.. RequestDispatcher dispatcher = getServletContext().getRequestDispatcher(ServletName); dispatcher.forward(request,response); hope it helps -r -Original Message- From: Huaxin [mailto:[EMAIL PROTECTED]] Sent: 29. september 2001 21:11 To: [EMAIL PROTECTED] Subject: servlet to jsp how can i create a bean in a servlet, and then the serlet forward/include to a jsp, the jsp can read from the bean? thanks a lot
Tomcat+BAS 4.5 on different machine
Hi All I set up an environment which have Apache, Tomcat and BAS 4.5 (Borland Application server) working on the same machine but now I would like to have Apache and tomcat on one machine and BAS 4.5 Application Server installed on an other machine so I am wondering how to configure Tomcat and BAS 4.5 to have them working (talking) together if they are in two different machine. For now everything are on WIN2000 environement (for development) but will have to migrate everythingto UNIX (Production) I use Tomcat to run JSP and Servlet and BAS 4.5 to RUN EJB's (enterprise Java beans) Any help on that wuld be really appreciated. Thanks Sandra Paul [EMAIL PROTECTED] _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
FreeBSD mod_webapp
Hi, When we will have a FreeBSD binary of mod_webapp ? I got the source and build it, but there were couple of things I ported (stdint.h, dyld, etc.. everyone who tried mod_webapp FreeBSD will understand what I am talking about). However, I find myself not a C guru and am not sure I did it in a right way. Are there FreeBSD porters here ? regards, [EMAIL PROTECTED] http://www.bgstore.com
Re: mod_webapp deploy
I have been struggling with this too. It really deserves some documentation: - get the source of mod_webapp.so and compile it. this is how I configured it server.xml: Service name=Tomcat-Apache Connector className=org.apache.catalina.connector.warp.WarpConnector port=8008 minProcessors=5 maxProcessors=75 enableLookups=true acceptCount=10 debug=0/ Engine className=org.apache.catalina.connector.warp.WarpEngine name=Apache debug=0 Logger className=org.apache.catalina.logger.FileLogger prefix=apache. suffix=.txt timestamp=true/ Realm className=org.apache.catalina.realm.MemoryRealm / . Host name=dell debug=0 appBase=webapps unpackWARs=true Logger className=org.apache.catalina.logger.FileLogger directory=logs prefix=localhost_log. suffix=.txt timestamp=true/ Context path= docBase=/home/eastbeem/www debug=0 reloadable=true/ /Host /Engine /Service httpd.conf: == LoadModule webapp_module /usr/lib/apache/mod_webapp.so AddModule mod_webapp.c NameVirtualHost 192.168.123.33 VirtualHost 192.168.123.33 ServerName dell DocumentRoot /home/eastbeem/www WebAppConnection warpConnection warp localhost:8008 WebAppDeploy /home/eastbeem/www warpConnection / Location /WEB-INF/ AllowOverride None deny from all /Location /VirtualHost hope this helps, manri - Original Message - From: Dom [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, September 29, 2001 7:28 PM Subject: mod_webapp deploy I'm trying to use Tomcat 4 with Apache 1.3 and mod_webapp Is there somwhere some howto or doc about that subject, I think it deserves more than 3 lines of rematks in server.xml. I try to use a web app in a virtual host, but deploy gives an error, as it tries to deploy it in $TOMCAT_HOME/webapps instead of the virtual host appBase and context docBase
[TC4] mod_webapp.so compilation failure
I'm struggling to get apache 1.3.20 working with Tomcat 4.0 First I tried the linux binary, but I got this message when I did apachectl configtest [warn] Loaded DSO /usr/lib/apache/1.3/mod_webapp.so uses plain Apache 1.3 API, this module might crash under EAPI! (please recompile it with -DEAPI) So I checked the mod_webapp source from CVS and followed README.txt instructions for compilation on the following set up. Debian/Unstable libc6 2.2.4-2 libc6-dev 2.2.4-2 Apache 1.3.20 mod_ssl 2.8.4-1 And the build fails with the following error message: snip make[1]: Entering directory apache-1.3 make[1]: Invoking make build make[2]: Entering directory `/home/eirik/tomcat4_build/jakarta-tomcat-connectors/webapp/apache-1.3' { APXS_LDFLAGS_SHLIB=`/usr/bin/apxs -q LDFLAGS_SHLIB` \ \ -lm -lcrypt -lnsl -ldl ; \ APXS_LDFLAGS_SHLIB=`/bin/echo ${APXS_LDFLAGS_SHLIB}` ; \ APXS_CFLAGS=`/usr/bin/apxs -q CFLAGS` \ -g -O2 \ -g -O2 \ \ -DLINUX=2 -D_REENTRANT \ -I/home/eirik/tomcat4_build/jakarta-tomcat-connectors/webapp/apr/include \ -I/home/eirik/tomcat4_build/jakarta-tomcat-connectors/webapp/include \ ; \ APXS_CFLAGS=`/bin/echo ${APXS_CFLAGS}` ; \ /usr/bin/apxs \ -S CFLAGS=${APXS_CFLAGS} \ -S LDFLAGS_SHLIB=${APXS_LDFLAGS_SHLIB} \ -o mod_webapp.so \ -c mod_webapp.c \ /home/eirik/tomcat4_build/jakarta-tomcat-connectors/webapp/lib/libwebapp.a \ /home/eirik/tomcat4_build/jakarta-tomcat-connectors/webapp/lib/libapr.a ; \ } Bareword found where operator expected at (eval 6) line 1, near -DLINUX=22 -DEAPI -DTARGET=apache (Missing operator before apache?) String found where operator expected at (eval 6) line 1, at end of line gcc -DLINUX=22 -DEAPI -DTARGET=apache -I/usr/include/db1 -DUSE_HSREGEX -DUSE_EXPAT -I../lib/expat-lite -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -fpic -DSHARED_MODULE -I/usr/include/apache-1.3 -c mod_webapp.c mod_webapp.c:70: wa.h: No such file or directory apxs:Break: Command failed with rc=1 make[2]: *** [mod_webapp.so] Error 1 make[2]: Leaving directory `/home/eirik/tomcat4_build/jakarta-tomcat-connectors/webapp/apache-1.3' make[1]: Exiting directory apache-1.3 make[1]: *** [template] Error 2 make[1]: Leaving directory `/home/eirik/tomcat4_build/jakarta-tomcat-connectors/webapp' make: *** [apache-1.3-build] Error 2 /snip I took a quick look through the archive and noticed that a few others have run into this problem as well, but I didn't see any follow-ups or responses. Has anybody else encountered this problem, and found a solution? Thanks in Advance eirik
Compile Servlet
Hello all.. I am newbie... I want to compile my servlet , i have set TOMCAT_HOMe, JAVA_HOME and my javac not succedded to compile the servlet... And I confuse about setting classpath so my javac can found the servlet Please help me step by step about setting classpath in autoexec.bat and I want to know how to use javac in order to get the error message step by step .. because I confuse about looking for the error ... if the javac found a lot of errors
apache/tomcat 4.0/gnu-linux setup question
Hey List, I'm trying to setup jakarta tomcat 4.0 for the first time and i'm trying to get some sort of virtual hosting deal going on that forwards connections from apache on port 80 to tomcat on port 8080 when a persons URL is entered. I currently have mod_webapp.so installed properly and included in httpd.conf. I haven't added any lines to my VirtualHost directives because I have a virtual host defined in server.xml, and I like the idea of being able to add new webapps using web.xml instead of defining a new one in httpd.conf every time. So below you will find the directory structure i'm trying to use and a few lines from my configuration files. Basically I just want to be able to type in a URL and get apache to hand off the request for servlets defined in web.xml and *.jsp files forwarded to tomcat 4.0. Possible maybe? # users web directory /websites/commaflex.com/public_html # users WEB-INF /websites/commaflex.com/public_html/WEB-INF/web.xml /websites/commaflex.com/public_html/WEB-INF/classes /websites/commaflex.com/public_html/WEB-INF/classes/HelloWorldExample.class /websites/commaflex.com/public_html/index.jsp # excerpt from server.xml Host name=www.commaflex.com debug=0 appBase=/websites/commaflex.com/public_html Context path= docBase= debug=0 reloadable=true/ /Host # excerpt from web.xml servlet servlet-nameHelloWorldExample/servlet-name servlet-classHelloWorldExample.class/servlet-class /servlet servlet-mapping servlet-nameHelloWorldExample/servlet-name url-pattern/hello/url-pattern /servlet-mapping Sincerely, Brendon Maragia I hope we shall crush in its birth the aristocracy of our monied corporations which dare already to challenge our government to a trial of strength, and bid defiance to the laws our country --Thomas Jefferson
SimpleRealm Tomcat 3.2.3 IIS5 (redirector)
I can't get SimpleRealm to work with Tomcat 3.2.3, IIS5 using the redirector login dialog pops up but auth fails. after setting debug to 99, log output is as follows 2001-10-01 01:41:04 - ContextManager: SimpleRealm: Verify user=null pass=null 2001-10-01 01:41:04 - ContextManager: Controled access for box\user ( /javamail + /index.jsp + null) Ct (jsp(org.apache.jasper.servlet.JspServlet/null) ) 2001-10-01 01:41:04 - ContextManager: SimpleRealm: UnAuthorized javamail looks like the auth interface is not working? here are the config files... C:\tomcat\conf\tomcat-users.xml ... tomcat-users user name=blah password=blah roles=blah / /tomcat-users ... C:\tomcat\webapps\javamail\WEB-INF\web.xml ... web-app display-nameJavaMail Test/display-name security-constraint web-resource-collection web-resource-nameJavaMail/web-resource-name url-pattern/*/url-pattern http-methodGET/http-method /web-resource-collection auth-constraint role-nameblah/role-name /auth-constraint /security-constraint /web-app ... Regards, Ben.