1 STRUTS 2 - Practical examples Krystyna Bury Katarzyna Sadowska Joanna Pyc Politechnika Wrocławska Wydział Informatyki i Zarządzania Informatyka, III rok
2 Spis treści What will we need? 1 What will we need? 2 3 Tell Eclipse about 4
3 What will we need? Eclipse IDE for Java EE Developers (Can be normal Eclipse with Web Tools Platform) Java version 5 or newer Apache Server v6 Struts2 Framework
4 Download Eclipse IDE for Java EE Developers and unpack it. Download the latest version of Java and install it. Download the Struts2 framework and unpack it.
5 What will we need? Tell Eclipse about Change the Port to 80 Turn on Servlet Reloading Enable the Invoker Servlet Turn on Directory Listings Tell Eclipse about
6 : What will we need? Tell Eclipse about Change the port from 8080 to 80 This lets you enter URLs of the form instead of If this is not done during installation, it can be configured later on if need be. Don t start the server after installation is complete.
7 : (1) Tell Eclipse about The port is changed from 8080 to 80. This lets you enter URLs of the form instead of The invoker servlet is enabled. This lets run servlets with a URL of the form That is, the invoker servlet saves you from editing web.xml to give a servlet-mapping to your servlet. When you download from the Apache site, the invoker servlet is disabled. You definitely want the invoker servlet disabled on a server used for a deployed application, but having it enabled on your development server is very convenient for quick testing.
8 : (1) Tell Eclipse about monitors struts-config.xml and faces-config.xml. Whenever either of these files changes, reloads the Web application. This saves you from restarting the server when you change these files. If you do not use Struts or JSF, this change will not be beneficial to you. But it does not hurt either way. Directory listings are turned on. If you type a URL ending in / and there is no welcome file, shows a directory listing. Directory listings were on by default in previous versions. They are not required but are convenient, especially during development.
9 : (2) Tell Eclipse about Change the Port to 80 edit install dir/conf/server.xml and change the port attribute of the Connector element from 8080 to 80, yielding a result similar to that below: <Connector port= 80 protocol= HTTP/1.1 connectiontimeout= redirectport= 8443 />
10 : (3) Tell Eclipse about Turn on Servlet Reloading The next step is to tell to check the modification dates of the class files of requested servlets, and reload ones that have changed since they were loaded into the server s memory. This slightly degrades performance in deployment situations, so is turned off by default. However, if you fail to turn it on for your development server, you ll have to restart the server every time you recompile a servlet that has already been loaded into the server s memory. Since this tutorial discusses the use of for development, this change is strongly recommended. To turn on servlet reloading, edit install dir/conf/context.xml and change: <Context> to <Context reloadable= true privileged= true >
11 : (3) Tell Eclipse about Note that the privileged entry is really to support the invoker servlet (see the following section), so you can omit that entry if you do not use the invoker.
12 : (4) Tell Eclipse about Enable the Invoker Servlet To enable the invoker servlet, uncomment the following servlet and servlet-mapping elements in install dir/conf/web.xml. <servlet> <servlet-name> invoker </servlet-name> <servlet-class> org.apache.catalina.servlets.invokerservlet </servlet-class>... </servlet>... <servlet mapping> <servlet-name> invoker </servlet-name> <url pattern> /servlet/* </url pattern> </servlet mapping>
13 : (4) Tell Eclipse about In 6 (but not 5.5), you also need the privileged= true entry in the Context element of context.xml.
14 : (5) Tell Eclipse about Turn on Directory Listings In previous versions, if you entered a URL ending in a slash (/) and there was no welcome-file in the directory (or servlet-mapping that matched the URL), displayed a directory listing. In 6, the default was changed from true to false for these directory listings. Many developers find it convenient to turn directory listings back on. To make this change, edit install dir/conf/web.xml and change the init-param value of listings for the default servlet, as below.
16 Tell Eclipse about (1) Tell Eclipse about Start Eclipse and select Workbench. Click on Servers tab at the bottom, then: Right-click -> New -> Server -> Apache -> v6.0 -> to folder ->OK.
17 Tell Eclipse about (2) Tell Eclipse about Click on Servers tab at bottom. R-click on v6.0, choose Start. Open in a browser: you should see an empty page showing a blank directory listing (but not a 404 error).
18 Use File, Import, Web, WAR file. Then click Browse and navigate to the folder where you unpacked the Struts2 framework. Go to... \apps and select the struts2-blank-2.x.x.war application. Give the project a name, for example: Struts2Demo. Click on Servers tab at bottom. Right-click on v6.0 Server, choose Add and Remove Projects. Choose Struts2Demo. Start if not already running. Try the following URL in a browser:
Installation Guide for contineo Sebastian Stein Michael Scholz 2007-02-07, contineo version 2.5 Contents 1 Overview 2 2 Installation 2 2.1 Server and Database....................... 2 2.2 Deployment............................
Zanibal Plug-in For Microsoft Outlook Installation & User Guide Version 1.1 Zanibal LLC Phone: +1-408-887-0480, +234-1-813-1744 Email: email@example.com www.zanibal.com Copyright 2012, Zanibal LLC. All
Allworx OfficeSafe Operations Guide Release 6.0 No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, photocopy,
Installation / Backup \ Restore of a Coffalyser.Net server database using SQL management studio This document contains instructions how you can obtain a free copy of Microsoft SQL 2008 R2 and perform the
FileMaker Server 13 FileMaker Server Help 2010-2013 FileMaker, Inc. All Rights Reserved. FileMaker, Inc. 5201 Patrick Henry Drive Santa Clara, California 95054 FileMaker and Bento are trademarks of FileMaker,
Metadata Import Plugin User manual User manual for Metadata Import Plugin 1.0 Windows, Mac OS X and Linux August 30, 2013 This software is for research purposes only. CLC bio Silkeborgvej 2 Prismet DK-8000
4 Scala InfoChannel Content Manager 5 Backup and Restore Instructions This document describes how to backup and restore Scala InfoChannel Content Manager 5. Databases currently supported are: PostgreSQL
18.1 user guide No Magic, Inc. 2014 All material contained herein is considered proprietary information owned by No Magic, Inc. and is not to be shared, copied, or reproduced by any means. All information
DEPLOYMENT GUIDE Version 1.2 Deploying the BIG-IP System v10 with Microsoft IIS 7.0 and 7.5 Table of Contents Table of Contents Deploying the BIG-IP system v10 with Microsoft IIS Prerequisites and configuration
Introduction to the AirWatch Cloud Connector (ACC) Guide The AirWatch Cloud Connector (ACC) provides organizations the ability to integrate AirWatch with their back-end enterprise systems. This document
1 How to Scale out SharePoint Server 2007 from a single server farm to a 3 server farm with Microsoft Network Load Balancing on the Web servers. Back to Basics Series By Steve Smith, MVP SharePoint Server,
Reconfiguring VMware vsphere Update Manager vsphere Update Manager 6.0 This document supports the version of each product listed and supports all subsequent versions until the document is replaced by a
Ready Reference Guide Customizing an Output Style September 2008 Customizing an Output Style Table of Contents Overview Page 3 Getting Started Page 4 Modifying an Output Style Page 6 Sharing a Style With
Tips and Tricks for increasing your efficiency in Microsoft Outlook 1. Creating and managing folders Creating and managing folders in Outlook can help you keep track of important emails/ information and
Lab 3: Evaluating Application Performance across a WAN Objective In this lab, we have a small LAN with 20 users for a startup company named Deltasoft Technologies. We investigate the application performance
LogMeIn Backup User Guide Contents About LogMeIn Backup...4 Getting Started with LogMeIn Backup...5 How does LogMeIn Backup Work, at-a-glance?...5 About Security in LogMeIn Backup...5 LogMeIn Backup System
ESET REMOTE ADMINISTRATOR Migration guide ESET REMOTE ADMINISTRATOR migration guide Copyright 2012 by ESET, spol. s r.o. ESET REMOTE ADMINISTRATOR was developed by ESET, spol. s r.o. For more information
Service Desk Plus: User Guide Introduction ManageEngine ServiceDesk Plus is comprehensive help desk and asset management software that provides help desk agents and IT managers, an integrated console to
User's Manual Intego Remote Management Console User's Manual Page 1 Intego Remote Management Console for Macintosh 2007 Intego, Inc. All Rights Reserved Intego, Inc. www.intego.com This manual was written
FileMaker Server 12 FileMaker Server Help 2010-2012 FileMaker, Inc. All Rights Reserved. FileMaker, Inc. 5201 Patrick Henry Drive Santa Clara, California 95054 FileMaker is a trademark of FileMaker, Inc.