此代码是 oschina 到手柄形状像 http://www.oschina.net/p/tomcat 这种URL
此类已经废弃,改用 http://www.oschina.net/code/snippet_12_2832
标签:
OSCHINA
[1].[代码] URLMappingServlet.java 跳至 code=5#6" style="font-weight:normal; font-size:9pt; text-decoration:none">[1]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
|
package
import
import
import
import
import
import
import
/**
*
*
*
*/
public
extends
private
class );
public
"current_uri" ; //{index}
public
"request_uri" ; //{/index}
private
"index.vm" ;
private
".vm" ;
private
'/' ;
private
private
new
private
"oschina.net" ;
@Override
@SuppressWarnings ( "unchecked" )
public
throws
Enumeration<String>
while (names.hasMoreElements()){
String
String
if ( "default" .equalsIgnoreCase(name)){
default_base
continue ;
}
for (String ',' )){
other_base.put(n,
}
}
}
private
String null ;
String
base
if (base null )
return
int
if (idx 0 ){
prefix 0 , 1 );
base
}
return
null )?default_base:base;
}
/**
*
*
*
*
*
*/
protected
throws
StringBuilder new
String 1 );
String
req.setAttribute(REQUEST_URI,
req.setAttribute(CURRENT_URI,
//解析URL地址
String[] 1 ).split(String.valueOf(URL_SEPERATOR));
if (s_result.length== 1 ){
show_page.append(prefix);
show_page.append(URL_SEPERATOR);
show_page.append(DEFAULT_INDEX_PAGE);
}
else {
show_page.append(prefix);
show_page.append(URL_SEPERATOR);
//
StringBuilder new
testPath.append(s_result[ 1 ]);
testPath.append(PAGE_EXTENSION);
boolean
int
1 ;
if (isVM){
show_page.append(s_result[ 1 ]);
show_page.append(PAGE_EXTENSION);
param_idx 2 ;
}
else {
show_page.append(DEFAULT_INDEX_PAGE);
}
for ( int
if (i==param_idx)
show_page.append( '?' );
else
show_page.append( '&' );
show_page.append( 'p' );
show_page.append((i-param_idx+ 1 ));
show_page.append( '=' );
show_page.append(s_result[i]);
}
testPath.setLength( 0 );
testPath null ;
}
if (log.isDebugEnabled())
log.debug( "request_uri=" +spath+ ",servlet_path=" +
req.getServletPath()+ ",vm=" +show_page);
//运行真实的页面
RequestDispatcher
rd.forward(req,
}
private
new
/**
*
*
*
*/
private
if (vm_cache.contains(path))
return
;
File new
boolean
if (isVM)
vm_cache.add(path);
return
}
@Override
protected
throws
perform(req,
}
@Override
protected
throws
perform(req,
}
}
|
版权声明:本文博客原创文章,博客,未经同意,不得转载。