⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 在struts 2中实现ioc - max on java - blogjava.mht

📁 MVC结构中struts的详细介绍
💻 MHT
📖 第 1 页 / 共 5 页
字号:
style=3D"COLOR: #ff0000">version</SPAN> <SPAN style=3D"COLOR: =
#0000ff">=3D"2.4"</SPAN>=20
<SPAN style=3D"COLOR: #ff0000">xmlns</SPAN> <SPAN=20
style=3D"COLOR: #0000ff">=3D"http://java.sun.com/xml/ns/j2ee"</SPAN> =
<SPAN=20
style=3D"COLOR: #ff0000"><BR>&nbsp; &nbsp; xmlns:xsi</SPAN> <SPAN=20
style=3D"COLOR: =
#0000ff">=3D"http://www.w3.org/2001/XMLSchema-instance"</SPAN> <SPAN=20
style=3D"COLOR: #ff0000"><BR>&nbsp; &nbsp; xsi:schemaLocation</SPAN> =
<SPAN=20
style=3D"COLOR: =
#0000ff">=3D"http://java.sun.com/xml/ns/j2ee&nbsp;<BR>&nbsp; &nbsp;=20
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"</SPAN> <SPAN=20
style=3D"COLOR: #0000ff">&gt;</SPAN> <SPAN style=3D"COLOR: =
#000000"><BR><BR>&nbsp;=20
&nbsp; </SPAN><SPAN style=3D"COLOR: #0000ff">&lt;</SPAN> <SPAN=20
style=3D"COLOR: #800000">display-name</SPAN> <SPAN=20
style=3D"COLOR: #0000ff">&gt;</SPAN> <SPAN style=3D"COLOR: =
#000000">Struts 2 IoC=20
Demo</SPAN> <SPAN style=3D"COLOR: #0000ff">&lt;/</SPAN> <SPAN=20
style=3D"COLOR: #800000">display-name</SPAN> <SPAN=20
style=3D"COLOR: #0000ff">&gt;</SPAN> <SPAN style=3D"COLOR: =
#000000"><BR><BR>&nbsp;=20
&nbsp; </SPAN><SPAN style=3D"COLOR: #0000ff">&lt;</SPAN> <SPAN=20
style=3D"COLOR: #800000">filter</SPAN> <SPAN style=3D"COLOR: =
#0000ff">&gt;</SPAN>=20
<SPAN style=3D"COLOR: #000000"><BR>&nbsp; &nbsp; &nbsp; &nbsp; =
</SPAN><SPAN=20
style=3D"COLOR: #0000ff">&lt;</SPAN> <SPAN=20
style=3D"COLOR: #800000">filter-name</SPAN> <SPAN=20
style=3D"COLOR: #0000ff">&gt;</SPAN> <SPAN=20
style=3D"COLOR: #000000">struts-cleanup</SPAN> <SPAN=20
style=3D"COLOR: #0000ff">&lt;/</SPAN> <SPAN=20
style=3D"COLOR: #800000">filter-name</SPAN> <SPAN=20
style=3D"COLOR: #0000ff">&gt;</SPAN> <SPAN style=3D"COLOR: =
#000000"><BR>&nbsp;=20
&nbsp; &nbsp; &nbsp; </SPAN><SPAN style=3D"COLOR: #0000ff">&lt;</SPAN> =
<SPAN=20
style=3D"COLOR: #800000">filter-class</SPAN> <SPAN=20
style=3D"COLOR: #0000ff">&gt;</SPAN> <SPAN style=3D"COLOR: =
#000000"><BR>&nbsp;=20
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=20
org.apache.struts2.dispatcher.ActionContextCleanUp<BR>&nbsp; &nbsp; =
&nbsp;=20
&nbsp; </SPAN><SPAN style=3D"COLOR: #0000ff">&lt;/</SPAN> <SPAN=20
style=3D"COLOR: #800000">filter-class</SPAN> <SPAN=20
style=3D"COLOR: #0000ff">&gt;</SPAN> <SPAN style=3D"COLOR: =
#000000"><BR>&nbsp;=20
&nbsp; </SPAN><SPAN style=3D"COLOR: #0000ff">&lt;/</SPAN> <SPAN=20
style=3D"COLOR: #800000">filter</SPAN> <SPAN style=3D"COLOR: =
#0000ff">&gt;</SPAN>=20
<SPAN style=3D"COLOR: #000000"><BR><BR>&nbsp; &nbsp; </SPAN><SPAN=20
style=3D"COLOR: #0000ff">&lt;</SPAN> <SPAN style=3D"COLOR: =
#800000">filter</SPAN>=20
<SPAN style=3D"COLOR: #0000ff">&gt;</SPAN> <SPAN style=3D"COLOR: =
#000000"><BR>&nbsp;=20
&nbsp; &nbsp; &nbsp; </SPAN><SPAN style=3D"COLOR: #0000ff">&lt;</SPAN> =
<SPAN=20
style=3D"COLOR: #800000">filter-name</SPAN> <SPAN=20
style=3D"COLOR: #0000ff">&gt;</SPAN> <SPAN style=3D"COLOR: =
#000000">struts2</SPAN>=20
<SPAN style=3D"COLOR: #0000ff">&lt;/</SPAN> <SPAN=20
style=3D"COLOR: #800000">filter-name</SPAN> <SPAN=20
style=3D"COLOR: #0000ff">&gt;</SPAN> <SPAN style=3D"COLOR: =
#000000"><BR>&nbsp;=20
&nbsp; &nbsp; &nbsp; </SPAN><SPAN style=3D"COLOR: #0000ff">&lt;</SPAN> =
<SPAN=20
style=3D"COLOR: #800000">filter-class</SPAN> <SPAN=20
style=3D"COLOR: #0000ff">&gt;</SPAN> <SPAN style=3D"COLOR: =
#000000"><BR>&nbsp;=20
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=20
org.apache.struts2.dispatcher.FilterDispatcher<BR>&nbsp; &nbsp; &nbsp; =
&nbsp;=20
</SPAN><SPAN style=3D"COLOR: #0000ff">&lt;/</SPAN> <SPAN=20
style=3D"COLOR: #800000">filter-class</SPAN> <SPAN=20
style=3D"COLOR: #0000ff">&gt;</SPAN> <SPAN style=3D"COLOR: =
#000000"><BR>&nbsp;=20
&nbsp; </SPAN><SPAN style=3D"COLOR: #0000ff">&lt;/</SPAN> <SPAN=20
style=3D"COLOR: #800000">filter</SPAN> <SPAN style=3D"COLOR: =
#0000ff">&gt;</SPAN>=20
<SPAN style=3D"COLOR: #000000"><BR><BR>&nbsp; &nbsp; </SPAN><SPAN=20
style=3D"COLOR: #0000ff">&lt;</SPAN> <SPAN=20
style=3D"COLOR: #800000">filter-mapping</SPAN> <SPAN=20
style=3D"COLOR: #0000ff">&gt;</SPAN> <SPAN style=3D"COLOR: =
#000000"><BR>&nbsp;=20
&nbsp; &nbsp; &nbsp; </SPAN><SPAN style=3D"COLOR: #0000ff">&lt;</SPAN> =
<SPAN=20
style=3D"COLOR: #800000">filter-name</SPAN> <SPAN=20
style=3D"COLOR: #0000ff">&gt;</SPAN> <SPAN=20
style=3D"COLOR: #000000">struts-cleanup</SPAN> <SPAN=20
style=3D"COLOR: #0000ff">&lt;/</SPAN> <SPAN=20
style=3D"COLOR: #800000">filter-name</SPAN> <SPAN=20
style=3D"COLOR: #0000ff">&gt;</SPAN> <SPAN style=3D"COLOR: =
#000000"><BR>&nbsp;=20
&nbsp; &nbsp; &nbsp; </SPAN><SPAN style=3D"COLOR: #0000ff">&lt;</SPAN> =
<SPAN=20
style=3D"COLOR: #800000">url-pattern</SPAN> <SPAN=20
style=3D"COLOR: #0000ff">&gt;</SPAN> <SPAN style=3D"COLOR: =
#000000">/*</SPAN> <SPAN=20
style=3D"COLOR: #0000ff">&lt;/</SPAN> <SPAN=20
style=3D"COLOR: #800000">url-pattern</SPAN> <SPAN=20
style=3D"COLOR: #0000ff">&gt;</SPAN> <SPAN style=3D"COLOR: =
#000000"><BR>&nbsp;=20
&nbsp; </SPAN><SPAN style=3D"COLOR: #0000ff">&lt;/</SPAN> <SPAN=20
style=3D"COLOR: #800000">filter-mapping</SPAN> <SPAN=20
style=3D"COLOR: #0000ff">&gt;</SPAN> <SPAN style=3D"COLOR: =
#000000"><BR><BR>&nbsp;=20
&nbsp; </SPAN><SPAN style=3D"COLOR: #0000ff">&lt;</SPAN> <SPAN=20
style=3D"COLOR: #800000">filter-mapping</SPAN> <SPAN=20
style=3D"COLOR: #0000ff">&gt;</SPAN> <SPAN style=3D"COLOR: =
#000000"><BR>&nbsp;=20
&nbsp; &nbsp; &nbsp; </SPAN><SPAN style=3D"COLOR: #0000ff">&lt;</SPAN> =
<SPAN=20
style=3D"COLOR: #800000">filter-name</SPAN> <SPAN=20
style=3D"COLOR: #0000ff">&gt;</SPAN> <SPAN style=3D"COLOR: =
#000000">struts2</SPAN>=20
<SPAN style=3D"COLOR: #0000ff">&lt;/</SPAN> <SPAN=20
style=3D"COLOR: #800000">filter-name</SPAN> <SPAN=20
style=3D"COLOR: #0000ff">&gt;</SPAN> <SPAN style=3D"COLOR: =
#000000"><BR>&nbsp;=20
&nbsp; &nbsp; &nbsp; </SPAN><SPAN style=3D"COLOR: #0000ff">&lt;</SPAN> =
<SPAN=20
style=3D"COLOR: #800000">url-pattern</SPAN> <SPAN=20
style=3D"COLOR: #0000ff">&gt;</SPAN> <SPAN style=3D"COLOR: =
#000000">/*</SPAN> <SPAN=20
style=3D"COLOR: #0000ff">&lt;/</SPAN> <SPAN=20
style=3D"COLOR: #800000">url-pattern</SPAN> <SPAN=20
style=3D"COLOR: #0000ff">&gt;</SPAN> <SPAN style=3D"COLOR: =
#000000"><BR>&nbsp;=20
&nbsp; </SPAN><SPAN style=3D"COLOR: #0000ff">&lt;/</SPAN> <SPAN=20
style=3D"COLOR: #800000">filter-mapping</SPAN> <SPAN=20
style=3D"COLOR: #0000ff">&gt;</SPAN> <SPAN style=3D"COLOR: =
#000000"><BR><BR>&nbsp;=20
&nbsp; </SPAN><SPAN style=3D"COLOR: #0000ff">&lt;</SPAN> <SPAN=20
style=3D"COLOR: #800000">listener</SPAN> <SPAN style=3D"COLOR: =
#0000ff">&gt;</SPAN>=20
<SPAN style=3D"COLOR: #000000"><BR>&nbsp; &nbsp; &nbsp; &nbsp; =
</SPAN><SPAN=20
style=3D"COLOR: #0000ff">&lt;</SPAN> <SPAN=20
style=3D"COLOR: #800000">listener-class</SPAN> <SPAN=20
style=3D"COLOR: #0000ff">&gt;</SPAN> <SPAN style=3D"COLOR: =
#000000"><BR>&nbsp;=20
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=20
org.springframework.web.context.ContextLoaderListener<BR>&nbsp; &nbsp; =
&nbsp;=20
&nbsp; </SPAN><SPAN style=3D"COLOR: #0000ff">&lt;/</SPAN> <SPAN=20
style=3D"COLOR: #800000">listener-class</SPAN> <SPAN=20
style=3D"COLOR: #0000ff">&gt;</SPAN> <SPAN style=3D"COLOR: =
#000000"><BR>&nbsp;=20
&nbsp; </SPAN><SPAN style=3D"COLOR: #0000ff">&lt;/</SPAN> <SPAN=20
style=3D"COLOR: #800000">listener</SPAN> <SPAN style=3D"COLOR: =
#0000ff">&gt;</SPAN>=20
<SPAN style=3D"COLOR: #000000"><BR><BR>&nbsp; &nbsp; </SPAN><SPAN=20
style=3D"COLOR: #0000ff">&lt;</SPAN> <SPAN=20
style=3D"COLOR: #800000">welcome-file-list</SPAN> <SPAN=20
style=3D"COLOR: #0000ff">&gt;</SPAN> <SPAN style=3D"COLOR: =
#000000"><BR>&nbsp;=20
&nbsp; &nbsp; &nbsp; </SPAN><SPAN style=3D"COLOR: #0000ff">&lt;</SPAN> =
<SPAN=20
style=3D"COLOR: #800000">welcome-file</SPAN> <SPAN=20
style=3D"COLOR: #0000ff">&gt;</SPAN> <SPAN=20
style=3D"COLOR: #000000">index.html</SPAN> <SPAN=20
style=3D"COLOR: #0000ff">&lt;/</SPAN> <SPAN=20
style=3D"COLOR: #800000">welcome-file</SPAN> <SPAN=20
style=3D"COLOR: #0000ff">&gt;</SPAN> <SPAN style=3D"COLOR: =
#000000"><BR>&nbsp;=20
&nbsp; </SPAN><SPAN style=3D"COLOR: #0000ff">&lt;/</SPAN> <SPAN=20
style=3D"COLOR: #800000">welcome-file-list</SPAN> <SPAN=20
style=3D"COLOR: #0000ff">&gt;</SPAN> <SPAN style=3D"COLOR: =
#000000"><BR></SPAN><SPAN=20
style=3D"COLOR: #0000ff">&lt;/</SPAN> <SPAN style=3D"COLOR: =
#800000">web-app</SPAN>=20
<SPAN style=3D"COLOR: #0000ff">&gt;</SPAN> </DIV><SPAN=20
style=3D"FONT-SIZE: smaller; FONT-STYLE: italic">=E6=B8=85=E5=8D=951 =
WEB-INF\web.xml</SPAN>=20
<P>=E5=A4=A7=E5=AE=B6=E4=B8=80=E7=9C=8B=E4=BE=BF=E7=9F=A5=E9=81=93=EF=BC=8C=
=E4=B8=BB=E8=A6=81=E6=98=AF=E5=8A=A0=E5=85=A5Spring=E7=9A=84ContextLoader=
Listener=E7=9B=91=E5=90=AC=E5=99=A8=EF=BC=8C=E6=96=B9=E4=BE=BFSpring=E4=B8=
=8EWeb=E5=AE=B9=E5=99=A8=E4=BA=A4=E4=BA=92=E3=80=82</P>
<P>=E7=B4=A7=E6=8E=A5=E7=9D=80=EF=BC=8C=E4=BF=AE=E6=94=B9Struts.propertie=
s=E6=96=87=E4=BB=B6=EF=BC=8C=E5=91=8A=E7=9F=A5Struts =
2=E8=BF=90=E8=A1=8C=E6=97=B6=E4=BD=BF=E7=94=A8Spring=E6=9D=A5=E5=88=9B=E5=
=BB=BA=E5=AF=B9=E8=B1=A1=EF=BC=88=E5=A6=82Action=E7=AD=89=EF=BC=89=EF=BC=8C=
=E5=86=85=E5=AE=B9=E5=A6=82=E4=B8=8B=EF=BC=9A</P>
<DIV=20
style=3D"BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; =
BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; =
PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; =
WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px =
solid; BACKGROUND-COLOR: #eeeeee"><SPAN=20
style=3D"COLOR: #000000">struts.objectFactory</SPAN> <SPAN=20
style=3D"COLOR: #000000">=3D</SPAN> <SPAN style=3D"COLOR: =
#000000">spring</SPAN>=20
</DIV><SPAN style=3D"FONT-SIZE: smaller; FONT-STYLE: =
italic">=E6=B8=85=E5=8D=952=20
classes\struts.properties</SPAN>=20
<P>=E5=86=8D=E4=B8=8B=E6=9D=A5=EF=BC=8C=E9=81=B5=E5=BE=AASpring=E7=9A=84=E5=
=8E=9F=E5=88=99=E2=80=94=E2=80=94=E9=9D=A2=E5=90=91=E6=8E=A5=E5=8F=A3=E7=BC=
=96=E7=A8=8B=EF=BC=8C=E5=88=9B=E5=BB=BA=E6=8E=A5=E5=8F=A3ChatService=EF=BC=
=8C=E4=BB=A3=E7=A0=81=E5=A6=82=E4=B8=8B=EF=BC=9A</P>
<DIV=20
style=3D"BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; =
BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; =
PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; =
WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px =
solid; BACKGROUND-COLOR: #eeeeee"><IMG=20
src=3D"http://www.blogjava.net/Images/OutliningIndicators/None.gif" =
align=3Dtop>=20
<SPAN style=3D"COLOR: #0000ff">package</SPAN> <SPAN=20
style=3D"COLOR: #000000">tutorial;<BR><IMG=20
src=3D"http://www.blogjava.net/Images/OutliningIndicators/None.gif"=20
align=3Dtop><BR><IMG=20
src=3D"http://www.blogjava.net/Images/OutliningIndicators/None.gif"=20
align=3Dtop></SPAN> <SPAN style=3D"COLOR: #0000ff">import</SPAN> <SPAN=20
style=3D"COLOR: #000000">java.util.Set;<BR><IMG=20
src=3D"http://www.blogjava.net/Images/OutliningIndicators/None.gif"=20
align=3Dtop><BR><IMG id=3DCodehighlighter1_71_102_Open_Image=20
onclick=3D"this.style.display=3D'none'; =
Codehighlighter1_71_102_Open_Text.style.display=3D'none'; =
Codehighlighter1_71_102_Closed_Image.style.display=3D'inline'; =
Codehighlighter1_71_102_Closed_Text.style.display=3D'inline';"=20
src=3D"http://www.blogjava.net/Images/OutliningIndicators/ExpandedBlockSt=
art.gif"=20
align=3Dtop><IMG id=3DCodehighlighter1_71_102_Closed_Image =
style=3D"DISPLAY: none"=20
onclick=3D"this.style.display=3D'none'; =
Codehighlighter1_71_102_Closed_Text.style.display=3D'none'; =
Codehighlighter1_71_102_Open_Image.style.display=3D'inline'; =
Codehighlighter1_71_102_Open_Text.style.display=3D'inline';"=20
src=3D"http://www.blogjava.net/Images/OutliningIndicators/ContractedBlock=
.gif"=20
align=3Dtop></SPAN> <SPAN style=3D"COLOR: #0000ff">public</SPAN> <SPAN=20
style=3D"COLOR: #000000"></SPAN><SPAN style=3D"COLOR: =
#0000ff">interface</SPAN>=20
<SPAN style=3D"COLOR: #000000">ChatService </SPAN><SPAN=20
id=3DCodehighlighter1_71_102_Closed_Text=20
style=3D"BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; =
DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 =
1px solid; BACKGROUND-COLOR: #ffffff"><IMG=20
src=3D"http://www.blogjava.net/Images/dot.gif"> </SPAN><SPAN=20
id=3DCodehighlighter1_71_102_Open_Text><SPAN style=3D"COLOR: =
#000000">{<BR><IMG=20
src=3D"http://www.blogjava.net/Images/OutliningIndicators/InBlock.gif" =
align=3Dtop>=20
&nbsp; &nbsp;Set</SPAN> <SPAN style=3D"COLOR: #000000">&lt;</SPAN> <SPAN =

style=3D"COLOR: #000000">String</SPAN> <SPAN style=3D"COLOR: =
#000000">&gt;</SPAN>=20
<SPAN style=3D"COLOR: #000000">getUserNames();<BR><IMG=20
src=3D"http://www.blogjava.net/Images/OutliningIndicators/ExpandedBlockEn=
d.gif"=20
align=3Dtop>}</SPAN> </SPAN></DIV><SPAN=20
style=3D"FONT-SIZE: smaller; FONT-STYLE: italic">=E6=B8=85=E5=8D=953=20
tutorial.ChatService.java</SPAN>=20
<P>=E7=84=B6=E5=90=8E=EF=BC=8C=E5=86=8D=E5=88=9B=E5=BB=BA=E4=B8=80=E4=B8=AA=
=E9=BB=98=E8=AE=A4=E5=AE=9E=E7=8E=B0ChatServiceImpl=EF=BC=8C=E4=BB=A3=E7=A0=
=81=E5=A6=82=E4=B8=8B=EF=BC=9A</P>
<DIV=20
style=3D"BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; =
BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; =

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -