Struts 2 - Practical examples



Similar documents
Apache JMeter HTTP(S) Test Script Recorder

BusinessObjects Enterprise XI Release 2

JHU/EP Server Originals of Slides and Source Code for Examples:

WA2102 Web Application Programming with Java EE 6 - WebSphere RAD 8.5. Classroom Setup Guide. Web Age Solutions Inc. Web Age Solutions Inc.

Workshop for WebLogic introduces new tools in support of Java EE 5.0 standards. The support for Java EE5 includes the following technologies:

IBM Bluemix Tutorial Connecting Eclipse to Bluemix v2.0

Building Web Services with Apache Axis2

Development. with NetBeans 5.0. A Quick Start in Basic Web and Struts Applications. Geertjan Wielenga

Epidefender Studio Installation notice

Server Setup and Configuration

Web Applications. For live Java training, please see training courses at

IIS, FTP Server and Windows

Configuring the Samsung SDS CellWe EMM cloud connector

Installation Guide for contineo

T320 E-business technologies: foundations and practice

IUCLID 5 Guidance and Support

JBoss SOAP Web Services User Guide. Version: M5

Building and Using Web Services With JDeveloper 11g

QUANTIFY INSTALLATION GUIDE

SSC - Web applications and development Introduction and Java Servlet (II)

Installing the Android SDK

To begin, visit this URL:

ECA IIS Instructions. January 2005

& JSP Technology Originals of Slides and Source Code for Examples:

Windows 7 Hula POS Server Installation Guide

1. CONFIGURING REMOTE ACCESS TO SQL SERVER EXPRESS

Magento Search Extension TECHNICAL DOCUMENTATION

Download and Installation Instructions. Android SDK and Android Development Tools (ADT) Microsoft Windows

Monitoring Oracle Enterprise Performance Management System Release Deployments from Oracle Enterprise Manager 12c

Installation Instructions

Tutorial for Avaya 4600 and 9600 Series IP Telephones Push and Browser Applications Setup

Creating Java EE Applications and Servlets with IntelliJ IDEA

Install SQL Server 2014 Express Edition

Create a Web Service from a Java Bean Test a Web Service using a generated test client and the Web Services Explorer

CLC Bioinformatics Database

IBM TRIRIGA Anywhere Version 10 Release 4. Installing a development environment

PowerTier Web Development Tools 4

How To Integrate IIS6 and Apache Tomcat

An Overview of Servlet & JSP Technology

ICONICS Using the Azure Cloud Connector

Upgrading Your Web Server from ClientBase Browser Version 2.0 or Above to Version 2.1.1

Configuring Apache HTTP Server as a Reverse Proxy Server for SAS 9.2 Web Applications Deployed on BEA WebLogic Server 9.2

How to add your Weebly website to a TotalCloud hosted Server

Wavecrest Certificate

2011 Marty Hall An Overview of Servlet & JSP Technology Customized Java EE Training:

SSO Plugin. J System Solutions. Upgrading SSO Plugin 3x to 4x - BMC AR System & Mid Tier.

How-to: Single Sign-On

Installing and Running Tomcat 5.5

Lab Introduction to Web Services

How To Install And Set Up The Database For Quicdoc And Office Therapy (The Applications)

EMC Documentum Content Services for SAP Repository Manager

Getting Started with Web Applications

tpischeduler tpischeduler TotalFBO tpischeduler TotalFBO Initial Installation tpischeduler TotalFBO tpischeduler

GETTING STARTED WITH SQL SERVER

Tool Tip. SyAM Management Utilities and Non-Admin Domain Users

Synchronizer Installation

Windows Firewall Configuration with Group Policy for SyAM System Client Installation

Android Programming: Installation, Setup, and Getting Started

Information & Communication Technologies FTP and GroupWise Archives Wilfrid Laurier University

Configuring IIS 6 to Load Balance a JBoss 4.2 Adobe LiveCycle Enterprise Suite 2 (ES2) Cluster

The Server.xml File. Containers APPENDIX A. The Server Container

Basic Exchange Setup Guide

Supplement IV.E: Tutorial for Tomcat. For Introduction to Java Programming By Y. Daniel Liang

Lab 5 Using Remote Worklight Server

TSM for Windows Installation Instructions: Download the latest TSM Client Using the following link:

Controlling Web Application Behavior

USING SSL/TLS WITH TERMINAL EMULATION

How To Create An Easybelle History Database On A Microsoft Powerbook (Windows)

Practice Fusion API Client Installation Guide for Windows

MadCap Software. Upgrading Guide. Pulse

AVG Business SSO Connecting to Active Directory

DAVE Usage with SVN. Presentation and Tutorial v 2.0. May, 2014

Livezilla How to Install on Shared Hosting By: Jon Manning

T320 E-business technologies: foundations and practice

EQUELLA. Clustering Configuration Guide. Version 6.0

Acrolinx IQ. Acrolinx IQ Plug-in for Adobe CQ Rich Text Editor Installation Guide Version: 2.9

Configuring Secure Socket Layer (SSL) for use with BPM 7.5.x

Tutorial: setting up a web application

This tutorial provides detailed instructions to help you download and configure Internet Explorer 6.0 for use with Web Commerce application.

1 Building, Deploying and Testing DPES application

HP Service Manager. Software Version: 9.40 For the supported Windows and Linux operating systems. Collaboration Guide

Setting Up SSL on IIS6 for MEGA Advisor

1. Tutorial Overview

Getting Started using the SQuirreL SQL Client

Download and Installation Instructions. Android SDK and Android Development Tools (ADT)

Connecting System Platform to TOP Server. Using the SuiteLink DI Object

HP Service Manager. Collaboration Guide. For the Supported Windows and UNIX operating systems. Software Version: 9.31

Jenkins on Windows with StreamBase

Google App Engine f r o r J av a a v a (G ( AE A / E J / )

Information Technology Services

Deploying a Logi Info Application on WAS

Basic Exchange Setup Guide

JMETER - MONITOR TEST PLAN

Scoreboard 2.5/2.7 Installation Guide. For Apache Tomcat 7.0 On Windows 2003/2008 Server, 64-bit

Crystal Reports for Eclipse

Installing Windows Server Update Services (WSUS) on Windows Server 2012 R2 Essentials

Security Guidelines for MapInfo Discovery 1.1

SECURE MOBILE ACCESS MODULE USER GUIDE EFT 2013

Using Internet or Windows Explorer to Upload Your Site

AppLoader7. Windows Server 2008 Injector Optimization. Protocol Independent Load Testing

Transcription:

STRUTS 2 - Practical examples Krystyna Bury Katarzyna Sadowska Joanna Pyc Politechnika Wrocławska Wydział Informatyki i Zarządzania Informatyka, III rok

Spis treści What will we need? 1 What will we need? 2 3 Tell Eclipse about 4

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

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.

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

: What will we need? Tell Eclipse about Change the port from 8080 to 80 This lets you enter URLs of the form http://localhost/... instead of http://localhost:8080/... 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.

: (1) Tell Eclipse about The port is changed from 8080 to 80. This lets you enter URLs of the form http://localhost/... instead of http://localhost:8080/... The invoker servlet is enabled. This lets run servlets with a URL of the form http://localhost/appname/servlet/packagename.servletname. 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.

: (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.

: (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= 20000 redirectport= 8443 />

: (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 >

: (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.

: (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>

: (4) Tell Eclipse about In 6 (but not 5.5), you also need the privileged= true entry in the Context element of context.xml.

: (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.

: (5) Tell Eclipse about <servlet> <servlet-name> default </servlet-name> <servlet-class> org.apache.catalina.servlets.defaultservlet </servlet-class> <init-param> <param-name>debug</param-name> <param-value>0</param-value> </init-param> <init-param> <param-name>listings</param-name> <param-value>true</param-value> </init-param> <load-on-startup>l</load-on-startup> </servlet>

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.

Tell Eclipse about (2) Tell Eclipse about Click on Servers tab at bottom. R-click on v6.0, choose Start. Open http://localhost/ in a browser: you should see an empty page showing a blank directory listing (but not a 404 error).

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: http://localhost/struts2demo