Mime-type tag in web.xml and attachment download

i have set a mime-type in web.xml as below:
<mime-mapping>
     <extension>xls</extension>
     <mime-type>application/vnd.ms-excel</mime-type>
</mime-mapping>
And i have a simple jsp that only shows a table and i am making this jsp to get downloaded as an excel attachment. To make it possible i have written the following line in the JSP:
response.setHeader( "content-disposition", "attachment; filename=myexcel.xls" );
But i am not setting the content type first by writing:
response.setContentType( "application/vnd.ms-excel" );
since i have already mentioned the appropriate mime-type for excel files in web.xml.
I am using both mozilla and IE. Both are showing file download dialog. But IE is able to correctly identify the type of the attachment and opens it up with Microsoft Excel whereas mozilla fails to identify the type, assumes it to be an HTML document and opens it up in a new window of IE.
mozilla works fine only when i set the content type in the JSP itself. But IE works in all conditions even without having the mime-type tag in web.xml.
If i have already specified the mime-type for particular type of file in web.xml, is there any requirement to set the content type again in the JSP/servlet?
Please help. I even changed the mime-type for .xls (excel) files in web.xml and made it text/plain, but still the same thing is happening. IE is always showing the correct file type where as mozilla is taking it as an HTML document.
i am using weblogic server 8.1.

the web xml mime type setting are for static files served by the server...
if you print a file directly to the output of the servlet, you must set the mime type, so DO write :
response.setContentType( "application/vnd.ms-excel" );
IE "works fine" because it also uses the file extension to decide the mime type... but in the absolute, it's a wrong behaviour

Similar Messages

  • Error in parsing taglib 'customtag' tag in web.xml or .tld file of the tagl

    Hi
    While execution Portal application, I am getting error," Error in parsing taglib 'customtag' tag in web.xml or .tld file of the taglib library."
    Complete stack is
    >>#1.5 #005056AE006400690000002000000A440004BA8F3ECB004A#1331024303056#com.sap.portal.prt.runtime#sap.com/irj#com.sap.portal.prt.runtime#M1005000#6994##99593FD6676911E1807500000041A352#99593fd6676911e1807500000041a352-0#99593fd6676911e1807500000041a352#SAPEngine_Application_Thread[impl:3]_31##0#0#Error##Java###02:28_06/03/12_0020_4301650
    [EXCEPTION]
    #1#com.sapportals.portal.prt.servlets_jsp.server.jsp.ParseException: Error in parsing taglib 'customtag' tag in web.xml or .tld file of the taglib library.
    at com.sapportals.portal.prt.servlets_jsp.server.jsp.syntax.JspTaglibDirective.verifyAttributes(JspTaglibDirective.java:189)
    at com.sapportals.portal.prt.servlets_jsp.server.jsp.syntax.JspDirective.parse0(JspDirective.java:162)
    at com.sapportals.portal.prt.servlets_jsp.server.jsp.syntax.JspDirective.parse(JspDirective.java:117)
    at com.sapportals.portal.prt.servlets_jsp.server.jsp.syntax.ElementCollection.parse(ElementCollection.java:86)
    at com.sapportals.portal.prt.servlets_jsp.server.jsp.syntax.ParserImpl.parse(ParserImpl.java:595)
    at com.sapportals.portal.prt.servlets_jsp.server.jsp.JSPParser.parse(JSPParser.java:2170)
    at com.sapportals.portal.prt.servlets_jsp.server.jsp.JSPCompiler.compile(JSPCompiler.java:81)
    at com.sapportals.portal.prt.servlets_jsp.server.jsp.JSPCompiler.run(JSPCompiler.java:140)
    at com.sapportals.portal.prt.core.broker.JSPComponentItem.compileJSP(JSPComponentItem.java:291)
    at com.sapportals.portal.prt.core.broker.JSPComponentItem.getComponentInstance(JSPComponentItem.java:141)
    at com.sapportals.portal.prt.core.broker.PortalComponentItemFacade.service(PortalComponentItemFacade.java:355)
    at com.sapportals.portal.prt.core.broker.PortalComponentItem.service(PortalComponentItem.java:934)
    at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:435)
    at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:527)
    at com.sapportals.portal.prt.component.AbstractComponentResponse.include(AbstractComponentResponse.java:89)
    at com.sapportals.portal.prt.component.PortalComponentResponse.include(PortalComponentResponse.java:232)
    at com.sapportals.portal.htmlb.page.JSPDynPage.doOutput(JSPDynPage.java:76)
    at com.sapportals.htmlb.page.PageProcessor.handleRequest(PageProcessor.java:133)
    at com.sapportals.portal.htmlb.page.PageProcessorComponent.doContent(PageProcessorComponent.java:134)
    at com.sapportals.portal.prt.component.AbstractPortalComponent.doPreview(AbstractPortalComponent.java:240)
    at com.sapportals.portal.prt.component.AbstractPortalComponent.serviceDeprecated(AbstractPortalComponent.java:168)
    at com.sapportals.portal.prt.component.AbstractPortalComponent.service(AbstractPortalComponent.java:114)
    at com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:328)
    at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:136)
    at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:189)
    at com.sapportals.portal.prt.component.PortalComponentResponse.include(PortalComponentResponse.java:215)
    at com.sapportals.portal.prt.pom.PortalNode.service(PortalNode.java:645)
    at com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:328)
    at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:136)
    at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:189)
    at com.sapportals.portal.prt.core.PortalRequestManager.runRequestCycle(PortalRequestManager.java:753)
    at com.sapportals.portal.prt.connection.ServletConnection.handleRequest(ServletConnection.java:240)
    at com.sapportals.portal.prt.dispatcher.Dispatcher$doService.run(Dispatcher.java:545)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sapportals.portal.prt.dispatcher.Dispatcher.service(Dispatcher.java:434)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)
    at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
    at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:386)
    at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:364)
    at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:1060)
    at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:265)
    at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)
    at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:175)
    at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
    at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
    at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:104)
    at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:176)
    Regards
    Pratyush

    Hi,
    See the following guide and make sure to carefully follow all instructions.
    [http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/40599e45-8cf9-2910-cbaa-d4cd8e15ff34?QuickLink=index&overridelayout=true&14770392545262]
    Regards,
    Alex

  • My application gives "Error in parsing taglib 'tagLib' tag in web.xml "

    Hi ,
    My Portal application developed completely on JSP Dynpages and JSPs gives <b>at times</b> the following error
    "Error in parsing taglib 'tagLib' tag in web.xml or .tld file of the taglib library.."
    I know that this error comes when the taglib declared in the jsp and portalapp.xml doesn't match. But I have made sure that they are the same.
    Can anyone give me an opinion as to why this problem is occuring inspite of making sure that the taglib declaration are same in jsp and portalapp.xml.
    Is the problem on the server side??
    Valuable suggestions would be rewarded!!
    -Thanks
    Padmarajan.

    Hi Anagha,
    No the application is accessed using an http link.
    I am unable to make out why this error comes up only once in a while and when you refresh the screen it starts working fine.
    This is my big issue because when
    -Thanks
    Padmarajan.

  • Error in parsing taglib taglib tag in web.xml or .tld file of the taglib

    Hi All,
    I have added ResourceBundle.tld file in following path : /PORTAL-INF/taglib/tld/
    I have added portalapp.xml file following entry  :
    <property name="/PORTAL-INF/taglib/tld/ResourceBundle.tld" value="/PORTAL-INF/taglib/tld/ResourceBundle.tld"/>
    I have added jsp file following entry :
    <%@ taglib uri="/PORTAL-INF/taglib/tld/ResourceBundle.tld" prefix="bundle" %>
    I am getting the following the error: Error in parsing taglib taglib tag in web.xml or .tld file of the taglib library
    can you tell me where i am giving the wrong.
    Regards
    Siva

    hi rabih,
    in jsp..
    <%@ taglib uri="tagLib" prefix="bundle" %>
    in portalapp.xml
    <component-profile>
      <property name="tagLib" value="/PORTAL-INF/taglib/tld/ResourceBundle.tld"/>
    </component-profile>
    it may help u..
    regards,
    Chinnadurai.R

  • Getting Email Value from web.xml and displaying in JSF

    HI,
    I have a web.xml with the entry:
    <env-entry>
            <description>The email address for the Support Team.</description>
            <env-entry-name>support</env-entry-name>
            <env-entry-type>java.lang.String</env-entry-type>
            <env-entry-value>[email protected]</env-entry-value>
    </env-entry>I want to display on the JSF the value *"[email protected]"*. I dont want to Hard Code the Email Id on the JSF hence I am looking for this solution.
    One way would be to get the value of the email in a backing bean and then setting a managedBeanValue which will be accessed in the JSF Display page.
    My question is how do I get the email value in my backing bean ?
    Thanks in advance !!!

    I tried using this code:
        FacesContext context = FacesContext.getCurrentInstance();
        ServletContext servletContext = (ServletContext)context.getExternalContext().getContext();
        String value = (String)(servletContext.getAttribute("support");But when I do a System Out on value I get null
    Please Help.
    Thanks in advance

  • Problems with error-page in web.xml and page caching

    Having a few problems with error pages and web.xml with browsers caching the error pages and strange errors coming out of weblogic.servlet.intenal.WebAppServletContext
    I'm trying to set a web app up so that all http errors and all exceptions are routed thruogh predefined resources. For now, I'm simply send 400 errors to 400.html and the ServletException, IOException and RuntimeException to respective html pages.
    What I'm finding is that the error codes work fine but the exceptions are only be routed to the correct error page for the first call to the servlet after server restart.
    So for example, I have my servlet throwing a ServletException as a test case. The weblogic server log shows that ServletException is thrown, and the correct error page for ServletExceptions is shown.
    If I change the Servlet code to throw IOException in place of SevletException, the weblogic.log shows that IOExceptyion is being thrown (so the servlet has deployed successfully), however the Servletxception error page is shown on the browser.
    I'm using IE6 and I've changed the setting such that a new page is requested every time using the tools-internet options-temp internet files-settings option to "check for new versions of stored pages: Every visit to the page".
    Despite this, the servlet exception error page still appears.
    If you clear the cache from the temp intenet files->delete files IE option, the correct errror page will be shown so it appears that the browser cache is being used after all.
    everytime I delete the temp intenet files I get the correct error page on the first request after but then not after that.
    I have implemented the service method for this test to throw the exceptions - does this make a differecne?
    As a test, I have moved the imlpementation to the doGet method instead bu I now get a strange eror from weblogic comlpaining about an arrayOutOfBoundsException because eror codes in the web.xml are not supported! - see error above.
    Any help is appreciated

    After further investigation: -
    There are no problems with error pages based on error codes, only error exceptions.
    As a test case, I have a service method in a servlet throwing either one of the three exception types that servlets can throw (Runtime, Servlet & IO) the following rules apply. The exception to be thrown is hardcoded and is changed and the web app rebuilt each time. The correct web.xml has been deployed to the app server (checked through console). the webapp is being redeployed correctly - this can be seen in the weblogic log, where the correct exception is reported.
    I am using WLS 8.1, Servlet 2.3, JDK 1.4.1_02
    In all cases, the weblogic log reports that the servlet is throwing the exception as expected.
    Despite having set error-page for exception javax.servlet.ServletException, the exceptions are diverted to the error page that has been set up for http error code 500
    The error page for ServletException is therefore never reached.
    I have the browser set to request pages every time it is asked.
    Once the servlet has thrown an IOException, the only way to get the browser to report an IO or Runtime exception error-page is to clear the browser cache. Restarting the server has no effect.
    Once the servlet has responded with ANY exception, it is not possible to get it to report a ServletException (which is incorrectly reported as a 500 anyway) unless the cache is cleared. Restarting the server has no effect.
    In the case where the servlet throws ServletException, it has no root exception. The servlet 2.3 spec states that if ServletException is thrown but cannot be found in the error pages, the root excpetion will be extracted and the error page list traversed again. Knowing that the RuntimeException error page is correct shown when RuntimeException is throwm, I have nested this inside the ServletException, however error page for http error 500 is still shown.
    I don't believe this is a WLS 8.1 problem, as the console shows that the correct exception is thrown each time. this is backed up by the fact that the correct exception page is thrown when the cache is cleared regardless of what exception was previousdly thrown by the servlet. This excludes ServletException which is always incorrectly thrown as a 500.

  • How can one use one specific security realm per application ? The realm-name attribute of the login-config tag of web.xml does not make any difference

    Hi,
    I have different sets of users coming from different databases and using different
    roles mapping for each of my web applications. I would like to configure a specific
    security realm per application in my weblogic server 7.0 . Is it possible ?
    I try to specify the realm-name of the login-config tag from the web-xml deployement
    descriptor but it doesn't make any difference. The default realm is always used.
    I also would like to tell the Weblogic server to use the default realm in case
    the realm isn't specified or isn't found. For example, the default would contains
    my admin users.
    Thanks a lot for your answer.
    Iz

    I thik this is a common mistake the ralm-name tag in the deployment descriptor is used
    just by the browser for display purposes (when it opens the basic auth dialog box) so as
    of now there is only 1 active realm which can have multiple providers as Kevin pointed
    out
    Kevin Lewis wrote:
    WebLogic 7 now ignores the realm-name tag (I found that out yesterday).
    My understanding is that there is only one realm active at a time for a domain
    (I would be interested in being contradicted in this).
    However, you can have multiple providers in each category of a realm: authentication,
    authorization, etc. Therefore, what you can do is key authentication, et al,
    off of some other information. We have our users enter their company, for example,
    and use the TextInputCallback to get it. You could also encode something in the
    initial page, based on the URL they hit, or whatever, and get that back in your
    callback.
    You can store that information in your own Principal implementation, and key off
    of that in your authorization provider, going to a different database as appropriate,
    or abstaining when a specific provider doesn’t have anything to say about a subject.
    Anyway, there should be a way to do it, even if it's more complex than you would
    have hoped.
    --Kevin

  • Help with web.xml and deploying a servlet

    Hello,
    I've been tearing me hair out for the last few hours trying to get this to work... I've got a servlet org.fatbaob.servtest.Servtest that I want to deploy with Tomcat 4.0.4. It doesn't seem to mater what I put in the web.xml file I'm always getting 404 errors.
    The servlet is contained in a file c:\development\projects\servtest\WEB_INF\classes\org\fatboab\servtest\Servtest
    which mapped with a <context> tag in the Tomcat conf\server.xml file:
    <!-- Servtest context -->
         <Context path="/servtest" docBase="C:\development\projects\servtest" debug="0" privileged="true" reloadable="true">
         <Logger className="org.apache.catalina.logger.FileLogger" prefix="localhost_servtest_log." suffix=".txt" timestamp="true"/>
    </Context>
    My web.xml file contains:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app>
    <servlet>
    <servlet-name>ServTest</servlet-name>
    <servlet-class>org.fatboab.servtest.Servtest</servlet-class>
    </servlet>
    </web-app>
    Although I have tried putting in <servlet-mapping> tags, but they didn't seem to work either.
    My html file contains:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
    <head>
    <title>Servlet Test</title>
    </head>
    <body>
    <h1>Servlet Test</h1>
    <form action="/servtest/servlet/org.fatboab.servtest.Servtest" method="post">
    <table>
    <tbody>
    <tr>
    <td>Name:</td>
    <td><input type="text" size="77" name="name" /></td>
    </tr>
    <tr>
    <td>Email:</td>
    <td><input type="text" size="77" name="email" /></td>
    </tr>
    <tr>
    <td colspan="2"><input type="submit" value="Submit" /></td>
    </tr>
    </tbody>
    </table>
    </form>
    </body>
    </html>
    The 404 error I get is:
    description The requested resource (/servtest/servlet/org.fatboab.servtest.Servtest) is not available.
    Help!
    Cheers,
    Bob.

    Hello,
    I've been tearing me hair out for the last few hours
    trying to get this to work... I've got a servlet
    org.fatbaob.servtest.Servtest that I want to deploy
    with Tomcat 4.0.4. It doesn't seem to mater what I put
    in the web.xml file I'm always getting 404 errors.
    The servlet is contained in a file
    c:\development\projects\servtest\WEB_INF\classes\org\fa
    boab\servtest\Servtest
    which mapped with a <context> tag in the Tomcat
    conf\server.xml file:
    <!-- Servtest context -->
    <Context path="/servtest"
    docBase="C:\development\projects\servtest" debug="0"
    privileged="true" reloadable="true">
    <Logger
    er className="org.apache.catalina.logger.FileLogger"
    prefix="localhost_servtest_log." suffix=".txt"
    timestamp="true"/>
    </Context>
    My web.xml file contains:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE web-app PUBLIC "-//Sun Microsystems,
    Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app>
    <servlet>
    <servlet-name>ServTest</servlet-name>
    <servlet-class>org.fatboab.servtest.Servtest</servlet-
    lass>
    </servlet>
    </web-app>
    Although I have tried putting in <servlet-mapping>
    tags, but they didn't seem to work either.
    My html file contains:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
    "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml"
    xml:lang="en">
    <head>
    <title>Servlet Test</title>
    </head>
    <body>
    <h1>Servlet Test</h1>
    <form
    action="/servtest/servlet/org.fatboab.servtest.Servtest
    method="post">
    <table>
    <tbody>
    <tr>
    <td>Name:</td>
    <td><input type="text" size="77" name="name"
    ="name" /></td>
    </tr>
    <tr>
    <td>Email:</td>
    <td><input type="text" size="77" name="email"
    "email" /></td>
    </tr>
    <tr>
    <td colspan="2"><input type="submit"
    submit" value="Submit" /></td>
    </tr>
    </tbody>
    </table>
    </form>
    </body>
    </html>
    The 404 error I get is:
    description The requested resource
    (/servtest/servlet/org.fatboab.servtest.Servtest) is
    not available.
    Help!
    Cheers,
    Bob.Bob,
    Here an servlet definition I have defined in my web.xml...just plug in your values.
    <servlet>
    <servlet-name>AutoUpload</servlet-name>
    <servlet-class>com.lendleaserei.webservices.AutoUpload</servlet-class>
    <display-name></display-name>
    <description></description>
    </servlet>
    <servlet-mapping>
    <url-pattern>/webs</url-pattern>
    <servlet-name>com.lendleaserei.webservices.AutoUpload</servlet-name>
    </servlet-mapping>
    Hope this helps,
    Marco

  • Jazn-data.xml file, authentication in web.xml and embedded oc4j

    I've defined new security-roles, security-constraints and an authentication method in my web.xml file and i've created a new jazn-data.xml file that holds the different users and their groups.
    If I want to link the security-roles of the web.xml file to the roles in the jazn-data.xml file I always need an orion-application.xml file, is this correct?
    If I want to deploy an application as this to the embedded container the security won't work, I'm always getting the '403 forbidden' page.
    Can somebody point me out how I need to define security for an embedded and standalone environment when using authentication and jazn-data.xml file + how do I deploy this to a standalone oc4j and how to get this same application to work in the embedded oc4J.

    hi "romanna"
    Part of the answer to "Can somebody point me out how I need to define security ..." can probably be found in the "Oracle ADF Developer's Guide" that has "18 Adding Security to an Application".
    success
    Jan

  • What is the use of security-constraint tag in web.xml

    what is the use of following tag , and how to use that, and where to use that tag.
    <web-resource-collection>
    <web-resource-name>SecureOrderJSP</web-resource-name>
    <descrip<url-pattern>/order/*</url-pattern>
    <http-method>GET</http-method>
    <http-method>POST</http-method>
    </web-resource-collection>
    <auth-constraint>
    <role-name></role-name>
    </auth-constraint>
    </security-constraint>tion>Protect the Order JSP Pages </description>

    Hi,
    You can refer this link
    http://www.whizlabs.com/tutorial/scwcd/j-scwcd-7-5.html
    give the complete description of your doubt
    Thanks,
    Snigdha Sivadas

  • Question on web.xml and login

    Hi all
    I am doing a web-based project, registered user need to log in before they view the member area pages.
    I have created a directory, called "client", in the Tomcat 4.1.24/webapps/ROOT/client I have put a index.html in the client directory. This index.html only can be viewed by the client after log in.
    For the best of my knowledge in Tomcat, in order to do this, I have created a web.xml in Tomcat_home/webaggs/ROOT/WEB-INF/web.xml, in the url-pattern section, I put /client/* to tell the tomcat server that index.html in client directory is the first page after user login.
    The problem is, I couldnt see the member welcome page after I login as a member, the browser gave me the error: HTTP status 400 - Invalid direct reference to form login page. However, if I specified the address http://localhost:8080/client/index.html , it show me the login page and after I input the username and password I can see the member welcome page.
    I dont know whether is something wrong with the web.xml or I should do other thing to let the server know which is the first page after member login.
    Thank you very much
    Kelvin
    =====================================================
    <web-app>
    <security-constraint>
    <web-resource-collection>
    <web-resource-name>Security</web-resource-name>
    <url-pattern>/client/*</url-pattern>
    </web-resource-collection>
    <auth-constraint>
    <role-name>administrator</role-name>
         <role-name>client</role-name>
    </auth-constraint>
    </security-constraint>
    <login-config>
    <auth-method>FORM</auth-method>
    <form-login-config>
    <form-login-page>/login.html</form-login-page>
    <form-error-page>/login_error.html</form-error-page>
    </form-login-config>
    </login-config>
    </web-app>
    =====================================================

    Wow, you really are in the wrong place with this query, its not really even java ;o) This is the new to java forum! Perhaps you would be better off (in fact I know for a FACT that you will be as I have seen answers to identical problems there) in the Tomcat-user list...
    Go HERE:
    http://www.mail-archive.com/[email protected]/
    and search

  • What is web.xml and why it is used?

    hi,
    am new to servlet technology, i tried to find a topic like this in this fourm also in google but didn't get a exact one. can anybody explain me or suggest me some resource about this.
    thanx in advance.
    Max

    hi stevejluke,
    thanx for the correct link.
    nx for the correct link. but what i in doubt with is
    why we should use web.xml? may be my question is very
    silly, may be too basic, forgive me for that...
    Thanx & Regards,
    SaikatAt the most basic level:
    There are several versions of the Servlet specification, You need the web.xml to tell the server which version of the spec your application conforms to so the server knows how to deal with different things.
    If you have a servlet, you also need the web.xml to define what URL signals a request that should be handled by your servlet.
    At this point, you need to sit down and read a book. Do what it says, blindly at first. Just do what it says (but do try to understand the 'what' of it, just don't question the 'why'). After you have a few applications running, go back and ask yourself this question again and try to see what you are using the web.xml for in those applications you have.

  • Orion-web.xml and resource-env-ref-mapping correct usage

    What happened to resource-env-ref-mapping element in orion-web.xml? I have a 9.0.4.1 server running several .EAR files containing web applications using this attribute to configure JMS related items. But when deploying the .EAR to newer versions (9.0.5.2) of the server this attribute doesn't appear to be valid any longer?
    Here it is in the 9.0.4 documentation:
    http://strogoff.unex.es/oradoc/form_y_report_10g/web.904/b10322/apdx_a.htm
    Any help would be appreciated?

    I should have been more clear about the issue. The error only occurs when running inside the embedded OC4J container of JDeveloper 10.1.2 build 1913. The error does NOT occur in JDeveloper 9.0.3. The application also runs fine when deployed to a 10.1.2 Enterprise application server. The error only occurs in JDeveloper.
    The following error occurs when validating my orion-web.xml file. The entry is:
    orion-web.xml:
    <orion-web-app>
    <resource-ref-mapping name="jms/mQueueConnectionFactory" location="jms/matchingQueueConnectionFactory"/>
    <resource-env-ref-mapping name="jms/mQueue" location="jms/matchingQueue"/>
    </orion-web-app>
    web.xml
    <resource-env-ref>
    <resource-env-ref-name>jms/mQueue</resource-env-ref-name>
    <resource-env-ref-type>javax.jms.Queue</resource-env-ref-type>
    </resource-env-ref>
    java.lang.IllegalArgumentException: Unrecognized parent-elem combination: interface oracle.jdeveloper.xml.oc4j.war.OrionWebApp - resource-env-ref-mapping
         at oracle.javatools.xml.bind.XMLBinding.throwUnrecognizedElem(XMLBinding.java:127)
         at oracle.jdeveloper.xml.j2ee.war.WebAppBinding.elem2intImpl(WebAppBinding.java:637)
         at oracle.javatools.xml.bind.XMLBinding.elem2int(XMLBinding.java:104)
         at oracle.javatools.xml.bind.XMLBinding.insertBetween(XMLBinding.java:88)
         at oracle.javatools.xml.bind.BindingContext.insertNewElement(BindingContext.java:121)
         at oracle.javatools.xml.bind.BindingContext.insertElem(BindingContext.java:95)
         at oracle.javatools.xml.bind.BindingContext.setElement(BindingContext.java:71)
         at oracle.javatools.xml.bind.SetImpl.callSetterForUniqueElem(SetImpl.java:66)
         at oracle.javatools.xml.bind.SetImpl.callSetter(SetImpl.java:57)
         at oracle.javatools.xml.bind.SetImpl.invoke(SetImpl.java:26)
         at oracle.javatools.xml.bind.ElementProxy.invoke(ElementProxy.java:35)
         at $Proxy10.setWebApp(Unknown Source)
         at oracle.jdevimpl.runner.oc4j.Oc4jWorkspaceConfig.ensureLocalPageReposRootIsSet(Oc4jWorkspaceConfig.java:633)
         at oracle.jdevimpl.runner.oc4j.Oc4jWorkspaceConfig.transmogrifyConfigFiles(Oc4jWorkspaceConfig.java:269)
         at oracle.jdevimpl.runner.oc4j.Oc4jWorkspaceConfig.configureAll(Oc4jWorkspaceConfig.java:114)
         at oracle.jdevimpl.runner.oc4j.Oc4jStarter.preStart(Oc4jStarter.java:618)
         at oracle.jdevimpl.runner.oc4j.Oc4jStarter.start(Oc4jStarter.java:268)
         at oracle.ide.runner.RunProcess.startTarget(RunProcess.java:756)
         at oracle.jdeveloper.runner.JRunProcess.startTarget(JRunProcess.java:461)
         at oracle.ide.runner.RunProcess$2.run(RunProcess.java:699)
         at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:178)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:454)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)

  • Web.xml and security constraints

    Hi,
    I have several web services deployed. I only want to protect one of these web services.
    If I use "/services/*" in <security-constraint> of my web.xml file, all my deployed web services are protected.
    If I use "/services/aaaWebService" in <security-constraint> of my web.xml file, aaaWebService web service is NOT protected.
    Please let me know what I should use for teh <url-pattern> to protect only aaaWebService.
    Thanks /dan

    What about "/services/aaaWebService*"?
    I think whithout an asterisk service parameters don't match your pattern.
    Vovencij

  • Env-entry in web.xml and 6.0 sp4

    Does anyone know if iws 6.0 sp4 supports env-entry elements in web.xml???
    According to servlet specs 2.2 it should support it since it has JSP support.
    From 2.3 specs:
    "The following addtional elements exist in the web application deployment
    descriptor to meet the requirements of web containers that are JSP enabled or part
    of a J2EE application server. They are not required to be supported by containers
    wishing to support only the servlet specification.:
    � taglib
    � syntax for looking up JNDI objects (env-entry, ejb-ref, ejb-local-ref, resourceref,
    resource-env-ref)
    See the DTD comments for further description of these elements."

    Additional info...actually the code throws a NamingException.

Maybe you are looking for

  • Dialog Instance Installation - Error while connecting to DB

    Hi All, We have installed a WAS 640 SP15 and successfully running a Portal EP6.0 (SP15) on the same. Now, we wish to install a dialog instance on the same for load balancing the Portal on the same Hardware/Server. During the DI installation in the ph

  • Can intel 520 series SSD be installed in macbook pro mid 2009

    This is some of the information for the 180g SSD I want to replace my HD in my 13" macbook pro mid 2009 25nm NAND Flash Memory 2.5" form factor SATA 6.0 Gb/s performance My computer though has this information for its hard drive: Product:          MC

  • Mobile hotspots---what are the advantages?  better reception?

    What are the advantages of getting a mobile hotspot---such as the Verizon Jetpack 4G LTE Mobile Hotspot MiFi 4620L---over simply using the hotspot feature of a tablet (such as the Samsung Galaxy 7.7" or a Motorola Xyboard 8.2") or smartphone (such as

  • AD - import users and check AD group membership

    Hi I'm relatively useless with PowerShell and I am wanting to write a script that will do the following and am just getting stuck with part B. Part A- import a list of users from a CSV Part B- check if the users are members of an ad group and if so r

  • I ran a free trial of Adobe Creative 5.5 how do I delete expiry message?

    I ran a free trial of Adobe Creative 5.5 do not wish to purchase can not delete the expiry messate and it is blocking all my other Abobe programmes so now I can't use any of them? I have lots of different Adobe loaded which I want to keep and not sur