11 Replies Latest reply: Sep 24, 2012 6:27 AM by jaikiran pai RSS

Content type of xml files in welcome-content is empty

Y D Prakash Newbie

Hi,

 

Is there any idea why the Content type of any xml file which is placed in welcome-content folder of JBoss 7.1.1 is always empty?

 

Thanks...

  • 1. Re: Content type of xml files in welcome-content is empty
    Y D Prakash Newbie

    Even the global mime-mapping in stanalone.xml does not work...

     

    <subsystem xmlns="urn:jboss:domain:web:1.1" default-virtual-server="default-host" native="false">

                <configuration>

                    <mime-mapping name="body" value="text/html"/>

                    <mime-mapping name="htm" value="text/html"/>

                    <mime-mapping name="html" value="text/html"/>

                    <mime-mapping name="pdf" value="application/pdf"/>

                    <mime-mapping name="swf" value="application/x-shockwave-flash"/>

                    <mime-mapping name="txt" value="text/plain"/>

                    <mime-mapping name="xml" value="text/xml"/>

                    <mime-mapping name="manifest" value="text/xml"/>

                </configuration>

                <connector name="http" protocol="HTTP/1.1" scheme="http" socket-binding="http"/>

                <virtual-server name="default-host" enable-welcome-root="true">

                    <alias name="dserver-win7"/>

                    <alias name="localhost"/>

                </virtual-server>

            </subsystem>

     

    Any idea on this?

  • 2. Re: Content type of xml files in welcome-content is empty
    jaikiran pai Master

    Y D Prakash wrote:

     

    Is there any idea why the Content type of any xml file which is placed in welcome-content folder of JBoss 7.1.1 is always empty?

    I'm not sure I understand. Can you please explain what you are trying to do?

  • 3. Re: Content type of xml files in welcome-content is empty
    Y D Prakash Newbie

    Hi Jaikiran,

     

    Thanks for the quick reply.

     

    I have a flex application which I have to host it in welcome-content folder of Jboss 7.1.1. The flex app will have to access the web services of my java

    app. To achieve this I require crossdomain.xml which needs to be placed in the same folder. When the flex app tries to load the crossdomain.xml,

    it throws an error saying "Can not load policy file: Missing content-type".

     

    I tried by placing some other xmml files in welcome-content folder and accessed them. When I checked the fiddler packet, I was able the find the missing content-type.

     

    I tried global mime-mapping in standalone.xml. It didn't work.

     

    But, I get the content-type when I access the html file in welcome-content folder.

     

    Any idea?

  • 4. Re: Content type of xml files in welcome-content is empty
    jaikiran pai Master

    Y D Prakash wrote:

     

     

     

    I have a flex application which I have to host it in welcome-content folder of Jboss 7.1.1.

    You shouldn't be updating/modifying/fiddling with the welcome-content. Why not deploy your own web application at root context, if that's what you want?

  • 5. Re: Content type of xml files in welcome-content is empty
    Y D Prakash Newbie

    Hi Jaikiran,

     

    I am trying to migrate my app from Jboss 5.0.0 to Jboss 7.1.1. I am following just trial and error methods.

     

    Our requirement says that flex app should be separate from the Java app [ear].

     

    In Jboss 5.0.0, flex app was there in Root.war folder. I thought welcome-content [in AS7.1] is the alternative for Root.war of AS 5.0. Hence I placed the flex app there. Correct me if I am wrong.

  • 6. Re: Content type of xml files in welcome-content is empty
    Tomaz Cerar Master

    Hi,

     

    welcome-content is just what it says it is. It shows welcome stuff to get you started with usage of AS. Noting more.

    it does not support any more advanced stuff aka servlets or similar.

     

    as7 does not come with ROOT.war so that you as a user can provide it

     

    all you need to do is disable welcome content in web subsystem and that is it.

     

    --

    tomaz

  • 7. Re: Content type of xml files in welcome-content is empty
    Y D Prakash Newbie

    Hi Tomaz,

     

    I am confused now..Which is the Root folder in Jboss 7.1.1?                                  

     

    How can I add the Root.war in standalone mode? Is it the exploded war I need to add in the deployment folder? If so does it behave same as Root.war in Jboss 5.0.0?

     

  • 8. Re: Content type of xml files in welcome-content is empty
    Nicklas Karlsson Master

    in standalone.xml set

     

    <virtual-server name="default-host" enable-welcome-root="false">

     

    Then you can put an exploded war (folder e.g. root.war) in standalone/deployments where you have a jboss-web.xml setting the context root to /

    In that deployment you could place the files you need accessed from the root.

  • 9. Re: Content type of xml files in welcome-content is empty
    Y D Prakash Newbie

    Thanks Nicklas, Jaikiran and Tomaz for your time...It works..

     

    Here is the summary of the discussion:

    1. Stop server if running

     

    2. Set enable-welcome-root to false in stanalone.xml as only one app can run in root context [In fact, in any single context]

             <subsystem xmlns="urn:jboss:domain:web:1.1" default-virtual-server="default-host" native="false">

                 <configuration>

                       <mime-mapping name="manifest" value="text/xml"/>

                                  </configuration>

                                  <connector name="http" protocol="HTTP/1.1" scheme="http" socket-binding="http"/>

                                  <virtual-server name="default-host" enable-welcome-root="false">

                                                 <alias name="localhost"/>

                                  </virtual-server>

                   </subsystem>

     

    3. Add ROOT.war folder [Exploded war] or Your own folder with .war as part of the name in deployments folder

              The structure of ROOT.war is as follows:

                   ROOT.war

                   ROOT.war/WEB-INF

                   ROOT.war/WEB-INF/jboss-web.xml

     

          where definition of jboss-web.xml setting the context root to / is as follows:

                        <?xml version="1.0" encoding="UTF-8"?>

                  <jboss-web>

                       <context-root>/</context-root>

                  </jboss-web>

     

    4. Add the file ROOT.war.dodeploy in deployments folder

    5. Start the server

     

    As Nicklas said, in ROOT.war you could place the files you need accessed from the root. [FYI..even the crossdomain.xml]

     

    Hope this helps.

  • 10. Re: Content type of xml files in welcome-content is empty
    Tomaz Cerar Master

    Just for info.

     

    if your war is named ROOT.war it will be accessible on "/" by specification, so no need for jboss-web.xml

    but it won't hurt 

     

     

    --

    tomaz

  • 11. Re: Content type of xml files in welcome-content is empty
    jaikiran pai Master

    Tomaz Cerar wrote:

     

     

     

    if your war is named ROOT.war it will be accessible on "/" by specification,

    I might be wrong, but I thought that was a Tomcat specific thing. A quick look in the servlet spec doesn't seem to mandate this (I just searched for Root.war in that spec, so my search term might be wrong).