tomcat

Hibernate findById isn't finding records that it previously found

We have a very simple method that uses "findById". public Cart getCart(long cartId) { Cart cart = null; try { dbSession.beginTransaction(); cart = (Cart)dbSession.findById(Cart.class, cartId); dbSession.commitTransaction(); if (logger.isDebugEnabled()) { logger.debug("The getCart call committed successfully"); } } f...

Can I start tomcat without starting any of the configured contexts?

It's possible to shutdown and restart a context via tomcat's manager, but can I start the tomcat process without starting any context? ...

Servlet or POJO bringing web application down

Can someone tell how to stop an web application when critical error is met while initializing, for e.g. important property is missing which will affect the whole application, I want to halt the web application, if system.exit is not a good option, can anyone point how to bring down the application. Pls don't tell me to log the error, se...

Display different Tomcat error pages depending on URL of original request

I would like to use Tomcat's error-page directive to display various different error pages in response to various types of exceptions. However, I want the error page displayed to have different styling and content depending on the original request URL that resulted in the error. Specifically, I have an admin part of my web application,...

Referencing Javascript libraries with Tomcat

I am using Eclipse Ganymede and Tomcat 5.5. I would like to add some javascript and especially ajax functionality to a dynamic web project and need some help. I would like to use jquery (but I am open to other suggestions, if you tell me why another library would be better in this case, but I have chosen jquery because it is supposed to...

Can I dynamically load additional Spring configuration files into an existing WebApplicationContext?

Upon starting my webapp within Tomcat 6.0.18, I bootstrap Spring with only what is necessary to initialize the system -- namely, for now, database migrations. I do not want any part of the system to load until the migrations have successfully completed. This prevents the other beans from having to wait on the migrations to complete bef...

How to setup Tomcat web.xml and context.xml for 2 different (user and admin) authentication

Here's my situation: I want stuff under mysite/customer/* to require form-based authentication before access (login via mysite/customer/login.jsp, with its own user_password table and role. ) BUT I want stuff under mysite/admin/* to require another form-based authentication before access (login via mysite/admin/login.jsp, with ano...

How to log out user from web site using FORM authentication?

I am using FORM authentication, together with Realm. I would like to know how can I log out. The only solution so far is to close browser, but that's not acceptable from the usability standpoint. SOLUTION As pointed by the accepted answer ((HttpServletRequest) request).getSession().invalidate(); ...

How to check if FORM Realm authentication failed?

I use FORM Authentication. <login-config> <auth-method>FORM</auth-method> <form-login-config> <form-login-page>/loginPage.jsp</form-login-page> <form-error-page>/loginPage.jsp</form-error-page> </form-login-config> </login-config> I would like to use the same JSP for my form-login-page and form-error...

Strange 404 error using spring mvc

This is a long shot but hopefully someone can help. My application is using spring framework mvc. 99% of if works properly. However when I attempt to go to one link lets call it [path]/link.html. I get a 404 error. If however, I go to this link within my development environment (tomcat,windows,IE and eclipse) I get no such 404 error...

Java Servlet API 2.5 Cookie.getDomain() always returns null

I'm having an issue using the Cookie class of the Servlet API 2.5 on Tomcat . I pull out the list of cookies from the HttpServletRequest object and iterate over them like so: Cookie[] cookies = request.getCookies(); for(Cookie cookie : cookies) { System.out.println("Name=" + cookie.getName() + " Domain=" + cookie.getDomain()); } Ho...

tomcat error

HI I recently deployed a war file. I get the following error. IF anyone can help it be great. [http-8080-Processor24] ERROR Exception sending context initialized event o listener instance of class app.util.ApplicationEventsListener [at org.apache. atalina.core.StandardContext.listenerStart(StandardContext.java:3768)] ava.lang.NoCl...

Tomcat JNDI error

I get this error Jun 23, 2009 4:49:10 PM org.apache.catalina.startup.Catalina start INFO: Server startup in 5265 ms 0 [http-8080-Processor25] ERROR Could not load security-xss-regex.txt file. [at app.sparx.navigate.AppNavigationControllerServlet.init(AppNavigationControllerServlet.java:45)] Unable to register any web resourc...

Tuning Tomcat memory and cpu consumption

Hello all. I have a Java web application that works a lot with file conventions. I am using Tomcat 6 as my servlet container. When many requests are submitted, Tomcat becomes very memory hungry. I wonder how I can fine-tune tomcat to reduce the memory consumption. I am also considering changing my servlet container. What do you suggest? ...

enabling el in jsp

Hi, could anyone tell me how can I enable EL expression in JSP version 2.0? Every time I'm getting EL expression as an String literal in the JSP as an output. Here's the DD which the container is using to sending request to servlet, and then servlet dispating request to JSP: <web-app xmlns="http://java.sun.com/xml/ns/j2ee" ...

Get list of contexts in tomcat server

I have several mini wars that are modules of a larger application running on a Tomcat 6.0 server. I'm doing it this way, instead of putting all modules in one war, because different installations need different modules. I'm starting to hit a roadblock in which I need to know what other mini wars are installed in the server. Is there a...

Getting Flex Builder to use a Tomcat server on Eclipse

I'm currently trying to get a Tomcat server I have running in Eclipse on http ://localhost:8080/ to be noticed through Flex Builder 4. I think it may have to do with the config.xml file in my Flex Builder project. It is currently set as the following (as well as some other stuff) <config> <server> http://localhost:8080/myty/myy?p1=a...

Are static functions isolated in JSP/Grails applications under tomcat?

I'm using some legacy java code that consists of several static classes from with in a Grails app under tomcat. When I only have one user using the web application everything works fine. When two users use the application things start to go wrong. I believe it's because the static classes maintain resource locks such as sockets. Am I cor...

Which way is best, to implement Comets in a Java Servlet

I want to write an aplication that uses the Comets pattern - that is a request that can be responded to when an event occurs on the server, rather than only as a response to an immediate request. What is the easiest application server to use for this purpose, is it: 1) Tomcat with its NIO package 2) Jetty with its continutations 3) or...

Handling many simultaneous AJAX requests with a struts2 action

I've got a struts2 action that responds to an AJAX request by taking some request parameters, calling a remote service that returns XML data, then transforming the data via XSL and returning the resulting XHTML via a Stream Result. The response is different depending on the given parameters. Here is the action class with a bunch of stu...