I have a web application which uses a security-constraint in the deployment descriptor.
My lone url-pattern in my web-resource-collection is for my welcome page. This has worked well enough. However, now I wish to access a specific URL, a servlet that produces pdf documents, bypassing the welcome page. My feeling is that this should be added as another url-pattern. However, doing so causes the File Download dialog. ... File name: pdf File type: Adobe Acrobat Control for ActiveX From: server ... Trying to open or save produces an error dialog that states that the requested site is either unavailable or cannot be found. Prior to me adding the url to the servlet, this was not a problem. The pdf simply opened in the adobe plug-in. I'm merely setting the content type to the mime type (application-pdf) and the output stream to the document. Perhaps I need to set more header info, or perhaps my web.xml is wrong. Thanks for the help. My web.xml: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/j2ee/dtds/web-app_2_3.dtd"> <web-app> <display-name>Digital OR Assistant</display-name> <description>DORA is a multimedia database supporting the OR of the future.</description> <filter> <filter-name>Set Character Encoding</filter-name> <filter-class>com.snn.util.filters.SetCharacterEncodingFilter</filter-class> <init-param> <param-name>encoding</param-name> <param-value>UTF-8</param-value> </init-param> </filter> <filter> <filter-name>Timeout Check Filter</filter-name> <filter-class>com.snn.util.filters.TimeoutCheckFilter</filter-class> </filter> <filter-mapping> <filter-name>Set Character Encoding</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <filter-mapping> <filter-name>Timeout Check Filter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <listener> <listener-class>com.snn.util.listeners.SessionManager</listener-class> </listener> <servlet> <servlet-name>Dora</servlet-name> <display-name>Dora</display-name> <jsp-file>/index.jsp</jsp-file> <init-param> <param-name>dora.propertyFile</param-name> <param-value>C:/Program Files/DORAweb/conf/dora.properties</param-value> </init-param> <init-param> <param-name>dora.version</param-name> <param-value>1.2.0</param-value> </init-param> <security-role-ref> <role-name>surgeon</role-name> <role-link>1</role-link> </security-role-ref> <security-role-ref> <role-name>non-surgeon</role-name> <role-link>2</role-link> </security-role-ref> <security-role-ref> <role-name>admin</role-name> <role-link>3</role-link> </security-role-ref> </servlet> <servlet> <servlet-name>MediaContentHandler</servlet-name> <display-name>Media Content Handler</display-name> <description>Handler for retrieving and storing media files into DORA</description> <servlet-class>com.snn.multimedia.ui.MediaContentHandler</servlet-class> <init-param> <param-name>dora.propertyFile</param-name> <param-value>C:/Program Files/DORAweb/conf/dora.properties</param-value> </init-param> <init-param> <param-name>dora.version</param-name> <param-value>1.2.0</param-value> </init-param> <security-role-ref> <role-name>surgeon</role-name> <role-link>1</role-link> </security-role-ref> <security-role-ref> <role-name>non-surgeon</role-name> <role-link>2</role-link> </security-role-ref> <security-role-ref> <role-name>admin</role-name> <role-link>3</role-link> </security-role-ref> </servlet> <servlet> <servlet-name>DownloadCase</servlet-name> <display-name>Download Case</display-name> <description>Handler for downloading case files from DORAweb to client</description> <servlet-class>com.snn.multimedia.ui.DownloadCase</servlet-class> <init-param> <param-name>dora.propertyFile</param-name> <param-value>C:/Program Files/DORAweb/conf/dora.properties</param-value> </init-param> <init-param> <param-name>dora.version</param-name> <param-value>1.2.0</param-value> </init-param> <security-role-ref> <role-name>surgeon</role-name> <role-link>1</role-link> </security-role-ref> <security-role-ref> <role-name>non-surgeon</role-name> <role-link>2</role-link> </security-role-ref> <security-role-ref> <role-name>admin</role-name> <role-link>3</role-link> </security-role-ref> </servlet> <servlet-mapping> <servlet-name>Dora</servlet-name> <url-pattern>/index.jsp</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>MediaContentHandler</servlet-name> <url-pattern>/MediaContentHandler</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>DownloadCase</servlet-name> <url-pattern>/DownloadCase</url-pattern> </servlet-mapping> <session-config> <session-timeout>-1</session-timeout> </session-config> <welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list> <error-page> <error-code>401</error-code> <location>/error404.jsp</location> </error-page> <error-page> <error-code>404</error-code> <location>/error404.jsp</location> </error-page> <!-- <resource-ref> <description>DB Connection</description> <res-ref-name>jdbc/doraweb</res-ref-name> <res-type>javax.sql.DataSource</res-type> <res-auth>Container</res-auth> </resource-ref> --> <security-constraint> <web-resource-collection> <web-resource-name>dora</web-resource-name> <url-pattern>/index.jsp</url-pattern> <http-method>GET</http-method> <http-method>POST</http-method> </web-resource-collection> <auth-constraint> <role-name>1</role-name> <role-name>2</role-name> <role-name>3</role-name> </auth-constraint> </security-constraint> <login-config> <auth-method>BASIC</auth-method> <realm-name>DORA</realm-name> </login-config> <security-role> <description>Surgical user of the system (e.g. Attending, M.D.)</description> <role-name>1</role-name> </security-role> <security-role> <description>Non-surgical user of the system (e.g. R.N., SurgTech, admin)</description> <role-name>2</role-name> </security-role> <security-role> <description>Administrator of the system.</description> <role-name>3</role-name> </security-role> </web-app> This electronic transmission is strictly confidential to Smith & Nephew and intended solely for the addressee. It may contain information which is covered by legal, professional or other privilege. If you are not the intended addressee, or someone authorized by the intended addressee to receive transmissions on behalf of the addressee, you must not retain, disclose in any form, copy or take any action in reliance on this transmission. If you have received this transmission in error, please notify the sender as soon as possible and destroy this message.
