Skip to content

Commit 5be7457

Browse files
committed
update for special name
1 parent 6ed7c64 commit 5be7457

2 files changed

Lines changed: 17 additions & 0 deletions

File tree

easywebframework/src/main/java/com/openthinks/easyweb/Versions.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
*/
2424
package com.openthinks.easyweb;
2525

26+
import javax.servlet.http.HttpServletRequest;
27+
2628
import com.openthinks.easyweb.annotation.AutoComponent;
2729
import com.openthinks.easyweb.annotation.Controller;
2830
import com.openthinks.easyweb.annotation.Filter;
@@ -33,6 +35,7 @@
3335
import com.openthinks.easyweb.annotation.process.objects.WebContainer;
3436
import com.openthinks.easyweb.annotation.process.objects.WebController;
3537
import com.openthinks.easyweb.annotation.process.objects.WebFilter;
38+
import com.openthinks.easyweb.annotation.process.objects.WebMethod;
3639
import com.openthinks.easyweb.context.EasyWebFilterContext;
3740
import com.openthinks.easyweb.context.handler.FilterHandler;
3841
import com.openthinks.easyweb.context.handler.StringMappingWebHandler;
@@ -81,6 +84,12 @@ public class Versions extends VersionCenter {
8184
String v_1_1;
8285
/**
8386
* @base
87+
* <dl>
88+
* <dt>request mapping path</dt><dd>the path which mapping to {@link WebMethod}, also equals to {@link WebMethod#getFullPath()}</dd>
89+
* <dt>full request mapping path</dt><dd>the path which mapping to {@link WebMethod} and it include web context root path, equals to {@link WebMethod#getFullPath()}</dd>
90+
* <dt>short request mapping path</dt><dd>the path which mapping to {@link WebMethod} and it not include web context root path, equals to {@link WebMethod#getRelativePath2()}</dd>
91+
* <dt>request URI</dt><dd>equals to {@link HttpServletRequest#getRequestURI()}</dd>
92+
* </dl>
8493
*/
8594
String v_1_0;
8695
}

easywebframework/src/main/java/com/openthinks/easyweb/annotation/process/objects/WebMethod.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,14 @@ public WebMethod(Method method) {
3838
public String getRelativePath() {
3939
return mapping.value();
4040
}
41+
42+
/**
43+
* get relative path include parent {@link WebInstancer#getRelativePath()}
44+
* @return String
45+
*/
46+
public String getRelativePath2(){
47+
return WebUtils.contactPath(parent().getRelativePath(), this.getRelativePath());
48+
}
4149

4250
@SuppressWarnings("unchecked")
4351
@Override

0 commit comments

Comments
 (0)