论坛首页 Java企业应用论坛

Struts2.0开发插件

浏览 5444 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (19)
作者 正文
   发表时间:2010-02-12   最后修改:2010-02-20

哪些抵制JLF和France的爱国guys就不要看了,是个French弄的开源插件。真正爱国的是农民朋友,从来不用帝国主义生产的电脑和软件。感谢网中人分享此信息!

看情况需要安装在 Eclipse 3.3 Java EE 版本上。

Alveole Studio MVC Web Project An eclipse plugin for Struts 2

MVC Web Project

MVC Web Project is a generic plugin for eclipse that enables J2ee developers to organize their web project visually using MVC (Model View Controller) model.

MVC Web Project currently integrates Struts 2 framework only, but its API is open and MVC Web Project can be extended to any MVC framework.

Alveole Studio

Alveole Studio is a French firm currently composed by a single developer: Sylvain RIBEYRON.

Screenshots

Example of a simple application.

Tutorial - step 3: create actions and views

Creating first action

Enter initialization package (double-click on Initialization node).

Click on "struts2" button:

On properties panel, fill action properties as follows:

Fill fields:

  • Action Name: it is the name attribute in struts2 action. This name is used in URL to call the specified Action.
  • Node Label: a text that is displayed on the graph.
  • Action class: a class that implements this action (you can click the browse button to choose an existing class).
  • Action method: the method that is called on this action.

Then click ok.

Then double-click on the created node. This open a new Java Class creation wizard:

This creates a new class, and automatically add the init() method:

Note: you can close the Action class. When you simply double-clicks on action node, plugin automatically opens Java source, and focuses on the init() method.

Creating first view

First of all, create a jsp directory inside WebContents. (This operation is not mandatory but it provides a clearer organization of code, because all JSP will be stored under this directory).

Then click on the Jsp view button on tool-bar:

Fill view properties on properties panel:

And click ok...

Double-click on the created node. It opens new JSP wizard (or it opens JSP if it already exists).

Create your JSP using any provided template:

Instead of classic struts2 taglibs, MVC Web Project provides an extended set of struts taglibs that facilitate use of links between views and other actions. Add the following taglib:

  <%@ taglib uri="/alveole-struts2" prefix="s" %>

To fasten your developments, you may add the following JSP template in eclipse:

  <%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
  <%@ taglib uri="/alveole-struts2" prefix="s" %>
  <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  <html>
  <head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>Insert title here</title>
  </head>
  <body>

  </body>
  </html>
Linking action to view

Creating links from actions to views is interpreted as an action mapping. Links of this type are named, and name is used for action mapping.

Create a link from struts2 node to view node (click link button, drag'n drop link from struts node to JSP view and fill lin properties). Name it "success":

Then click OK:

By returning "success" in Action.init(), the created link is followed to displayed the target view.

<!-- <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/"> <rdf:Description rdf:about="http://www.blogjava.net/beansoft/archive/2008/04/21/194567.html" dc:identifier="http://www.blogjava.net/beansoft/archive/2008/04/21/194567.html" dc:title="Struts 2开发的Eclipse插件:http://mvcwebproject.sourceforge.net/" trackback:ping="http://www.blogjava.net/beansoft/services/trackbacks/194567.aspx" /> </rdf:RDF> -->

<script type="text/javascript"></script>

   发表时间:2010-02-20  
眼球看起来很醒目呀,回去试一下。 ubuntu 7 ?
0 请登录后投票
   发表时间:2010-02-20  
这都能扯上爱国不爱国,败笔
0 请登录后投票
   发表时间:2010-02-20  
这个好像都很久了吧,不是近来你才发现吧, 晕。。。。。。。。。。。
0 请登录后投票
   发表时间:2010-02-20  
elvishehai 写道
这个好像都很久了吧,不是近来你才发现吧, 晕。。。。。。。。。。。



本人确实最近发现的!
0 请登录后投票
   发表时间:2010-02-21  
这个插件用过,一般。个人觉得开发Struts2不用什么插件,尽量往无配置上靠就行了。
0 请登录后投票
   发表时间:2010-02-21  
无配置,高境界。
0 请登录后投票
   发表时间:2010-02-21  
melody3 写道
无配置,高境界。



不是没有配置,尽可能的减少配置,在struts.xml还有配置修改默认struts2.0行为的属性呢?^_^,现在我们的项目就是这样!
0 请登录后投票
   发表时间:2010-03-06  
这个插件很老了,好像是Swing写的,嵌入到elcipse。。。
0 请登录后投票
   发表时间:2010-03-06  
虽然它提供了一个可视功能,就struts配置的编辑还不如NetBeans上的strust2插件。。。
0 请登录后投票
论坛首页 Java企业应用版

跳转论坛:
Global site tag (gtag.js) - Google Analytics