Re: Including jsp files that exist outside of the web application
Could you do something like the following? You'll be essentially doing something like curl to get the output from the other app and simply writing it out in your app. This has been tested but should help you get the idea. I did something similar to send a POST request to an external site and then just displayed the output in my app. <% URL url = new URL("http://path_to_other_app/other_page.jsp";); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); conn.setUseCaches(false); conn.setRequestMethod("GET"); // Get the response BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream())); String line; while ((line = rd.readLine()) != null) { out.println(line); } %> HTH --LD - Original Message - From: <[EMAIL PROTECTED]> To: "Tomcat Users List" Sent: Monday, December 27, 2004 3:10 PM Subject: Re: Including jsp files that exist outside of the web application > > > On Mon, 27 Dec 2004, QM wrote: > > > On Mon, Dec 27, 2004 at 01:58:53PM -0800, [EMAIL PROTECTED] wrote: > > : Maybe that's the real question. Is there a way to include jsp code > > : outside of the webapp that will be compiled runtime? > > > > What about ? > > (or is that <%@ include />? I forget which is runtime, and which is > > compile-time...) > > > > Essentially, use whichever one you're not using now and see whether that > > works ;) > > It's the jsp:include one that is runtime... and that seems to require it > to be a jsp page in the web application... which, unfortunately, is our > problem. > > Is there any way to include jsp code dynamically besides the jsp:include > method? If there was some way to do it in the code, then we could just > load the jsp code from a file store of some sort. > > Thanks, > -Raiden > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Servlet won't run init()
Put the tags after the tags. - Original Message - From: "Phil Campaigne" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, February 18, 2004 4:30 PM Subject: Servlet won't run init() > Hello, > I want a servlet to run its init() method when I start Tomcat. I put > the following entry in web.xml but that doesn't do it: > > PgConnectionPoolServlet > PgConnectionPoolServlet > > com.op.reporter_manager.PgConnectionPoolServlet > 1 > > debug > 5 > > > > > > PgConnectionPoolServlet > /PgConnectionPoolServlet > > > * > I will appreciate any ideas on how to fix it? > thanks, > Phil > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: help? JNDI Datasource HOW-TO
> I am having the same problem since last 3 days and no final solution yet I hv posted the msg 2 time to this gr but all in vain > Pls share it with me if u hv any solution.. > > > /DBTest/WEB-INF/foo/DBTest.class > Not sure if this is the problem but your class file should be under: /DBTest/WEB-INF/classes/foo/DBTest.class Everything else looks ok. HTH, Liem - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: InitParameters Question
> It appears that the init params of the servlet and its > context are different. Can someone clear up this > misunderstanding for me? Yes you are right. > > There's also a getInitParameter() method in the > javax.servlet.ServletContext class. I thought it, > too, gave access to the values. > The getInitParameter() from the javax.servlet.ServletContext comes from tags specified in web.xml for the whole application and not within tags. Hope that clears it up a little. LD - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: mod_jk2/2.0.2 failure in Tomcat 5.0.16 / Apache 2.0.48
I'm not sure it matters but you should try to define the worker before the uri mapping. Or else take out the worker property all together in the uri definition for the /examples-jsp path. [uri:/jsp-examples/*] info=Map the whole webapp - Original Message - From: "Jeremy Barth" <[EMAIL PROTECTED]> To: "Tomcat Users List" <[EMAIL PROTECTED]> Sent: Tuesday, December 23, 2003 1:42 PM Subject: Re: mod_jk2/2.0.2 failure in Tomcat 5.0.16 / Apache 2.0.48 > At 01:13 PM 12/23/2003 -0800, Liem Do wrote: > >Try adding a worker definition to the workers2.properties like below. Your > >jsp-examples uri mapping specifies a worker but there's none defined in the > >file. > > > ># define the worker > >[ajp13:localhost:8009] > >channel=channel.socket:localhost:8009 > > > >Hope that helps. > >LD > > Thanks, but even with this workers2.properties file: > > [channel.socket:localhost:8009] > info=Ajp13 forwarding over socket > tomcatId=localhost:8009 > > [uri:/jsp-examples/*] > info=Map the whole webapp > worker=ajp13:localhost:8009 > > [ajp13:localhost:8009] > channel=channel.socket:localhost:8009 > > "http://servername/jsp-examples"; doesn't work. > > Again, the Tomcat documentation at: > > http://jakarta.apache.org/tomcat/tomcat-5.0-doc/index.html > > http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jk2/index.html > > http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jk2/jk2/confighowto.html > > clearly describes a working "Minimum Configuration" workers2.properties file: > > # Define the communication channel > [channel.socket:localhost:8009] > info=Ajp13 forwarding over socket > tomcatId=localhost:8009 > > # Map the Tomcat examples webapp to the Web server uri space > [uri:/jsp-examples/*] # the actual URI is "/examples/*" which doesn't exist > info=Map the whole webapp > > that purportedly works, but I just get 500 errors. Sorry to be taking up > list bandwidth for what's probably just my own denseness. > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: mod_jk2/2.0.2 failure in Tomcat 5.0.16 / Apache 2.0.48
Try adding a worker definition to the workers2.properties like below. Your jsp-examples uri mapping specifies a worker but there's none defined in the file. # define the worker [ajp13:localhost:8009] channel=channel.socket:localhost:8009 Hope that helps. LD - Original Message - From: "Jeremy Barth" <[EMAIL PROTECTED]> To: "Tomcat Users List" <[EMAIL PROTECTED]> Sent: Tuesday, December 23, 2003 12:57 PM Subject: RE: mod_jk2/2.0.2 failure in Tomcat 5.0.16 / Apache 2.0.48 > At 01:33 PM 12/23/2003 -0700, Wendell Holmes wrote: > >If jkstatus works, then Apache is working with Tomcat, no? > >IIRC, the actual path to the jsp-examples is /webapps/examples/jsp-examples, > >so your uri mapping should be [uri:/examples/jsp-examples/*] I think. > > > >You should have an Apache error log that says 'file does not exist' where > >you tried to access /jsp-examples, since Apache nor jk2 would have a path to > >that dir. > > > >Wendell > > I don't know about Tomcat 4, but in Tomcat 5 there is no "examples" > webapp. In the webapps dir for Tomcat 5 you've got: > > ROOT/ > balancer/ > jsp-examples/ > servlets-examples/ > tomcat-docs/ > > Also, "jsp-examples" does work when executed directly from port 8080, so > I don't think the pathline to the webapp itself is incorrect: > > http://servername:8080/jsp-examples Works -- talk directly to Tomcat > http://servername/jsp-examples FAILS -- via JK2 connector > > I've tried the same setup (mod_jk2/tomcat5.0.16/apache2.0.48) in both > Unix and Windows with the same result, so whatever mistake I'm making, > it's consistent. If anyone else has gotten the examples to work, I'd > be interested in how you did it. > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: 2 Hosts: 2nd one tries to load the first's XML files
If each virtual host has their own set of applications then you should set the appBase for each host to different directories. So in your case the Host defs should look like the following: ... ... Where webapps and webapps2 are directories at the same level under your TOMCAT_HOME. HTH - Original Message - From: "Matt Raible" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, December 04, 2003 3:47 PM Subject: 2 Hosts: 2nd one tries to load the first's XML files > I have two domains that I host with tomcat - raible.net and > raibledesigns.com. In $CATALINA_HOME/conf/Catalina/raible.net - no XML > files exist. In Catalina/raibledesigns.com, I have many XML files for > the differents apps I host. However, it seems that raible.net is trying > to load all the apps from raibledesigns.com. How can I prevent this > from happening? My config is below. I tried changing the appBase of > raible.net to webapps/raiblenet and the docBase (on the Context) to "", > but that resulted in an IndexOutOfBounds Error. > > > >unpackWARs="true" autoDeploy="true"> > www.raibledesigns.com > raible.kgbinternet.com > >directory="logs" prefix="localhost_log." suffix=".txt" > timestamp="true"/> > > >unpackWARs="true"> > www.raible.net > raiblenet.kgbinternet.com > > > allowLinking="true"/> > > > Thanks, > > Matt > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Intermittent failures using DataSources
I just had another thought about this, where do you have the jdbc driver jars? You may also need a copy of the driver jars in the common/lib directory in order for the container to see it at start up time. The stack trace indicates that it not able to find the jdbc driver class. HTH Liem - Original Message - From: "Chris Ward" <[EMAIL PROTECTED]> To: "Tomcat Users List" <[EMAIL PROTECTED]> Sent: Thursday, November 27, 2003 1:09 AM Subject: RE: Intermittent failures using DataSources > > I'm not sure if it makes a difference but try putting the > ResourceLinks before the Realm definition in server.xml. > > > > Liem > > > > Thanks for the suggestion Liem - doesn't seem to make any > difference. I'm still getting the same response in > my browesr... > > > org.apache.jasper.JasperException: Unable to get connection, DataSource > invalid: "Cannot load JDBC driver class 'null'" > at > org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.ja > va:254) > at > org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295) > > Any further suggestions would be great. > > Best regards > Chris > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Intermittent failures using DataSources
Chris, I'm not sure if it makes a difference but try putting the ResourceLinks before the Realm definition in server.xml. HTH Liem - Original Message - From: "Chris Ward" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, November 26, 2003 12:23 PM Subject: Intermittent failures using DataSources > > > > Hi all, > > Please excuse any going over of old ground with this question, I have > searched every archive > I can find. I have recently started using DataSources from JSPs using > the JSTL taglib (I think > this is a Tomcat rather than taglib question). > > I've got a for my apps and initially had my bunch of > DataSources set up within > the . > > No problems. Happy, happy. > > Anyway - a few days ago I set up the required database tables to support > a DataSourceRealm > for FORM authentication and I moved all my DataSource config up to the > > since I'm sure I read somewhere that this had to be done. > > That initially caused me problems until I added a to my > for each DataSource > > . . . . . . > > reloadable="true"> > prefix="HAL." suffix=".txt" timestamp="true"/> > > > > className="org.apache.catalina.realm.DataSourceRealm" debug="99" > dataSourceName="jdbc/Id" userTable="HAL_UserId" > > userNameCol="Name" userCredCol="Password" > userRoleTable="HAL_UserRole" roleNameCol="Role" > /> > type="javax.sql.DataSource"/> > type="javax.sql.DataSource"/> > type="javax.sql.DataSource"/> > type="javax.sql.DataSource"/> > global="jdbc/SelmaData" type="javax.sql.DataSource"/> > global="jdbc/BartData" type="javax.sql.DataSource"/> > global="jdbc/Beauchamp" type="javax.sql.DataSource"/> > > > . . . . . . > > > > All the are set up along these lines.. > > . . . . . . > > type="javax.sql.DataSource"/> > > > username > {deleted in mail} > > > password > {deleted in mail}> > > > driverClassName > com.inet.tds.TdsDriver > > > url > {deleted in mail} > > > > . . . . . . > > > So I think everthing looks okay. > > > Problems > > > 1) With the above setup I get... > > > ServerLifecycleListener: createMBeans: MBeanException > java.lang.Exception: ManagedBean is not found with DataSourceRealm > at > org.apache.catalina.mbeans.MBeanUtils.createMBean(MBeanUtils.java:642) > > In my Tomcat console, unless I comment out these lines in server.xml > > className="org.apache.catalina.mbeans.ServerLifecycleListener" > debug="0"/> > className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" > debug="0"/> > > If I *do* comment them out the Tomcat Admin tool will complain. > > > > 2) Sometimes my JSPs just start failing with this message... > > > org.apache.jasper.JasperException: Unable to get connection, DataSource > invalid: "Cannot load JDBC driver class 'null'" > at > org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.ja > va:254) > at > org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295) > > even though they may have been running fine beforehand. > > > > Any help would be great. Sorry for the length of the message, it's > driving me > crazy! > > > Many thanks, > Chris > > > > > > > > > > > > > > > > > > > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Applet doesn't work when served by tomcat
Hello, I have a jsp page with a SpellChecker applet defined using the tags. For some reason this doesn't seem to work when the app is deployed in tomcat but the same app works when deployed from IPlanet webserver. It seems that the browser isn't able to download the applet code when it's served by tomcat. The page displays correctly but when any javascript on the page tries to access the applet object, I get a javascript error telling me "object does not support method". Has anybody seen this before? I'm using tomcat 4.1.27 on Windows 2000 environment. Thanks, Liem - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Where to find jakarte-tomcat-jasper src tarball???
If you have a cvs client (which is free) then you can get the source directly from the cvs source tree. This should tell you how: http://www.apache.org/foundation/cvs.html - Original Message - From: "David Kramer" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, August 13, 2003 4:13 PM Subject: Where to find jakarte-tomcat-jasper src tarball??? > I have searched all over the web looking for this tarball. I found the CVS > repository that contains the individual files for jasper, but there was no > download tarball link. Im new to Apache's CVS so maybe Im missing something > simple here. I roamed through the viewCVS website but found nothing on > downloading the entire jasper directory. Can someone please point me in the > right direction??? > > Thanks much, > > DK > > David Kramer > Software Developer > Reflect.com > Direct: 415.369.4856 > Cell: 650.302.7889 > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: jspc ant task and merge web.xml
You could also use the task to do this. == START EXAMPLE == == build.xml ==<.. your jspc calls here should output the web.xml file to a file called webjspc.xml />