blob: 571dbc39f3c7afb4b257f7ed12c91f11f1c921eb [file] [log] [blame]
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>4.2&nbsp;GreenPages set up</title><link rel="stylesheet" href="css/stylesheet.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.74.0"><link rel="home" href="index.html" title="Creating an application with EclipseRT Virgo Web Server"><link rel="up" href="ch04.html" title="4.&nbsp;The Web Module"><link rel="prev" href="ch04.html" title="4.&nbsp;The Web Module"><link rel="next" href="ch04s03.html" title="4.3&nbsp;The controller"><!--Begin Google Analytics code--><script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script><script type="text/javascript">
var pageTracker = _gat._getTracker("UA-2728886-3");
pageTracker._setDomainName("none");
pageTracker._setAllowLinker(true);
pageTracker._trackPageview();
</script><!--End Google Analytics code--></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">4.2&nbsp;GreenPages set up</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch04.html">Prev</a>&nbsp;</td><th width="60%" align="center">4.&nbsp;The Web Module</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="ch04s03.html">Next</a></td></tr></table><hr></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="setting.up"></a>4.2&nbsp;GreenPages set up</h2></div></div></div><p>
Before beginning, configure the development environment to work with the
application. In the case of GreenPages this means Maven and Eclipse.
</p><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="setting.up.eclipse"></a>Setting up Eclipse (STS)</h3></div></div></div><p>
The following sections are most easily followed in the Java (or Spring) perspective (not, for example, the Java EE
perspective). If not already in an appropriate perspective, switch in SpringSource Tool Suite using the
<span class="guimenu">Open Perspective</span> menu:
</p><div class="mediaobject" align="center"><img src="images/web-module/java-perspective.png" align="middle"></div><p>
</p><p>
In this step create a reference to the Web Server instance that the GreenPages application
integrates with (the instance may already be created if the GreenPages solution has been run from STS).
</p><p>
In STS open <span class="guimenu">Preferences</span> &#8594; <span class="guimenuitem">Server</span> &#8594; <span class="guimenuitem">Runtime Environments</span>. Select <span class="emphasis"><em>Add&#8230;</em></span> to create a
new Web Server runtime environment. In the dialog that opens, select the <span class="emphasis"><em>Virgo Web Server
(runtime) v2.1</em></span> and check the box to <span class="emphasis"><em>Create a new local server</em></span>.
When complete, press <span class="emphasis"><em>Next</em></span>.
</p><div class="mediaobject" align="center"><img src="images/web-module/new-server-runtime-environment.png" align="middle"></div><p>
</p><p>
In the next dialog, set the <span class="emphasis"><em>Virgo Web Server installation directory</em></span> field to the
<span class="emphasis"><em>value</em></span> of <code class="literal">$VWS_HOME</code> and
check that the <span class="emphasis"><em>JRE:</em></span> option is set to Java 1.6 or later.
<span class="emphasis"><em>This may not be the workbench default.</em></span>
When complete, press <span class="emphasis"><em>Finish</em></span>.
</p><div class="mediaobject" align="center"><img src="images/web-module/virgo-web-server.png" align="middle"></div><p>
</p><p>
After returning to the <span class="emphasis"><em>Preferences</em></span> window, press <span class="emphasis"><em>OK</em></span> to return to
Eclipse.
The <span class="emphasis"><em>Servers</em></span> view has opened and now shows an instance of
<span class="emphasis"><em>Virgo Web Server</em></span> in it.
</p><div class="mediaobject" align="center"><img src="images/web-module/servers-view.png" align="middle"></div><p>
There is also a <span class="emphasis"><em>Servers</em></span> project, in which the server is listed.
</p></div></div><!--Begin LoopFuse code--><script src="http://loopfuse.net/webrecorder/js/listen.js" type="text/javascript"></script><script type="text/javascript">
_lf_cid = "LF_48be82fa";
_lf_remora();
</script><!--End LoopFuse code--><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch04.html">Prev</a>&nbsp;</td><td width="20%" align="center"><a accesskey="u" href="ch04.html">Up</a></td><td width="40%" align="right">&nbsp;<a accesskey="n" href="ch04s03.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">4.&nbsp;The Web Module&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&nbsp;4.3&nbsp;The controller</td></tr></table></div></body></html>