Giter VIP home page Giter VIP logo

component-router's Introduction

Router-Conponent

基于struts封装,简单、好用的路由组件

Features

  • 提供请求路径的统一管理路由
  • 通过配置文件将请求分发到对应Action实现类

Quick Start

1.在struct.xml配置路由

<action name="app"
	class="com.issun.component.router.AppCommonAction">
	<interceptor-ref name="defaultStack"/>
	<result name="success">/success.jsp</result>
  <result name="fail">/fail.jsp</result>
</action>	

2.在WEB-INF/config/action路径下面提供action映射的配置文件verbs.properties

eg.

formDesignAction =com.issun.formdesigner.action.FormDesignAction

3.想通过路由管理的Action实现IAction接口,并在verbs.properties配置映射参数

eg.

package com.issun.formdesigner.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.commons.lang3.StringUtils;

import com.issun.component.router.IAction;
import com.issun.component.router.bean.ActionInfo;
import com.issun.component.router.bean.ActionResult;

public class FormDesignAction implements IAction {

	@Override
	public ActionResult execute(HttpServletRequest request,
			HttpServletResponse response) {
		
		ActionResult ar = new ActionResult();
		
		//......
		
		return ar;
	}

}
formDesignAction =com.issun.formdesigner.action.FormDesignAction

那么以后带有app.action?type=formDesignAction的请求都会路由到FormDesignAction。

component-router's People

Contributors

samuerio avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.