GWT development mode in Eclipse
来源:互联网 发布:淘宝旺铺装修代码 编辑:程序博客网 时间:2024/06/05 08:52
原文:http://wiki.magnolia-cms.com/display/DEV/GWT+development+mode+in+Eclipse
GWT development mode in Eclipse
- Intro
- Local GWT dev mode
- Remote GWT dev mode
- GWTShell options
Intro
When developing with Magnolia you might need to set up GWT dev mode in Eclipse, in particular if you need to work on thepage editor module, which is basically responsible for injecting edit bars in a page for various components (areas, paragraphs, etc.) when in authoring mode. This module is entirely built with GWT and therefore we need to create a proper GWT dev launch configuration which enables us to debug our client code both locally and remotely (i.e. browser running on a machine other than the development one).
Local GWT dev mode
- Open Run -> Debug Configurations... and create a new Java Application configuration. Browse to choose themagnolia-templating-editor project and GWTShell main class. In case the latter is not on your classpath, you should add thegwt-dev-x.y.z.jar to it by clicking on the Classpath tab.
- Now click on the Arguments tab and add the following program arguments.
-noserver -out src/main/resources/mgnl-resources/editor url http:
//localhost:8080/magnolia-empty-webapp/somepage.html
- Also increase your Java memory by adding these parameters into the JVM arguments (these values can actually be adjusted depending on the available physical memory on your dev machine).
-Xmx512m -Xms256m
- Then add the magnolia-templating-editor project and sources respectively in theClasspath and Source tabs. Be aware that GWT development mode looks for modules (and therefore client-side source) using the JVM's classpath.Therefore, make sure to add your source directories first in your classpath. See also http://code.google.com/webtoolkit/doc/latest/DevGuideCompilingAndDebugging.html#How_do_I_use_my_own_server_in_development_mode_instead_of_GWT's
In case you get errors concerning Magnolia custom widgets classes not being found and therefore not added to the widgetset, you might need to explicitly add thevalidation API jar to the Classpath.
That's it. You can now launch your magnolia webapp in debug mode as usual and then start the newly created debug configuration. A GWT development mode window should show up, like in the picture below.
- Click on Launch Default Browser to start your browser and go to the application. As you can see the gwt debug parametergwt.codesvr=127.0.0.1:9997 was automatically added to the URL. If this is your first time using that browser with the development mode server, it will prompt you to install the Google Web Toolkit Developer Plugin. Follow the instructions in the browser to install.
At first the app will take a while to start up as GWT will recompile your widgetset. Once done, you will be able to set breakpoints in GWT code and debug the client part of your web application as if it were plain Java server side code.
Remote GWT dev mode
If you need to debug client code running on a machine other than the one you're using for development (typical case, debugging your code on IE), then you need to set up your GWT configuration by only adding the-bindAddress parameter to it. For example
-noserver -bindAddress
192.168
.
10.64
-out src/main/resources/mgnl-resources/editor url http:
//localhost:8080/magnolia-empty-webapp/somepage.html
The argument to -bindAddress is your dev box IP. Now you should be able to start up your VirtualBox/Parallel instance or a real Windows box and connect to the server with a URL such as the following one. Once connected, you will be able to proceed testing and debugging as if the client code were running on your local dev machine.
http:
//192.168.10.64:8080/magnolia-empty-webapp/somepage.html?gwt.codesvr=192.168.10.64:9997
GWTShell options
GWTShell [-noserver] [-port port-number |
"auto"
] [-whitelist whitelist-string] [-blacklist blacklist-string] [-logdir directory] [-logLevel level] [-gen dir] [-bindAddress host-name-or-address] [-codeServerPort port-number |
"auto"
] [-out dir] [url]
where
-noserver Prevents the embedded web server from running
-port Specifies the TCP port
for
the embedded web server (defaults to
8888
)
-whitelist Allows the user to browse URLs that match the specified regexes (comma or space separated)
-blacklist Prevents the user browsing URLs that match the specified regexes (comma or space separated)
-logdir Logs to a file in the given directory, as well as graphically
-logLevel The level of logging detail: ERROR, WARN, INFO, TRACE, DEBUG, SPAM, or ALL
-gen Debugging: causes normally-
transient
generated types to be saved in the specified directory
-bindAddress Specifies the bind address
for
the code server and web server (defaults to
127.0
.
0.1
)
-codeServerPort Specifies the TCP port
for
the code server (defaults to
9997
)
-out The directory to write output files into (defaults to current)
and
url Automatically launches the specified URL
- GWT development mode in Eclipse
- Eclipse Plug-in Development Tutorial
- Eclipse Plun-in development reference
- Eclipse CDT Plug-in Development
- RTC Eclipse Plug-in Development
- Eclipse Plug-in Development Tutorial
- Vue去掉警告 You are running Vue in development mode
- JADE Development Plug-in for Eclipse (EJADE)
- Development Mode 和 Production Mode
- Top 10 mistakes in Eclipse Plug-in Development
- GWT in Practice
- Pro Web 2.0 Application Development with GWT
- Design Patterns used in Eclipse Plugins Development(DMIDE)
- Facebook Development and Authentation Mode
- Struts 2 development mode 漏洞
- 翻译:GWT IN ACTION----gwt介绍;
- gwt eclipse 插件 googlipse
- eclipse 安装 gwt
- iOS应用崩溃日志揭秘
- Ruby on Rails问题收集
- opencv中矩阵赋值
- win7安装vs2012失败
- Linux 搭建SVN 服务器
- GWT development mode in Eclipse
- 题目1205:N阶楼梯上楼问题
- QML-ListView
- MessageDigest 例子
- C语言经典算法100例-025-求1+2!+3!+...+20!的和
- 电子词典(用map改写)
- 菜鸟如何用servlet模拟一个简单的登陆
- ADF11g-039: 禁用ADF IE兼容模式
- ie设置默认,打开快捷方式会弹出2个浏览器网页