The embedded servlet container (Jetty) can host the servlets that contain your service implementation. This means you can take advantage of running your application in development mode while testing and debugging the server-side Java code.
To set this up, add <servlet> and <servlet-mapping> elements to the web application deployment descriptor (web.xml) and point to the implementation class (StockPriceServiceImpl).
Starting with GWT 1.6, servlets should be defined in the web application deployment descriptor (web.xml) instead of the GWT module (StockWatcher.gwt.xml).
In the <servlet-mapping> element, the url-pattern can be in the form of an absolute directory path (for example, /spellcheck
or /common/login
).
If
you specify a default service path with a @RemoteServiceRelativePath
annotation on the service interface (as you did with StockPriceService),
then make sure the url-pattern matches the annotation value.
Because you've mapped the StockPriceService to "stockPrices" and the
module rename-to attribute in StockWatcher.gwt.xml is "stockwatcher",
the full URL will be:
http://localhost:8888/stockwatcher/stockPrices
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<!-- Default page to serve -->
<welcome-file-list>
<welcome-file>StockWatcher.html</welcome-file>
</welcome-file-list>
<!-- Servlets -->
<servlet>
<servlet-name>stockPriceServiceImpl</servlet-name>
<servlet-class>com.google.gwt.sample.stockwatcher.server.StockPriceServiceImpl</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>stockPriceServiceImpl</servlet-name>
<url-pattern>/stockwatcher/stockPrices</url-pattern>
</servlet-mapping>
</web-app>
http://localhost:8888/stockwatcher/stockPrices 이렇게 매핑된다고 한다.
즉 StockWatcher.gwt.xml의 "<module rename-to='stockwatcher'>"
부분이 context root 가 되는 것 같다.주(week)로 부터 날짜 리턴 (0) | 2012.10.25 |
---|---|
GC 분석을 위한 Heap Dump 생성 option (0) | 2012.02.15 |
Java HeapDump 생성하는 옵션 (0) | 2011.12.08 |
[Java thread] run()에 data 전달하기. (0) | 2011.11.28 |
JarClassFinder (0) | 2011.11.08 |
댓글 영역