In this showcase you can find details how to start working with FireWeb framework. I assume that you have installed Tomcat in the environment or any other application server and tools such as Eclipse. Here i refer to my favorite Eclipse.
OK, so we start build first application.
Press Finish button with default values.
If
you want to use sources from SVN repository, skip this and
next step. Core FireWeb module sources are available at https://svn.code.sf.net/p/fireweb/svn/eclipse/fireweb-core.
Switch to tab Order and Export and select option Maven Dependencies.
From project context menu select option New / Package.
Leave defaults and press button Finish.
Next,
from project context menu select option New / Class.
Fill
form as on picture above and press button Finish.
<?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0"> <display-name>firststep</display-name> <servlet> <description>FireWeb First Step</description> <display-name>FireWeb First Step cookbook</display-name> <servlet-name>firststep</servlet-name> <servlet-class>org.fireweb.FireWebServlet</servlet-class> <init-param> <description>FireWeb class implemented application</description> <param-name>class</param-name> <param-value>firststep.Main</param-value> </init-param> <load-on-startup>1</load-on-startup> <async-supported>true</async-supported> </servlet> <servlet-mapping> <servlet-name>firststep</servlet-name> <url-pattern>/firststep</url-pattern> </servlet-mapping> <welcome-file-list> <welcome-file>firststep</welcome-file> </welcome-file-list> </web-app>
public class Main extends FireWebApplication { /** * */ private static final long serialVersionUID = 2169862264662104969L; /** * Default constructor */ public Main() { /* * Simple text with some HTML includes */ setText("Hello world !!! FireWeb is easy :)"); /* * Setup head/title text of browser tab name. */ setApplicationTitle("The First Step app"); } }
From Tomacat server context menu select option Add
and Remove....
On
left select "firststep" project and press buttton Add, next
Finish.
Go to Servers
tab, select line with Tomcat server and press Restart
the server button on toolbar.
At console tab
you should see below log line.
At browser address bar write http://localhost:8080/firststep/
and press Enter.
You
should see result as above.
Code of this show case in Eclipse format you can download form here.
FireWeb core module is available at Maven repository:
<dependency> <groupId>net.sf.fireweb</groupId> <artifactId>fireweb-core</artifactId> <version>RELEASE</version> </dependency>
You can find all maven releases at Maven Central Repository