web.xml

Invalid <url-pattern> servlet mapping in tomcat 6.0

print("<pre><code><servlet> <servlet-name>myservlet</servlet-name> <servlet-class>workflow.WDispatcher</servlet-class> <load-on-startup>2</load-on-startup> </servlet> <servlet-mapping> <servlet-name>myservlet</servlet-name> <url-pattern>*NEXTEVENT*</url-pattern></servlet-mapping></code></pre>"); Above is the snippet form tomcat's w...

How to merge jsp pre-compiled web.xml fragment with main web.xml using Ant

We have the usual web.xml for our web application which includes some jsp and jsp tag files. I want to switch to using pre-compiled jsp's. I have the pre-compilation happening in the build ok, and it generates the web.xml fragment and now I want to merge the fragment into the main web.xml. Is there an include type directive for web.xm...

web.xml and relative paths

in web.xml i set my welcome file to a jsp within web.xml <welcome-file>WEB-INF/index.jsp</welcome-file> inside index.jsp i then forward on to a servlet <% response.sendRedirect(response.encodeRedirectURL("myServlet/")); %> however the application tries to find the servlet at the following path applicationName/WEB-INF/myServlet ...

Stripes: all URLs resolved through StripesDispatcher and forwarded to pre-compiled JSPs

Is it possible to have the StripesDispatcher be the sole determiner of webserver urls by looking at the @UrlBinding annotations on action beans AND also having those action beans forward to pre-compiled JSPs / servlets WITHOUT needing to define and maintain <servlet> <servlet-mapping> pairs in web.xml? Basically, I just want to have to o...

Can anyone explain servlet mapping?

I'm trying to write a web application using SpringMVC. Normally I'd just map some made-up file extension to Spring's front controller and live happily, but this time I'm going for REST-like URLs, with no file-name extensions. Mapping everything under my context path to the front controller (let's call it "app") means I should take care ...

Servlet URL pattern to match a URL that ends with a slash ("/")

I'd like to specify a Servlet URL pattern to match a URL that ends with a slash ("/") and only a slash. I understand that the pattern /example/path/* will match a URL of http://example.com/example/path/ and that this appears to work. However, that same pattern would also match URLs of http://example.com/example/path/a/ ...

How to initialize a value in web.xml from a JNDI variable?

Hi All, In my Java web application, the NTLM domain controller name is specified in web.xml like this: <filter> <!-- other code --> <init-param> <param-name>jcifs.http.domainController</param-name> <param-value>DCNAME</param-value> </init-param> <!-- other code --> </filter> In the above XML, we've hard-coded t...

How can I set the content-disposition header for a zip-file referred to in welcome-file-list?

I want to create a WAR that would only contain a single zip file that is included in the of the web app, deploy that war to JBoss and be able to download the zipfile by accessing the root of the WAR. So, currently I have a war, which has the zipfile in it, and this web.xml: <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web ...

Using JSP code in JavaScript

I want to use JSTL's fmt tag in javascript to localize my alert messages. My javascript file is a standalone file and when I include fmt tag in js file browser gives javascript errors, is it possible to treat .js file as .jsp file using web.xml configuration? Can anyone please suggest me how can I do that? ...

Is there a way to resolve system properties in a web.xml file?

I added a system property in my run.conf of my JBOSS like this: JAVA_OPTS="$JAVA_OPTS -Dfoo=bar" Now my question is, if there is a way to resolve this property in a web.xml file in a way something like this: ... <context-param> <param-name>contextConfigLocation</param-name> <param-value> classpath:applicationContext-common.xm...

API to edit web.xml from Eclipse plugin?

What is the easiest way to edit web.xml from an Eclipse plugin? (I'm looking for an API -- as opposed to using a PrintWriter etc.) ...

Configure web.xml (Tomct 5) for one servlet to handle all incoming requests?

Basically I want one servlet to handle all incoming request regardless of the path. I'm on shared hosting environment with access to configure my own web.xml file. I have the following configured in web.xml, but it doesn't work on Tomcat 5: <?xml version="1.0" encoding="UTF-8"?> <web-app id="WebApp_ID" version="2.4" xmlns="http:/...

In a Java-webapp (war), how can I use HTTP-auth for static content?

I have a Java-webapp. The webapp is packaged as a war-file. These war-file allow static content, that is directly delivered via HTTP. For servlets in this war I can make a HTTP-authentication (implement it with the servlet itself). But I also want HTTP-auth for the static content. How can I realize this? ...

JBoss Seam - ViewExpiredException

Hi, I currently have a web application which acts as a Portal. Users log onto the Portal and are shown a list of services. To view a service, an iframe is populated in the same page pointing to the URL of the service. All applications are Seam 2.1.1GA on JBoss 4.2.2GA AS. If a user loads up Service A, interacts with it, then switches ...

Static files in (Java) App Engine not accessible.

The example documentation says that you simply need to place your files in war/ (or a subdirectory) and they should be accessible from the host (as long as they aren't JSPs or in WEB-INF). For example, if you place foo.css in war/ then you should be able to access it at http://localhost:8080/foo.css. However, this isn't working for me at...

Using Servlets and JSP together resulting in unexpected looping.

I'm trying to use Servlets as a controller layer and JSPs as a view layer. Many of the examples/tutorials I've read suggest doing somehting like this: public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // add something for the JSP to work on request.setAttribute("key", "v...

How can I map a "root" Servlet so that other scripts are still runnable?

I'm trying to build a Servlet that calls a JSP page similar to the following: public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException, ServletException { req.getRequestDispatcher("/WEB-INF/main.jsp").forward(req, resp); } I need this Servlet to respond to the domain's root (eg: http://example.com/) so...

How can I find the error when Tomcat fails to start my Spring/Hibernate web application?

I have a Spring/Hibernate application which I have converted into a web application in order to provide RESTful web services (using Jersey). I am trying to deploy the web application onto Tomcat 6.0.20 and I get only a cryptic error message in the log file: Jul 8, 2009 2:25:22 PM org.apache.catalina.core.StandardContext start SEVERE: E...

Disable access by file extension in Tomcat web.xml

Thanks to everyone in advance - How would I go about disabling access via the browser by filetype? For instance if I wanted to disable all access to .xml files how would I go about doing this? Thanks ...

Custom 404 using Spring DispatcherServlet

I've set up web.xml as below. I also have an annotation-based controller, which takes in any URL pattern and then goes to the corresponding jsp (I've set that up in the -servlet.xml). However, If I go to a page that ends in .html (and whose jsp doesn't exist), I don't see the custom 404 page (and see the below error in the log). Any p...