changing webapp root

View: New views
9 Messages — Rating Filter:   Alert me  

changing webapp root

by Kallin Nagelberg :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Does anyone know how I can change the default webapp root when running grails?
I'd like to be able to configure it so i just hit http://localhost instead of http://localhost:8080/someProject.

I know when deploying to tomcat I could just create a ROOT.war. What about with jetty and grails?

Thanks!

Re: changing webapp root

by j pimmel :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

we did this yesterday

Add a web-jetty.xml containing the following to your web-app/WEB-INF folder

<?xml version="1.0"  encoding="ISO-8859-1"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd">
<Configure class="org.mortbay.jetty.webapp.WebAppContext">
  <Set name="contextPath">/</Set>
  <Set name="war"><SystemProperty name="jetty.home" default="."/>/webapps/((YOUR_WAR_NAME without extension))</Set>  << --- no brackets obviously  //webapps/foo   (its foo.war when packaged)
</Configure>

Hope that helps

On Feb 20, 2008 5:26 AM, Kallin Nagelberg <kallin.nagelberg@...> wrote:
Does anyone know how I can change the default webapp root when running grails?
I'd like to be able to configure it so i just hit http://localhost instead of http://localhost:8080/someProject.

I know when deploying to tomcat I could just create a ROOT.war. What about with jetty and grails?

Thanks!


Re: changing webapp root

by Kallin Nagelberg :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Awesome thanks, it works.

Incidentally, I tried removing the <set name="war>....</set> and it still works the same. It appears to just need the contextPath set....

Also, and this is getting picky, grails still says: 'Server running. Browse to http://localhost:8080/someProject'. Not a big deal, but maybe worthy of a bug report?

On Feb 20, 2008 4:08 AM, j pimmel <frankly.watson@...> wrote:
we did this yesterday

Add a web-jetty.xml containing the following to your web-app/WEB-INF folder

<?xml version="1.0"  encoding="ISO-8859-1"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd">
<Configure class="org.mortbay.jetty.webapp.WebAppContext">
  <Set name="contextPath">/</Set>
  <Set name="war"><SystemProperty name="jetty.home" default="."/>/webapps/((YOUR_WAR_NAME without extension))</Set>  << --- no brackets obviously  //webapps/foo   (its foo.war when packaged)
</Configure>

Hope that helps


On Feb 20, 2008 5:26 AM, Kallin Nagelberg <kallin.nagelberg@...> wrote:
Does anyone know how I can change the default webapp root when running grails?
I'd like to be able to configure it so i just hit http://localhost instead of http://localhost:8080/someProject.

I know when deploying to tomcat I could just create a ROOT.war. What about with jetty and grails?

Thanks!



Re: changing webapp root

by j pimmel :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

yeah we noted the same.. its picking up on the ${grailsAppName} (we think) and happily letting know it  :)


On Wed, Feb 20, 2008 at 8:29 PM, Kallin Nagelberg <kallin.nagelberg@...> wrote:
Awesome thanks, it works.

Incidentally, I tried removing the <set name="war>....</set> and it still works the same. It appears to just need the contextPath set....

Also, and this is getting picky, grails still says: 'Server running. Browse to http://localhost:8080/someProject'. Not a big deal, but maybe worthy of a bug report?


On Feb 20, 2008 4:08 AM, j pimmel <frankly.watson@...> wrote:
we did this yesterday

Add a web-jetty.xml containing the following to your web-app/WEB-INF folder

<?xml version="1.0"  encoding="ISO-8859-1"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd">
<Configure class="org.mortbay.jetty.webapp.WebAppContext">
  <Set name="contextPath">/</Set>
  <Set name="war"><SystemProperty name="jetty.home" default="."/>/webapps/((YOUR_WAR_NAME without extension))</Set>  << --- no brackets obviously  //webapps/foo   (its foo.war when packaged)
</Configure>

Hope that helps


On Feb 20, 2008 5:26 AM, Kallin Nagelberg <kallin.nagelberg@...> wrote:
Does anyone know how I can change the default webapp root when running grails?
I'd like to be able to configure it so i just hit http://localhost instead of http://localhost:8080/someProject.

I know when deploying to tomcat I could just create a ROOT.war. What about with jetty and grails?

Thanks!




Re: changing webapp root

by Kallin Nagelberg :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I found another issue :|

So I have my web-jetty.xml file as below, which does allow me to access application without specifying project name.
However, The 'home' links on the scaffolding generated pages no longer work. Has anyone experienced this?

<?xml version="1.0"  encoding="ISO-8859-1"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd">
<Configure class="org.mortbay.jetty.webapp.WebAppContext">
    <Set name="contextPath">/</Set>
    <Set name="war">
        <SystemProperty name="jetty.home" default="."/>/webapps/myApp
    </Set>
</Configure>

On Wed, Feb 20, 2008 at 3:33 PM, j pimmel <frankly.watson@...> wrote:
yeah we noted the same.. its picking up on the ${grailsAppName} (we think) and happily letting know it  :)


On Wed, Feb 20, 2008 at 8:29 PM, Kallin Nagelberg <kallin.nagelberg@...> wrote:
Awesome thanks, it works.

Incidentally, I tried removing the <set name="war>....</set> and it still works the same. It appears to just need the contextPath set....

Also, and this is getting picky, grails still says: 'Server running. Browse to http://localhost:8080/someProject'. Not a big deal, but maybe worthy of a bug report?


On Feb 20, 2008 4:08 AM, j pimmel <frankly.watson@...> wrote:
we did this yesterday

Add a web-jetty.xml containing the following to your web-app/WEB-INF folder

<?xml version="1.0"  encoding="ISO-8859-1"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd">
<Configure class="org.mortbay.jetty.webapp.WebAppContext">
  <Set name="contextPath">/</Set>
  <Set name="war"><SystemProperty name="jetty.home" default="."/>/webapps/((YOUR_WAR_NAME without extension))</Set>  << --- no brackets obviously  //webapps/foo   (its foo.war when packaged)
</Configure>

Hope that helps


On Feb 20, 2008 5:26 AM, Kallin Nagelberg <kallin.nagelberg@...> wrote:
Does anyone know how I can change the default webapp root when running grails?
I'd like to be able to configure it so i just hit http://localhost instead of http://localhost:8080/someProject.

I know when deploying to tomcat I could just create a ROOT.war. What about with jetty and grails?

Thanks!





Re: changing webapp root

by j pimmel :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

are u using the link taglib to generate your home link? we didnt have any problem moving context since the link taglib dealth with it seamlessly

On Thu, Feb 21, 2008 at 12:19 AM, Kallin Nagelberg <kallin.nagelberg@...> wrote:
I found another issue :|

So I have my web-jetty.xml file as below, which does allow me to access application without specifying project name.
However, The 'home' links on the scaffolding generated pages no longer work. Has anyone experienced this?


<?xml version="1.0"  encoding="ISO-8859-1"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd">
<Configure class="org.mortbay.jetty.webapp.WebAppContext">
    <Set name="contextPath">/</Set>
    <Set name="war">
        <SystemProperty name="jetty.home" default="."/>/webapps/myApp
    </Set>
</Configure>


On Wed, Feb 20, 2008 at 3:33 PM, j pimmel <frankly.watson@...> wrote:
yeah we noted the same.. its picking up on the ${grailsAppName} (we think) and happily letting know it  :)


On Wed, Feb 20, 2008 at 8:29 PM, Kallin Nagelberg <kallin.nagelberg@...> wrote:
Awesome thanks, it works.

Incidentally, I tried removing the <set name="war>....</set> and it still works the same. It appears to just need the contextPath set....

Also, and this is getting picky, grails still says: 'Server running. Browse to http://localhost:8080/someProject'. Not a big deal, but maybe worthy of a bug report?


On Feb 20, 2008 4:08 AM, j pimmel <frankly.watson@...> wrote:
we did this yesterday

Add a web-jetty.xml containing the following to your web-app/WEB-INF folder

<?xml version="1.0"  encoding="ISO-8859-1"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd">
<Configure class="org.mortbay.jetty.webapp.WebAppContext">
  <Set name="contextPath">/</Set>
  <Set name="war"><SystemProperty name="jetty.home" default="."/>/webapps/((YOUR_WAR_NAME without extension))</Set>  << --- no brackets obviously  //webapps/foo   (its foo.war when packaged)
</Configure>

Hope that helps


On Feb 20, 2008 5:26 AM, Kallin Nagelberg <kallin.nagelberg@...> wrote:
Does anyone know how I can change the default webapp root when running grails?
I'd like to be able to configure it so i just hit http://localhost instead of http://localhost:8080/someProject.

I know when deploying to tomcat I could just create a ROOT.war. What about with jetty and grails?

Thanks!






Re: changing webapp root

by kingdon :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

that's definitely quicker than installing Apache and using modproxy and the proxypass directives... http://httpd.apache.org/docs/1.3/mod/mod_proxy.html

in case you are already using apache

Example:
Suppose the local server has address http://wibble.org/; then

   ProxyPass         /mirror/foo/ http://foo.com/
ProxyPassReverse /mirror/foo/ http://foo.com/
I had a pretty strong background in Apache, not any so far in java or grails app development... need to get started quickstyle

Can anybody tell me if this is bad advice?  getting started guide to deploying web apps, should I use Jetty or Tomcat, is there anyone who has built Gravl recently can perhaps help me through the process?  i had no luck following the Ant build path.

I tried a couple of days ago from latest svn: http://code.google.com/p/gravl/

and my results were mixed... build complains when using Grails 1.0 that it was meant for 1.0+RC3 and when I tried with that version, my results were two failed tests resulted in no WAR file was created.  I'm not sure where to go from here, one of the tests requires a pre-existing zip file set of posts from a Pebble blog (and you better update the file path, it points to Glen's desktop)

Should I start with Pebble?  or just disable this test, and what about the other test

Thanks, (and sorry for thread-jacking)
Kingdon

On Wed, Feb 20, 2008 at 4:08 AM, j pimmel <frankly.watson@...> wrote:
we did this yesterday

Add a web-jetty.xml containing the following to your web-app/WEB-INF folder

<?xml version="1.0"  encoding="ISO-8859-1"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd">
<Configure class="org.mortbay.jetty.webapp.WebAppContext">
  <Set name="contextPath">/</Set>
  <Set name="war"><SystemProperty name="jetty.home" default="."/>/webapps/((YOUR_WAR_NAME without extension))</Set>  << --- no brackets obviously  //webapps/foo   (its foo.war when packaged)
</Configure>

Hope that helps


On Feb 20, 2008 5:26 AM, Kallin Nagelberg <kallin.nagelberg@...> wrote:
Does anyone know how I can change the default webapp root when running grails?
I'd like to be able to configure it so i just hit http://localhost instead of http://localhost:8080/someProject.

I know when deploying to tomcat I could just create a ROOT.war. What about with jetty and grails?

Thanks!




--
--
Kingdon Barrett
kingdon.barrett@...

Re: changing webapp root

by Kallin Nagelberg :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Like I said, I'm just using the scaffolding at this point. Does it use the link taglib? I'm not sure.


On Thu, Feb 21, 2008 at 5:16 AM, j pimmel <frankly.watson@...> wrote:
are u using the link taglib to generate your home link? we didnt have any problem moving context since the link taglib dealth with it seamlessly


On Thu, Feb 21, 2008 at 12:19 AM, Kallin Nagelberg <kallin.nagelberg@...> wrote:
I found another issue :|

So I have my web-jetty.xml file as below, which does allow me to access application without specifying project name.
However, The 'home' links on the scaffolding generated pages no longer work. Has anyone experienced this?


<?xml version="1.0"  encoding="ISO-8859-1"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd">
<Configure class="org.mortbay.jetty.webapp.WebAppContext">
    <Set name="contextPath">/</Set>
    <Set name="war">
        <SystemProperty name="jetty.home" default="."/>/webapps/myApp
    </Set>
</Configure>


On Wed, Feb 20, 2008 at 3:33 PM, j pimmel <frankly.watson@...> wrote:
yeah we noted the same.. its picking up on the ${grailsAppName} (we think) and happily letting know it  :)


On Wed, Feb 20, 2008 at 8:29 PM, Kallin Nagelberg <kallin.nagelberg@...> wrote:
Awesome thanks, it works.

Incidentally, I tried removing the <set name="war>....</set> and it still works the same. It appears to just need the contextPath set....

Also, and this is getting picky, grails still says: 'Server running. Browse to http://localhost:8080/someProject'. Not a big deal, but maybe worthy of a bug report?


On Feb 20, 2008 4:08 AM, j pimmel <frankly.watson@...> wrote:
we did this yesterday

Add a web-jetty.xml containing the following to your web-app/WEB-INF folder

<?xml version="1.0"  encoding="ISO-8859-1"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd">
<Configure class="org.mortbay.jetty.webapp.WebAppContext">
  <Set name="contextPath">/</Set>
  <Set name="war"><SystemProperty name="jetty.home" default="."/>/webapps/((YOUR_WAR_NAME without extension))</Set>  << --- no brackets obviously  //webapps/foo   (its foo.war when packaged)
</Configure>

Hope that helps


On Feb 20, 2008 5:26 AM, Kallin Nagelberg <kallin.nagelberg@...> wrote:
Does anyone know how I can change the default webapp root when running grails?
I'd like to be able to configure it so i just hit http://localhost instead of http://localhost:8080/someProject.

I know when deploying to tomcat I could just create a ROOT.war. What about with jetty and grails?

Thanks!







Re: changing webapp root

by Kallin Nagelberg :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Looks like it does. This is the code:
<a class="home" href="${createLinkTo(dir:'')}">Home</a>

Could it be a problem with the scaffolding? What should be supplied to link to the root?
I've found that using dir:"." ( as opposed to dir:"")  works well for both root and non-root contexts.



On Thu, Feb 21, 2008 at 4:57 PM, Kallin Nagelberg <kallin.nagelberg@...> wrote:
Like I said, I'm just using the scaffolding at this point. Does it use the link taglib? I'm not sure.



On Thu, Feb 21, 2008 at 5:16 AM, j pimmel <frankly.watson@...> wrote:
are u using the link taglib to generate your home link? we didnt have any problem moving context since the link taglib dealth with it seamlessly


On Thu, Feb 21, 2008 at 12:19 AM, Kallin Nagelberg <kallin.nagelberg@...> wrote:
I found another issue :|

So I have my web-jetty.xml file as below, which does allow me to access application without specifying project name.
However, The 'home' links on the scaffolding generated pages no longer work. Has anyone experienced this?


<?xml version="1.0"  encoding="ISO-8859-1"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd">
<Configure class="org.mortbay.jetty.webapp.WebAppContext">
    <Set name="contextPath">/</Set>
    <Set name="war">
        <SystemProperty name="jetty.home" default="."/>/webapps/myApp
    </Set>
</Configure>


On Wed, Feb 20, 2008 at 3:33 PM, j pimmel <frankly.watson@...> wrote:
yeah we noted the same.. its picking up on the ${grailsAppName} (we think) and happily letting know it  :)


On Wed, Feb 20, 2008 at 8:29 PM, Kallin Nagelberg <kallin.nagelberg@...> wrote:
Awesome thanks, it works.

Incidentally, I tried removing the <set name="war>....</set> and it still works the same. It appears to just need the contextPath set....

Also, and this is getting picky, grails still says: 'Server running. Browse to http://localhost:8080/someProject'. Not a big deal, but maybe worthy of a bug report?


On Feb 20, 2008 4:08 AM, j pimmel <frankly.watson@...> wrote:
we did this yesterday

Add a web-jetty.xml containing the following to your web-app/WEB-INF folder

<?xml version="1.0"  encoding="ISO-8859-1"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd">
<Configure class="org.mortbay.jetty.webapp.WebAppContext">
  <Set name="contextPath">/</Set>
  <Set name="war"><SystemProperty name="jetty.home" default="."/>/webapps/((YOUR_WAR_NAME without extension))</Set>  << --- no brackets obviously  //webapps/foo   (its foo.war when packaged)
</Configure>

Hope that helps


On Feb 20, 2008 5:26 AM, Kallin Nagelberg <kallin.nagelberg@...> wrote:
Does anyone know how I can change the default webapp root when running grails?
I'd like to be able to configure it so i just hit http://localhost instead of http://localhost:8080/someProject.

I know when deploying to tomcat I could just create a ROOT.war. What about with jetty and grails?

Thanks!