Running gwt app with custom context root

1,689 views
Skip to first unread message

Antonio

unread,
May 7, 2010, 2:17:18 PM5/7/10
to Google Web Toolkit
I need to run my GWT application with custom context root.

When i run the project plugin start server with empty context root eg:
http://127.0.0.1:8888/MyApp.html?gwt.codesvr=127.0.0.1:9997

I need this:
http://127.0.0.1:8888/myapp/MyApp.html?gwt.codesvr=127.0.0.1:9997

The application must run on http://127.0.0.1:8888/myapp instead of
http://127.0.0.1:8888

I'm using GWT 2.0.3 and lastest plugin.

thx.

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

Tristan

unread,
May 8, 2010, 11:37:34 AM5/8/10
to Google Web Toolkit
You can just put the second address in your browser and bookmark it.
What are you trying to automate?

On May 7, 1:17 pm, Antonio <antonio...@gmail.com> wrote:
> I need to run my GWT application with custom context root.
>
> When i run the project plugin start server with empty context root eg:http://127.0.0.1:8888/MyApp.html?gwt.codesvr=127.0.0.1:9997
>
> I need this:http://127.0.0.1:8888/myapp/MyApp.html?gwt.codesvr=127.0.0.1:9997
>
> The application must run onhttp://127.0.0.1:8888/myappinstead ofhttp://127.0.0.1:8888

Manuel Carrasco Moñino

unread,
May 9, 2010, 1:56:46 AM5/9/10
to google-we...@googlegroups.com
This is the expected behavior of Google Eclipse Plugin. It runs
without context because it is able to handle various app contexts at
same time and it only search for .html files to startup in the war/
folder.
Said that, you have either:
1.- Move your MyApp.html file to the root of your war folder, edit it,
and replace myapp.nocache.js by myapp/myapp.nocache.js
2.- Leave MyApp.html in the public directory of your app, and add the
parameter -startupUrl myapp/MyApp.html to the launcher:
Run -> Run Configurations -> Web Application -> MyApp -> Arguments ->
Program Arguments.

-Manolo

Antonio

unread,
May 12, 2010, 9:43:58 AM5/12/10
to Google Web Toolkit
The problem is: I have some pages with css and images who are linked
eg: /myapp/images/image.jpg, but running under GWT plugin the path to
same image is /images/image.jpg.

Under production I can't run the application in root directory from
the server.

On 9 maio, 02:56, Manuel Carrasco Moñino <man...@apache.org> wrote:
> This is the expected behavior of Google Eclipse Plugin. It runs
> without context because it is able to handle various app contexts  at
> same time and it only search for .html files to startup in the war/
> folder.
> Said that, you have either:
> 1.- Move your MyApp.html file to the root of your war folder, edit it,
> and replace myapp.nocache.js by myapp/myapp.nocache.js
> 2.- Leave MyApp.html in the public directory of your app, and add the
> parameter -startupUrl myapp/MyApp.html to the launcher:
> Run -> Run Configurations -> Web Application -> MyApp -> Arguments ->
> Program Arguments.
>
> -Manolo
>
>
>
> On Fri, May 7, 2010 at 8:17 PM, Antonio <antonio...@gmail.com> wrote:
> > I need to run my GWT application with custom context root.
>
> > When i run the project plugin start server with empty context root eg:
> >http://127.0.0.1:8888/MyApp.html?gwt.codesvr=127.0.0.1:9997
>
> > I need this:
> >http://127.0.0.1:8888/myapp/MyApp.html?gwt.codesvr=127.0.0.1:9997
>
> > The application must run onhttp://127.0.0.1:8888/myappinstead of
> >http://127.0.0.1:8888
>
> > I'm using GWT 2.0.3 and lastest plugin.
>
> > thx.
>
> > --
> > You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
> > To post to this group, send email to google-we...@googlegroups.com.
> > To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
> > For more options, visit this group athttp://groups.google.com/group/google-web-toolkit?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
> To post to this group, send email to google-we...@googlegroups.com.
> To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
> For more options, visit this group athttp://groups.google.com/group/google-web-toolkit?hl=en.

Antonio

unread,
May 12, 2010, 10:29:15 AM5/12/10
to Google Web Toolkit
The problem was solved and solution is very simple, since gwt plugin
uses jetty as web container just put jetty-web.xml in the WEB-INF
folder.
This file specifies the context root of application.

Content of jetty-web.xml:

<?xml version="1.0" encoding="UTF-8"?>
<!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">/myapp</Set>

</Configure>

thx 4 all :)
Antonio.

juan manuel rojas ronquillo

unread,
May 24, 2014, 9:12:58 PM5/24/14
to google-we...@googlegroups.com
Thanks Antonio. Works great
Then I just added myapp in my pom.xml

<!-- GWT Maven Plugin -->

<configuration>
          <runTarget>myapp/index.jsp</runTarget>
          <hostedWebapp>${webappDirectory}</hostedWebapp>
          <i18nMessagesBundle>com.rhem.shared.Messages</i18nMessagesBundle>
          <extraJvmArgs>-XX:MaxPermSize=512m -Xmx2048m</extraJvmArgs>
        </configuration> 


El miércoles, 12 de mayo de 2010 09:29:15 UTC-5, Antonio R. de Oliveira escribió:
The problem was solved and solution is very simple, since gwt plugin
uses jetty as web container just put jetty-web.xml in the WEB-INF
folder.
This file specifies the context root of application.

Content of jetty-web.xml:

<?xml version="1.0"  encoding="UTF-8"?>
<!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">/myapp</Set>

</Configure>

thx 4 all :)
Antonio.

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages