web.xml

is there any way to map a servlet to */

Hi, i want to map a servlet to URLs end with /. like /user/register/, /user/login/, but not any other resource under that path, not /*. i tried /*/, but it doesn't work. so please help, is there anyway to make / like end extension mapping. thanks. ...

Configuring different auth-methods for different "folders" in a single .war

I would like to create a single .war that contains both a web based FORM login for a web GUI AND BASIC authentication (in this case, for a web service interface.) /index.html (unsecured welcome page) +---/interactive (folder containing web pages using auth-method=FORM) +---/service (servlet mapping for web service using auth-method=B...

How do web.xml filters work? Can you have two filters map to all pages (/*) and specify the order?

I want to use Spring Security, and it says to map the filter to /*. But I already have a filter mapped to /*, which is the Tuckee URLRewrite filter. Is it possible to map two filters to the same thing, and also is there a way to specify the order that the filters get called? ...

How do I lazy load Spring Security?

How do I not instantiate Spring Security until I need to? I'm using Google App Engine so the startup time of my web app is important. Sometimes when a user requests a page, they must wait the whole time for my web app instantiate before getting a response (this is called a loading request). Certain pages of my app require no authen...

Spring application context : access web.xml context-params ?

Greetings , Is there any way to get values from web.xml context-param into Spring context? For example I define the value in web.xml as : <context-param> <param-name>compass-index</param-name> <param-value>file:///home/compass/index</param-value> </context-param> And I want to assign that value to the bean-property as: <bean ....

GWT Maven and web.xml

I'm using the GWT Maven plugin from Codehaus with m2eclipse. Where is my web.xml file supposed to end up? Isn't the Maven build supposed to copy it to the /war directory? I can't see it there. Or does Jetty pick it up automatically from src/main/webapp/WEB-INF/? Here's a relevant section from my pom.xml. <plugin> <groupId>org.apache....

tomcat: how can i place parameters in web.xml and fetch them in my application?

Hiya. I would like to store db connection information in the application web.xml file and to fetch it in the application. i read somewhere that it's possible i just don't know how. any ideas? thanks! ...

In GWT I'd like to load the main page on www.domain.com and a dynamic page on www.domain.com/xyz - I just can't make it work.

Hi, I have a question for which I'm sure there must a simple solution. I'm writing a small GWT application where I want to achieve this: www.domain.com : should serve the welcome page www.domain.com/xyz : should serve page xyz, where xyz is just a key for an item in a database. If there is an item associated with key xyz, I'll load...

Can I turn off the HttpSession in web.xml?

I would like to eliminate the HttpSession completely - can I do this in web.xml? I'm sure there are container specific ways to do it (which is what crowds the search results when I do a Google search). Thanks, LES P.S. Is this a bad idea? I prefer to completely disable things until I actually need them. ...

How to remove the file suffix/extension (.jsp and .action) using the Stripes Framework?

I'm looking to use pretty / clean URL's in my web app. I would like the following URL: http://mydomain.com/myapp/calculator .. to resolve to: com.mydomain.myapp.action.CalculatorActionBean I tried overwriting the NameBasedActionResolver with: public class CustomActionResolver extends NameBasedActionResolver { public static fi...

what is web.xml file and what all things can I do with it ?

This oracle document pretty much sums up each element in a web.xml file. But I am also curios about below points: 1) Is there any configuration parameter which should be avoided like plague ? 2) Any parameters related to performance or memory usage ? 3) Security related risk due to common mis-configuration ? What all should I know ab...

Howto configure a JDBC realm for container managed security with tomcat?

Hi, I want to configure tomcat / my web application to use a JDBC realm for container managed security. I specified the realm inside tomcat's server.xml file like this: <Realm className="org.apache.catalina.realm.JDBCRealm" driverName="net.sourceforge.jtds.jdbc.Driver" connectionURL="jdbc:jtds:sqlserver://hostname:1433/intranet;user=sa...

Changes to JBoss web.xml have no effect

I just added this to my web.xml on my JBOSS server. But it had no effect. I am still allowed to connect to ports that do not use bi-directional certificate exchange. Anyone have an ideas? <!-- Force SSL for entire site as described here: http://wiki.metawerx.net/wiki/ForcingSSLForSectionsOfYourWebsite --> <security-constraint> ...

Map external directory to web.xml

Is there an easy way to map a directory in the web.xml or other deployment descriptor (jetty.xml, etc) files? For example, if I have a directory /opt/files/ is there a way that I can access its files and sub-directories by visiting http://localhost/some-mapping/? It strikes me that there should be some simple way of doing this, but I ha...

Best practices for defining and initializing variables in web.xml and then accessing them from Java code

I would like to define and initialize some variables in web.xml and the access the values of these variables inside my Java application. The reason I want to do this is because I would like to be able to change the values of these variables without having to recompile the code. What is the best practice for doing this? Most of the v...

Loading a class file immediately AFTER startup

We have a few war files deployed inside an ear file. Some of the war files have a class that caches static data from our PLM system in singletons. Since some of the classes take several minutes to load we use the load-on-startup in the web.xml to load them ahead of time. This all works fine until we attempt to re-deploy the applicatio...

How to access exception/stacktrace in Velocity template resolved by web.xml's error-page?

I would like to print the cause of the HTTP Error 500 on my Velocity template but am having difficulty figuring out how this can be done. My web.xml is configured with: <error-page> <error-code>500</error-code> <location>/error/500</location> </error-page> The location is backed by a Spring controller. The 500.vm page is resol...

Is it possible to use .properties files in web.xml in conjunction with contextConfigLocation parameter?

Here is part of my web.xml: <context-param> <param-name>contextConfigLocation</param-name> <param-value> classpath:application-config.xml </param-value> </context-param> application-config.xml uses property placeholder: <context:property-placeholder location="classpath:properties/db.properties"/> ...

Websphere exception handling

Hi all, From a security standpoint, what is the best solution to handle application errors with Websphere? I've been thinking of creating a class that is called every time an application error is generated, log the error and display a generic error message to the users. In PHP this can be achieved using the set_exception_handler() fun...

JBOSS Security: web.xml vs. jboss-web.xml

What is the relation between web.xml and jboss-web.xml? Seems like: Jboss-web.xml specifies the security domain (which can be found in login-config.xml) web.xml specifies what the security level is I don't understand what happens when jboss-web.xml specifies a weak security domain. Ie: one that cannot do what web.xml s...