在MyEclipse 2013中使用图形界面快速配置Struts2的操作方法

Normal
0

7.8 磅
0
2

false
false
false

EN-US
ZH-CN
X-NONE

/* Style Definitions */
table.MsoNormalTable
{mso-style-name:普通表格;
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-parent:"";
mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
mso-para-margin:0cm;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.5pt;
mso-bidi-font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-ascii-font-family:Calibri;
mso-ascii-theme-font:minor-latin;
mso-hansi-font-family:Calibri;
mso-hansi-theme-font:minor-latin;
mso-font-kerning:1.0pt;}

1、  建立一个web project项目【项目名:Demo】。

 步骤:从MyEclipse菜单中依次打开:File --> New --> Web Project,结果如下图所示:

 提示:【我的Tomcat服务器是:Apache Tomcat v7.0  也可选MyEclipse自带的,如:MyEclipse Tomcat v7.0

  

  

Normal
0

7.8 磅
0
2

false
false
false

EN-US
ZH-CN
X-NONE

/* Style Definitions */
table.MsoNormalTable
{mso-style-name:普通表格;
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-parent:"";
mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
mso-para-margin:0cm;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.5pt;
mso-bidi-font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-ascii-font-family:Calibri;
mso-ascii-theme-font:minor-latin;
mso-hansi-font-family:Calibri;
mso-hansi-theme-font:minor-latin;
mso-font-kerning:1.0pt;}

2、  给项目添加Struts2的兼容开发功能。

步骤:选中Demo工程名,再依次选中MyEclipse菜单的:

Myeclipse --> Project Facets[Capabilities] --> Install Apache Struts(2.x) Facet -->选[Finish]按钮;过程和结果如下图所示:

  

  

  

Normal
0

7.8 磅
0
2

false
false
false

EN-US
ZH-CN
X-NONE

/* Style Definitions */
table.MsoNormalTable
{mso-style-name:普通表格;
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-parent:"";
mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
mso-para-margin:0cm;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.5pt;
mso-bidi-font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-ascii-font-family:Calibri;
mso-ascii-theme-font:minor-latin;
mso-hansi-font-family:Calibri;
mso-hansi-theme-font:minor-latin;
mso-font-kerning:1.0pt;}

3、给项目添加所需的JSP文件:【HelloWorld.jsp

Normal
0

7.8 磅
0
2

false
false
false

EN-US
ZH-CN
X-NONE

/* Style Definitions */
table.MsoNormalTable
{mso-style-name:普通表格;
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-parent:"";
mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
mso-para-margin:0cm;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.5pt;
mso-bidi-font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-ascii-font-family:Calibri;
mso-ascii-theme-font:minor-latin;
mso-hansi-font-family:Calibri;
mso-hansi-theme-font:minor-latin;
mso-font-kerning:1.0pt;}

  步骤:

  A步骤:如上图所示,找到struts.xml双击打开。屏幕上会出现如下图的编辑窗口,当前出现的是[Source]编辑界面,我们选择  [Flow]图形编辑界面

  

v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}

Normal
0
false

7.8 磅
0
2

false
false
false

EN-US
ZH-CN
X-NONE

/* Style Definitions */
table.MsoNormalTable
{mso-style-name:普通表格;
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-parent:"";
mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
mso-para-margin:0cm;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.5pt;
mso-bidi-font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-ascii-font-family:Calibri;
mso-ascii-theme-font:minor-latin;
mso-hansi-font-family:Calibri;
mso-hansi-theme-font:minor-latin;
mso-font-kerning:1.0pt;}

  B步骤:接着把上图的图标拖放到左边的空白处,这时会出现一个【Create a new JSP page.】的对话框,按下图  修改相应的参数,完成后按【Finish】按钮。

  

  

Normal
0

7.8 磅
0
2

false
false
false

EN-US
ZH-CN
X-NONE

/* Style Definitions */
table.MsoNormalTable
{mso-style-name:普通表格;
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-parent:"";
mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
mso-para-margin:0cm;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.5pt;
mso-bidi-font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-ascii-font-family:Calibri;
mso-ascii-theme-font:minor-latin;
mso-hansi-font-family:Calibri;
mso-hansi-theme-font:minor-latin;
mso-font-kerning:1.0pt;}

C步骤:给以上的JSP文件(即工程中的 HelloWorld.jsp)覆盖加入下列的代码,代码如下所示:

<%@ page contentType="text/html; charset=UTF-8"%>

<%@taglib prefix="s" uri="/struts-tags"%>

<html>

<head><title>Struts 2 Demo</title></head>

<body>

<h3>${message}</h3>

<s:form action="HelloWorld">

<s:textfield name="message"/><s:submit/>

</s:form>

</body>

</html>

v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}

Normal
0
false

7.8 磅
0
2

false
false
false

EN-US
ZH-CN
X-NONE

/* Style Definitions */
table.MsoNormalTable
{mso-style-name:普通表格;
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-parent:"";
mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
mso-para-margin:0cm;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.5pt;
mso-bidi-font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-ascii-font-family:Calibri;
mso-ascii-theme-font:minor-latin;
mso-hansi-font-family:Calibri;
mso-hansi-theme-font:minor-latin;
mso-font-kerning:1.0pt;}

4、给项目添加一个Package

  步骤:把上图的拖放到左边的空白处,这时会出现一个【New Package】的对话框,按下图修改相应的参数,完成后按【Finish】按钮。

v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}

Normal
0
false

7.8 磅
0
2

false
false
false

EN-US
ZH-CN
X-NONE

/* Style Definitions */
table.MsoNormalTable
{mso-style-name:普通表格;
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-parent:"";
mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
mso-para-margin:0cm;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.5pt;
mso-bidi-font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-ascii-font-family:Calibri;
mso-ascii-theme-font:minor-latin;
mso-hansi-font-family:Calibri;
mso-hansi-theme-font:minor-latin;
mso-font-kerning:1.0pt;}

5、给Package添加一个Action及Result

步骤:把上图的拖放到左边的Package浅黄区域,这时会出现一个【New Action】的对话框,按下图修改相应的参数,完成后按【Finish】按钮。

  

  

Normal
0

7.8 磅
0
2

false
false
false

EN-US
ZH-CN
X-NONE

/* Style Definitions */
table.MsoNormalTable
{mso-style-name:普通表格;
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-parent:"";
mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
mso-para-margin:0cm;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.5pt;
mso-bidi-font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-ascii-font-family:Calibri;
mso-ascii-theme-font:minor-latin;
mso-hansi-font-family:Calibri;
mso-hansi-theme-font:minor-latin;
mso-font-kerning:1.0pt;}

再按【Finish】按钮完成操作!

  

Normal
0

7.8 磅
0
2

false
false
false

EN-US
ZH-CN
X-NONE

/* Style Definitions */
table.MsoNormalTable
{mso-style-name:普通表格;
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-parent:"";
mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
mso-para-margin:0cm;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.5pt;
mso-bidi-font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-ascii-font-family:Calibri;
mso-ascii-theme-font:minor-latin;
mso-hansi-font-family:Calibri;
mso-hansi-theme-font:minor-latin;
mso-font-kerning:1.0pt;}

6、修改HelloWorld.java类文件

package com.etop.struts2.action;

import com.opensymphony.xwork2.ActionSupport;

publicclass HelloWorld extends ActionSupport {

private String message;

public String execute() throws Exception {

returnSUCCESS;

}

public String getMessage() {

returnmessage;

}

publicvoid setMessage(String message) {

this.message = message;

}

}

Normal
0

7.8 磅
0
2

false
false
false

EN-US
ZH-CN
X-NONE

/* Style Definitions */
table.MsoNormalTable
{mso-style-name:普通表格;
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-parent:"";
mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
mso-para-margin:0cm;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.5pt;
mso-bidi-font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-ascii-font-family:Calibri;
mso-ascii-theme-font:minor-latin;
mso-hansi-font-family:Calibri;
mso-hansi-theme-font:minor-latin;
mso-font-kerning:1.0pt;}

添加工程到tomcat服务器:

  

  

Normal
0

7.8 磅
0
2

false
false
false

EN-US
ZH-CN
X-NONE

/* Style Definitions */
table.MsoNormalTable
{mso-style-name:普通表格;
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-parent:"";
mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
mso-para-margin:0cm;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.5pt;
mso-bidi-font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-ascii-font-family:Calibri;
mso-ascii-theme-font:minor-latin;
mso-hansi-font-family:Calibri;
mso-hansi-theme-font:minor-latin;
mso-font-kerning:1.0pt;}

启动tomcat服务器:

  

Normal
0

7.8 磅
0
2

false
false
false

EN-US
ZH-CN
X-NONE

/* Style Definitions */
table.MsoNormalTable
{mso-style-name:普通表格;
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-parent:"";
mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
mso-para-margin:0cm;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.5pt;
mso-bidi-font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-ascii-font-family:Calibri;
mso-ascii-theme-font:minor-latin;
mso-hansi-font-family:Calibri;
mso-hansi-theme-font:minor-latin;
mso-font-kerning:1.0pt;}

最后就可以在浏览器中测试了:

 输入网址:http://localhost:8080/Demo/HelloWorld.action   如下图所示

  

  

  

v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}

Normal
0
false

7.8 磅
0
2

false
false
false

EN-US
ZH-CN
X-NONE

/* Style Definitions */
table.MsoNormalTable
{mso-style-name:普通表格;
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-parent:"";
mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
mso-para-margin:0cm;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.5pt;
mso-bidi-font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-ascii-font-family:Calibri;
mso-ascii-theme-font:minor-latin;
mso-hansi-font-family:Calibri;
mso-hansi-theme-font:minor-latin;
mso-font-kerning:1.0pt;}

时间: 2024-10-13 22:29:20

在MyEclipse 2013中使用图形界面快速配置Struts2的操作方法的相关文章

Java中的图形界面编程

前言 正文 Java中的图形界面编程 AWT/Swing AWT(Abstract Window ToolKits,抽象窗口工具集) 1.容器类:用来存储组件,实现容器布局 2.组件类:实现界面的一些特定功能 一个容器可以包涵多个组件,组件必须存放在容器中 3.布局管理器:实现容器的布局设置 4.图形类:包括一些基本图形 Swing是AWT的一个轻量级框架 java.lang.Object java.awt.Component java.awt.Container java.awt.Window

centos6.5图形界面NetworkManager 配置ip文件位置

请教一个关于网络配置的问题,如图:该网络连接图形界面中 有2个配置,其中System eth0 有对应的配置文件/etc/sysconfig/network-scripts/ifcfg-eth0,但是zhoucf这个配置是我手工在图形界面里添加的,它的对应的配置文件在哪里呢? 我想在初始化linux有个纯净的网络配置,用命令行删除上面图中zhoucf配置 怎么办呢? ----------------------------- find /root -type f -name "*" |

ubuntu14.1的图形界面无法配置网络

今天正在捣鼓虚拟机,突然发现无法连接目标机了.检查发现wired根本没有连接,真特么奇怪了. ifconfig 之后只有一个loopback lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:65536 Metric:1 RX packets:308 errors:0 dropped:0 overruns:0

关于在linux中使用图形界面的网络管理工具

有好几种自动设置的工具可以选择(既然说是自动设置的工具,那就说明有手动设置的工具,例如 使用 ip, iw, iwconfig 这些命令设置网络),例如:Connman, netctl, NetworkManager, Wicd, Wifi Radar 这几种工具如果同时使用的话可能会产生冲突,所以我们应该只选择其一.我们这里选择的是 NetworkManager,鉴于其功能强大又有图形界面的支持. 使用的linux是archlinux,桌面环境是 xfce4. 1. 安装 networkman

Lync Server在父子域环境中使用图形界面扩展AD架构失败

问题描述: 过lync图形界面进行lync扩展的时候出现如下错误: 未将对象引用设置到对象的实例 ----------------------------------------------. 原因分析: 查询资料给出如下解释: The Enable-CsAdForest Lync Server command is designed to run from the Active Directory Domain Services forest root domain for security

目标 - 在虚拟机CentOS7中无图形界面安装Oracle11G R2版本

参考: https://www.cnblogs.com/yejingcn/p/10278473.html centos7启动oracle su - oracle //切换到自己的oracle账户 lsnrctl start //启动oracle监听 sqlplus /nolog //登录oracle conn /as sysdba //连接服务 startup //启动服务 原文地址:https://www.cnblogs.com/116970u/p/11298216.html

mac中使用 sourcetree 的快速配置和git服务器登录

问题: 1.mac中下载sourcetree配置仓库地址,一直在提示输入密码,无法登录成功,更无法获取源码. 2.找不到配置仓库时的账号密码,只看到地址. 场景: git服务器:自己的GIT服务器,非github. 登录方式:证书登录. 解决方案: *首先,sourcetree无法使用设置密码账号的方式实现登录请求.也无法像windows环境下的sourcetree一样配置key文件的地址.所以我们实现的方式是在mac上配置一个秘钥,而sourcetree登录时候正式使用这个秘钥文件. 1.打开

Linux图形界面与字符界面切换

1. 启动时进入字符界面,后来想切换到图形界面:使用startx 或 init 5 (注:startx只是在原有运行级别3上加了图形界面,运行级别没变,而init 5 则是切换到运行级别5,所以要重新登录.可用runlevel 命令查看当前运行级别和上一次运行级别) 2. 启动时进入图形界面,后来想切换到字符界面: 使用Ctrl+Alt+F1~Ctrl+Alt+F6,可切换到不同的字符控制台(只是六个字符控制台,此外没有区别),再使用Ctrl+Alt+F7可切换回图形界面: 如果是在虚拟机vmw

SQL Server 索引的图形界面操作 &lt;第十二篇&gt;

一.索引的图形界面操作 SQL Server非常强大的就是图形界面操作.关于索引方面也一样那么强大,很多操作比如说重建索引啊,查看各种统计信息啊,都能够通过图形界面快速查看和操作,下面来看看SQL Server索引方面的GUI操作. 二.索引统计信息的图形界面操作 SQL Server 索引的图形界面操作 <第十二篇>