1 2 3 Previous Next 31 Replies Latest reply on Oct 11, 2012 11:04 PM by ohmygod

    AS7 and context-root

    jean.baldessar

      Hi.

       

      Can I still use the '/' context-root in AS7?

       

      Configuring it in my application causes a exception becouse there is a conflict with the default application.

       

      How can I change the context-root of the default application so then I can put my application in that place?

       

      thanks

        • 1. Re: AS7 and context-root
          jaikiran

          In your standalone configuration file, set the enable-welcome-root to false (by default it's true) for the web subsystem and deploy your application at the root context. The enable-welcome-root controls whether or not to deploy JBoss' welcome-content application at root context.

           

          <subsystem xmlns="urn:jboss:domain:web:1.0" default-virtual-server="default-host">
              <connector name="http" protocol="HTTP/1.1" socket-binding="http" scheme="http"/>
              <virtual-server name="default-host" enable-welcome-root="false">
          
          • 2. Re: AS7 and context-root
            jean.baldessar

            Thank you jaikiran pai, it works.

            But what if I want to access the management application now?

            How can I do that?

            I tried to access localhost in the 9990 port but it doesn't work

            • 3. Re: AS7 and context-root
              dlofthouse

              For management just go straight to http://localhost:9990/console - the root context on 8080 was only a simple redirect to that URL.

              1 of 1 people found this helpful
              • 4. Re: AS7 and context-root
                ohmygod

                How to redirect the root context to my project's context-root?

                 

                I used to code like this to do this in an index.jsp but I found under welcome-content folder there is only index.html. I tried to put the index.jsp into welcome-content folder with only below content but seems not working.

                 

                <% response.sendRedirect("/myproject/"); %>
                

                 

                How can this be done?

                • 5. Re: AS7 and context-root
                  pugsherpa

                  Mike Just - were you able to figure out how to do this?  We need to do this too.  In the past, we modified ROOT.war/index.html and put a redirect in there.  How do you do it in the new Jboss 7?

                  • 6. Re: AS7 and context-root
                    ohmygod

                    I am also waiting for someone here to suggest. I am not able to get this done by myself

                    • 7. Re: AS7 and context-root
                      jaikiran

                      Why can't you just deploy your application as root application (at / context)?

                      • 8. Re: AS7 and context-root
                        ohmygod

                        Could I ask how to do this..?

                        • 9. Re: AS7 and context-root
                          jaikiran

                          mike just wrote:

                           

                          Could I ask how to do this..?

                          See my first post in this very thread.

                          • 10. Re: AS7 and context-root
                            ohmygod

                            Thanks, Jaikiran. I have turned "enable-welcome-root" to false but the problem is after that http://localhost:port is not accessible at all. My question is how to direct this address to my project's url like http://localhost:port/myproject.

                            • 11. Re: AS7 and context-root
                              pugsherpa

                              @jaikiran - I wish you hadn't locked my other thread.  The answer listed here won't work for our situation.  We need to be able to do a redirect from root context to our app's context, we can't deploy our app to the root context.  Isn't there a way to redirect the root context?

                              • 12. Re: AS7 and context-root
                                jaikiran

                                pugsherpa wrote:

                                 

                                @jaikiran - I wish you hadn't locked my other thread. 

                                That's one of the reasons why we don't recommend asking the same question in multiple places. You asked the same question here as well as the other thread. If your issue isn't related to the question here (which is about setting the root context) then I'll reopen that other thread and you can continue the discussion there.

                                • 13. Re: AS7 and context-root
                                  pugsherpa

                                  The reason I opened the other thread was because this thread marked the "Correct Answer" for an answer that doesn't work for what we are trying to do.  I don't want to deploy our app at the root context, I want to redirect the root context to our app's context.  I didn't expect any more discourse in this thread to find the answer to my question because the "Correct Answer" was already marked for this thread, but still doesn't answer my question.  That's why I opened the other thread.

                                  • 14. Re: AS7 and context-root
                                    richardrobinson

                                    In the CLI this is possible:

                                    /profile=default/subsystem=web/virtual-server=default-host:write-attribute(name=enable-welcome-root,value=false)

                                     

                                    But what about in the Web Admin console --Is there any way to do this (disable welcome-context-root) in the Web Admin console?

                                    1 2 3 Previous Next