├── codes ├── javaee │ ├── README.md │ ├── javaee-jsp │ │ └── src │ │ │ └── main │ │ │ ├── webapp │ │ │ ├── META-INF │ │ │ │ └── MANIFEST.MF │ │ │ ├── WEB-INF │ │ │ │ ├── META-INF │ │ │ │ │ └── MANIFEST.MF │ │ │ │ └── resources │ │ │ │ │ └── jsp │ │ │ │ │ └── index.jsp │ │ │ ├── views │ │ │ │ └── jsp │ │ │ │ │ ├── directive.jsp │ │ │ │ │ ├── index.jsp │ │ │ │ │ ├── action │ │ │ │ │ ├── date.jsp │ │ │ │ │ ├── forward.jsp │ │ │ │ │ ├── include.jsp │ │ │ │ │ └── getProperty.jsp │ │ │ │ │ ├── action.jsp │ │ │ │ │ ├── error.jsp │ │ │ │ │ ├── application.jsp │ │ │ │ │ ├── exception.jsp │ │ │ │ │ ├── directive │ │ │ │ │ ├── page │ │ │ │ │ │ ├── errorPage.jsp │ │ │ │ │ │ ├── contentType.jsp │ │ │ │ │ │ └── isErrorPage.jsp │ │ │ │ │ └── include │ │ │ │ │ │ ├── foot.jsp │ │ │ │ │ │ └── head.jsp │ │ │ │ │ ├── life.jsp │ │ │ │ │ ├── scriptlet.jsp │ │ │ │ │ ├── taglib.jsp │ │ │ │ │ ├── comment.jsp │ │ │ │ │ ├── grammar │ │ │ │ │ └── while.jsp │ │ │ │ │ ├── break.jsp │ │ │ │ │ ├── return.jsp │ │ │ │ │ └── el.jsp │ │ │ ├── images │ │ │ │ ├── mail.gif │ │ │ │ ├── bg-btn-blue.gif │ │ │ │ └── vertical_line.gif │ │ │ └── examples │ │ │ │ ├── 04.action │ │ │ │ ├── date.jsp │ │ │ │ ├── jspinclude.jsp │ │ │ │ └── jspforward.jsp │ │ │ │ ├── uncheck │ │ │ │ ├── 01.helloWorld.jsp │ │ │ │ ├── 01.helloWorld_zh.jsp │ │ │ │ ├── configuration.jsp │ │ │ │ └── 03.yourIp.jsp │ │ │ │ ├── 05.implicit_object │ │ │ │ ├── error.jsp │ │ │ │ └── exception.jsp │ │ │ │ ├── 03.directive │ │ │ │ ├── foot.jsp │ │ │ │ ├── page.jsp │ │ │ │ └── head.jsp │ │ │ │ ├── practice │ │ │ │ ├── form │ │ │ │ │ ├── formGet.html │ │ │ │ │ ├── formPost.html │ │ │ │ │ ├── checkbox.html │ │ │ │ │ ├── checkbox2.html │ │ │ │ │ ├── formGet.jsp │ │ │ │ │ ├── checkbox.jsp │ │ │ │ │ └── formPost.jsp │ │ │ │ ├── redirect.jsp │ │ │ │ ├── hitCount.jsp │ │ │ │ └── date.jsp │ │ │ │ ├── 02.grammar │ │ │ │ ├── scriptlet.jsp │ │ │ │ ├── if2.jsp │ │ │ │ ├── while.jsp │ │ │ │ ├── break.jsp │ │ │ │ └── switch.jsp │ │ │ │ └── locale │ │ │ │ ├── language2.jsp │ │ │ │ ├── language.jsp │ │ │ │ ├── localeCurrency.jsp │ │ │ │ ├── localePercent.jsp │ │ │ │ └── localeDate.jsp │ │ │ └── java │ │ │ └── io │ │ │ └── github │ │ │ └── dunwu │ │ │ └── javaee │ │ │ └── jsp │ │ │ ├── util │ │ │ ├── ip │ │ │ │ └── QQWry.dat │ │ │ └── IpUtil.java │ │ │ └── bean │ │ │ ├── Counter.java │ │ │ ├── Message.java │ │ │ └── Person.java │ ├── javaee-taglib │ │ └── src │ │ │ └── main │ │ │ ├── resources │ │ │ └── copyright.properties │ │ │ ├── java │ │ │ └── io │ │ │ │ └── github │ │ │ │ └── dunwu │ │ │ │ └── javaee │ │ │ │ └── taglib │ │ │ │ ├── test │ │ │ │ ├── messages.properties │ │ │ │ └── TestMessage.java │ │ │ │ ├── tags2 │ │ │ │ ├── RepeatTag.java │ │ │ │ └── MultiTag.java │ │ │ │ ├── tags │ │ │ │ ├── ToLowerCaseTag.java │ │ │ │ ├── HelloTag.java │ │ │ │ ├── AddTag.java │ │ │ │ └── IteratorTag.java │ │ │ │ ├── HelloTag.java │ │ │ │ └── HelloTag2.java │ │ │ └── webapp │ │ │ ├── vote.gif │ │ │ ├── index.jsp │ │ │ ├── table.jsp │ │ │ ├── images │ │ │ ├── I.png │ │ │ ├── L.png │ │ │ ├── T.png │ │ │ ├── Lplus.png │ │ │ ├── Thumbs.db │ │ │ ├── Tplus.png │ │ │ ├── asc.gif │ │ │ ├── bg_4.jpg │ │ │ ├── blank.png │ │ │ ├── desc.gif │ │ │ ├── edit.gif │ │ │ ├── file.png │ │ │ ├── memo.gif │ │ │ ├── new.png │ │ │ ├── next.gif │ │ │ ├── prev.gif │ │ │ ├── role.gif │ │ │ ├── team.gif │ │ │ ├── trans.gif │ │ │ ├── Lminus.png │ │ │ ├── Tminus.png │ │ │ ├── delete.gif │ │ │ ├── element.gif │ │ │ ├── line01.gif │ │ │ ├── project.png │ │ │ ├── delimiter.gif │ │ │ ├── foldericon.png │ │ │ ├── ibm_logo.gif │ │ │ ├── password.gif │ │ │ ├── pspbrwse.jbf │ │ │ ├── rl-bullet.gif │ │ │ ├── top-left.gif │ │ │ ├── top-right.gif │ │ │ ├── bg-btn-blue.gif │ │ │ ├── bottom-left.gif │ │ │ ├── bottom-right.gif │ │ │ ├── btn-go-dark.gif │ │ │ ├── left-nav-corner.gif │ │ │ ├── openfoldericon.png │ │ │ ├── template-gradient.gif │ │ │ ├── ibm-tab-background.gif │ │ │ ├── pagetools-gradient.gif │ │ │ ├── pagetools_gradient_a.gif │ │ │ ├── top-content-shadow.gif │ │ │ ├── masthead-links-gradient.gif │ │ │ └── leftnav-overview-highlight.gif │ │ │ ├── taglib │ │ │ ├── helloTag.jsp │ │ │ ├── helloTag3.jsp │ │ │ ├── helloTag2.jsp │ │ │ └── copyright.jsp │ │ │ ├── WEB-INF │ │ │ └── tld │ │ │ │ ├── hello.tld │ │ │ │ ├── hello2.tld │ │ │ │ └── hello3.tld │ │ │ ├── multi.jsp │ │ │ ├── loop.jsp │ │ │ ├── toLowerCase.jsp │ │ │ ├── toUpperCase.jsp │ │ │ ├── hello.jsp │ │ │ ├── dynamic.jsp │ │ │ └── multiAttribute.jsp │ ├── javaee-filter │ │ └── src │ │ │ └── main │ │ │ ├── webapp │ │ │ ├── META-INF │ │ │ │ └── MANIFEST.MF │ │ │ ├── WEB-INF │ │ │ │ ├── logo.png │ │ │ │ ├── sensitive.properties │ │ │ │ └── privilege.properties │ │ │ └── views │ │ │ │ ├── images │ │ │ │ ├── mm.jpg │ │ │ │ ├── error.gif │ │ │ │ ├── sunset.jpg │ │ │ │ └── winter.jpg │ │ │ │ ├── xml │ │ │ │ ├── messageLog.xsl │ │ │ │ ├── book.xml │ │ │ │ ├── thinkInJava.xml │ │ │ │ └── xml.xsl │ │ │ │ └── jsp │ │ │ │ ├── testWaterMarkFilter.jsp │ │ │ │ ├── dispatcher.jsp │ │ │ │ ├── testOutputReplaceFilter.jsp │ │ │ │ ├── image.jsp │ │ │ │ ├── exception.jsp │ │ │ │ ├── businessException.jsp │ │ │ │ └── testCharacterEncodingFilter.jsp │ │ │ └── java │ │ │ └── io │ │ │ └── github │ │ │ └── dunwu │ │ │ └── javaee │ │ │ └── filter │ │ │ └── exception │ │ │ ├── AccountException.java │ │ │ └── BusinessException.java │ ├── javaee-listener │ │ └── src │ │ │ └── main │ │ │ ├── webapp │ │ │ ├── META-INF │ │ │ │ ├── MANIFEST.MF │ │ │ │ └── context.xml │ │ │ ├── a.gif │ │ │ ├── b.gif │ │ │ ├── aa.html │ │ │ ├── WEB-INF │ │ │ │ └── resources │ │ │ │ │ └── jsp │ │ │ │ │ └── index.jsp │ │ │ └── index.jsp │ │ │ └── java │ │ │ └── io │ │ │ └── github │ │ │ └── dunwu │ │ │ └── javaee │ │ │ └── listener │ │ │ └── util │ │ │ └── ApplicationConstants.java │ ├── javaee-servlet │ │ └── src │ │ │ └── main │ │ │ ├── webapp │ │ │ └── META-INF │ │ │ │ └── MANIFEST.MF │ │ │ └── java │ │ │ └── io │ │ │ └── github │ │ │ └── dunwu │ │ │ └── javaee │ │ │ └── servlet │ │ │ └── upload │ │ │ └── UploadListener.java │ ├── javaee-session │ │ └── src │ │ │ └── main │ │ │ ├── webapp │ │ │ ├── META-INF │ │ │ │ ├── MANIFEST.MF │ │ │ │ └── context.xml │ │ │ ├── views │ │ │ │ ├── images │ │ │ │ │ ├── mail.gif │ │ │ │ │ ├── cookie.gif │ │ │ │ │ ├── errorstate.gif │ │ │ │ │ ├── bg-btn-blue.gif │ │ │ │ │ └── vertical_line.gif │ │ │ │ └── jsp │ │ │ │ │ └── cookie │ │ │ │ │ ├── cookie.gif │ │ │ │ │ ├── addCookies.jsp │ │ │ │ │ └── maxAge.jsp │ │ │ └── encodeURL.jsp │ │ │ └── java │ │ │ └── io │ │ │ └── github │ │ │ └── dunwu │ │ │ └── javaee │ │ │ └── cookie │ │ │ └── bean │ │ │ └── Topic.java │ ├── javaee-jstl │ │ └── src │ │ │ └── main │ │ │ ├── resources │ │ │ ├── messages.properties │ │ │ ├── messages_zh_CN.properties │ │ │ └── sql │ │ │ │ ├── create_employees.sql │ │ │ │ └── create_students.sql │ │ │ ├── webapp │ │ │ ├── examples │ │ │ │ ├── uncheck │ │ │ │ │ ├── param.jsp │ │ │ │ │ ├── url.jsp │ │ │ │ │ ├── index.jsp │ │ │ │ │ ├── redirect.jsp │ │ │ │ │ ├── fmt.jsp │ │ │ │ │ ├── out.jsp │ │ │ │ │ ├── fn.jsp │ │ │ │ │ ├── choose.jsp │ │ │ │ │ ├── parseNumber.jsp │ │ │ │ │ ├── remove.jsp │ │ │ │ │ ├── sql.jsp │ │ │ │ │ ├── indexOf.jsp │ │ │ │ │ ├── import.jsp │ │ │ │ │ ├── join.jsp │ │ │ │ │ ├── catch.jsp │ │ │ │ │ ├── parseDate.jsp │ │ │ │ │ ├── escapeXml.jsp │ │ │ │ │ ├── substring.jsp │ │ │ │ │ ├── length.jsp │ │ │ │ │ ├── split.jsp │ │ │ │ │ └── setBundle.jsp │ │ │ │ ├── core │ │ │ │ │ ├── c_redirect.jsp │ │ │ │ │ ├── c_import.jsp │ │ │ │ │ ├── c_set.jsp │ │ │ │ │ ├── c_forEach.jsp │ │ │ │ │ ├── c_url.jsp │ │ │ │ │ ├── c_forTokens.jsp │ │ │ │ │ ├── c_if.jsp │ │ │ │ │ ├── c_remove.jsp │ │ │ │ │ ├── c_catch.jsp │ │ │ │ │ ├── c_choose.jsp │ │ │ │ │ ├── c_out.jsp │ │ │ │ │ └── c_param.jsp │ │ │ │ ├── function │ │ │ │ │ ├── fn_toLowerCase.jsp │ │ │ │ │ ├── fn_toUpperCase.jsp │ │ │ │ │ ├── fn_substring.jsp │ │ │ │ │ ├── fn_substringAfter.jsp │ │ │ │ │ ├── fn_substringBefore.jsp │ │ │ │ │ ├── fn_join.jsp │ │ │ │ │ ├── fn_replace.jsp │ │ │ │ │ ├── fn_length.jsp │ │ │ │ │ ├── fn_trim.jsp │ │ │ │ │ ├── fn_contains.jsp │ │ │ │ │ ├── fn_indexOf.jsp │ │ │ │ │ ├── fn_startsWith.jsp │ │ │ │ │ ├── fn_endsWith.jsp │ │ │ │ │ ├── fn_containsIgnoreCase.jsp │ │ │ │ │ ├── fn_split.jsp │ │ │ │ │ └── fn_escapeXml.jsp │ │ │ │ ├── fmt │ │ │ │ │ ├── fmt_bundle.jsp │ │ │ │ │ ├── fmt_parseDate.jsp │ │ │ │ │ ├── fmt_parseNumber.jsp │ │ │ │ │ ├── fmt_requestEncoding.jsp │ │ │ │ │ └── fmt_setTimeZone.jsp │ │ │ │ ├── sql │ │ │ │ │ └── sql_setDataSource.jsp │ │ │ │ └── xml │ │ │ │ │ ├── x_parse.jsp │ │ │ │ │ ├── x_set.jsp │ │ │ │ │ └── x_transform.jsp │ │ │ └── xml │ │ │ │ ├── books.xml │ │ │ │ └── style.xsl │ │ │ └── java │ │ │ └── io │ │ │ └── github │ │ │ └── dunwu │ │ │ └── javaee │ │ │ └── util │ │ │ ├── Example.java │ │ │ └── Example_es_ES.java │ ├── javaee-oss │ │ └── src │ │ │ ├── main │ │ │ ├── resources │ │ │ │ ├── template │ │ │ │ │ ├── hello.vm │ │ │ │ │ ├── velocity.properties │ │ │ │ │ ├── header.vm │ │ │ │ │ └── footer.vm │ │ │ │ ├── images │ │ │ │ │ ├── lion.jpg │ │ │ │ │ └── lion2.jpg │ │ │ │ ├── html │ │ │ │ │ └── example.html │ │ │ │ └── mail │ │ │ │ │ └── mail.properties │ │ │ └── java │ │ │ │ └── io │ │ │ │ └── github │ │ │ │ └── dunwu │ │ │ │ └── javaee │ │ │ │ └── oss │ │ │ │ └── logging │ │ │ │ ├── Slf4jDemo.java │ │ │ │ └── JclDemo.java │ │ │ └── test │ │ │ ├── resources │ │ │ └── images │ │ │ │ ├── lion.jpg │ │ │ │ ├── lion2.jpg │ │ │ │ ├── wartermark.png │ │ │ │ └── lion2_watermark.png │ │ │ └── java │ │ │ └── io │ │ │ └── github │ │ │ └── dunwu │ │ │ └── javaee │ │ │ └── oss │ │ │ └── template │ │ │ └── VelocityUtilTest.java │ └── javaee-websocket │ │ └── src │ │ └── main │ │ ├── webapp │ │ └── WEB-INF │ │ │ └── web.xml │ │ └── java │ │ └── io │ │ └── github │ │ └── dunwu │ │ └── javaee │ │ └── websocket │ │ └── WebSocketServerConfigurator.java ├── README.md ├── java-distributed │ ├── README.md │ ├── java-load-balance │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── io │ │ │ └── github │ │ │ └── dunwu │ │ │ └── distributed │ │ │ ├── support │ │ │ ├── HashStrategy.java │ │ │ ├── JdkHashCodeStrategy.java │ │ │ └── FnvHashStrategy.java │ │ │ ├── package-info.java │ │ │ ├── LoadBalance.java │ │ │ ├── RandomLoadBalance.java │ │ │ └── IpHashLoadBalance.java │ ├── java-rate-limit │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── io │ │ │ │ └── github │ │ │ │ └── dunwu │ │ │ │ └── distributed │ │ │ │ └── ratelimit │ │ │ │ └── RateLimiter.java │ │ │ └── resources │ │ │ └── scripts │ │ │ └── fixed_window_rate_limit.lua │ └── java-distributed-id │ │ └── src │ │ └── main │ │ └── resources │ │ └── scripts │ │ └── fixed_window_rate_limit.lua ├── javatech │ ├── javatech-server │ │ └── src │ │ │ └── main │ │ │ ├── webapp │ │ │ ├── META-INF │ │ │ │ └── MANIFEST.MF │ │ │ └── views │ │ │ │ └── jsp │ │ │ │ ├── hello.jsp │ │ │ │ └── index.jsp │ │ │ ├── resources │ │ │ └── properties │ │ │ │ ├── application-develop.properties │ │ │ │ └── application-test.properties │ │ │ └── java │ │ │ └── io │ │ │ └── github │ │ │ └── dunwu │ │ │ └── javatech │ │ │ └── service │ │ │ └── HelloService.java │ ├── javatech-others │ │ ├── javatech-ruleengine │ │ │ ├── README.md │ │ │ └── src │ │ │ │ └── main │ │ │ │ ├── resources │ │ │ │ └── weather-rule.yml │ │ │ │ └── java │ │ │ │ └── io │ │ │ │ └── github │ │ │ │ └── dunwu │ │ │ │ └── javatech │ │ │ │ └── rule │ │ │ │ ├── mvel │ │ │ │ └── RuleContext.java │ │ │ │ └── eazyrules │ │ │ │ └── WeatherRule.java │ │ ├── javatech-zookeeper │ │ │ └── src │ │ │ │ └── main │ │ │ │ └── java │ │ │ │ └── io │ │ │ │ └── github │ │ │ │ └── dunwu │ │ │ │ └── javatech │ │ │ │ └── zk │ │ │ │ ├── example │ │ │ │ └── package-info.java │ │ │ │ ├── sequence │ │ │ │ └── DistributedSequence.java │ │ │ │ └── dlock │ │ │ │ ├── TimeoutHandler.java │ │ │ │ ├── Callback.java │ │ │ │ ├── DistributedLock.java │ │ │ │ └── DLockTemplate.java │ │ ├── javatech-cli │ │ │ └── src │ │ │ │ ├── main │ │ │ │ └── java │ │ │ │ │ └── io │ │ │ │ │ └── github │ │ │ │ │ └── dunwu │ │ │ │ │ └── javatech │ │ │ │ │ └── constant │ │ │ │ │ └── AnsiElement.java │ │ │ │ └── test │ │ │ │ └── java │ │ │ │ └── io │ │ │ │ └── github │ │ │ │ └── dunwu │ │ │ │ └── javatech │ │ │ │ └── CliUtilTests.java │ │ └── pom.xml │ ├── javatech-lib │ │ └── src │ │ │ ├── test │ │ │ ├── java │ │ │ │ └── io │ │ │ │ │ └── github │ │ │ │ │ └── dunwu │ │ │ │ │ └── javatech │ │ │ │ │ ├── java │ │ │ │ │ └── samples │ │ │ │ │ │ ├── Foo.java │ │ │ │ │ │ ├── LexicalPreservation.java │ │ │ │ │ │ ├── A.java │ │ │ │ │ │ ├── Bar.java │ │ │ │ │ │ ├── WebSocketMsgType.java │ │ │ │ │ │ ├── CaptchaTypeEnum.java │ │ │ │ │ │ └── CodeBiEnum.java │ │ │ │ │ ├── seriralize │ │ │ │ │ └── json │ │ │ │ │ │ └── gson │ │ │ │ │ │ └── VersionedClass.java │ │ │ │ │ └── reflections │ │ │ │ │ └── UsageTestModel.java │ │ │ └── resources │ │ │ │ └── META-INF │ │ │ │ └── reflections │ │ │ │ └── inner │ │ │ │ └── resource2-reflections.xml │ │ │ └── main │ │ │ └── java │ │ │ └── io │ │ │ └── github │ │ │ └── dunwu │ │ │ └── javatech │ │ │ ├── bean │ │ │ ├── lombok │ │ │ │ ├── package-info.java │ │ │ │ ├── NonNullDemo.java │ │ │ │ ├── DataDemo.java │ │ │ │ ├── GetterAndSetterDemo.java │ │ │ │ ├── User.java │ │ │ │ ├── ToStringDemo.java │ │ │ │ └── Person.java │ │ │ └── sample │ │ │ │ └── User.java │ │ │ └── seriralize │ │ │ └── util │ │ │ └── User.java │ ├── javatech-mq │ │ ├── javatech-rocketmq │ │ │ └── src │ │ │ │ └── main │ │ │ │ └── java │ │ │ │ └── io │ │ │ │ └── github │ │ │ │ └── dunwu │ │ │ │ └── javatech │ │ │ │ └── rocketmq │ │ │ │ ├── order │ │ │ │ └── README.md │ │ │ │ ├── scheduled │ │ │ │ └── README.md │ │ │ │ ├── broadcast │ │ │ │ └── README.md │ │ │ │ ├── RocketConstant.java │ │ │ │ ├── simple │ │ │ │ └── README.md │ │ │ │ └── batch │ │ │ │ └── README.md │ │ ├── javatech-kafka-springboot │ │ │ └── src │ │ │ │ ├── main │ │ │ │ ├── java │ │ │ │ │ └── io │ │ │ │ │ │ └── github │ │ │ │ │ │ └── dunwu │ │ │ │ │ │ └── javatech │ │ │ │ │ │ ├── MsgKafkaApplication.java │ │ │ │ │ │ └── KafkaConsumer.java │ │ │ │ └── resources │ │ │ │ │ ├── logback.xml │ │ │ │ │ └── application.properties │ │ │ │ └── test │ │ │ │ └── java │ │ │ │ └── io │ │ │ │ └── github │ │ │ │ └── dunwu │ │ │ │ └── javatech │ │ │ │ └── KafkaProducerTest.java │ │ └── pom.xml │ ├── javatech-cache │ │ └── src │ │ │ ├── test │ │ │ ├── java │ │ │ │ └── io │ │ │ │ │ └── github │ │ │ │ │ └── dunwu │ │ │ │ │ └── javatech │ │ │ │ │ └── cache │ │ │ │ │ ├── spring │ │ │ │ │ └── package-info.java │ │ │ │ │ └── LRUCacheTest.java │ │ │ └── resources │ │ │ │ └── ehcache │ │ │ │ ├── ehcache1.xml │ │ │ │ └── ehcache2.xml │ │ │ └── main │ │ │ ├── resources │ │ │ ├── sql │ │ │ │ ├── data.sql │ │ │ │ └── schema.sql │ │ │ ├── logback.xml │ │ │ ├── banner.txt │ │ │ └── application.properties │ │ │ └── java │ │ │ └── io │ │ │ └── github │ │ │ └── dunwu │ │ │ └── javatech │ │ │ └── cache │ │ │ └── CaffeineDemo.java │ └── javatech-log │ │ └── pom.xml ├── javatool │ ├── javatool-monitor │ │ ├── javatool-zipkin-springboot │ │ │ ├── src │ │ │ │ └── main │ │ │ │ │ └── resources │ │ │ │ │ ├── META-INF │ │ │ │ │ └── spring.factories │ │ │ │ │ └── application.properties │ │ │ └── README.md │ │ ├── javatool-zipkin-spring │ │ │ ├── README.md │ │ │ └── src │ │ │ │ └── main │ │ │ │ ├── resources │ │ │ │ └── log4j2.properties │ │ │ │ └── java │ │ │ │ └── io │ │ │ │ └── github │ │ │ │ └── dunwu │ │ │ │ └── javatool │ │ │ │ └── monitor │ │ │ │ └── zipkin │ │ │ │ └── package-info.java │ │ └── pom.xml │ └── pom.xml ├── deadloop │ └── src │ │ └── main │ │ ├── resources │ │ ├── logback.xml │ │ ├── sql │ │ │ ├── schema.sql │ │ │ └── data.sql │ │ ├── banner.txt │ │ └── application.properties │ │ └── java │ │ └── io │ │ └── github │ │ └── dunwu │ │ └── trouble │ │ └── FooService.java └── trouble-shooting │ └── src │ └── main │ └── resources │ ├── logback.xml │ ├── sql │ ├── schema.sql │ └── data.sql │ ├── banner.txt │ └── application.properties ├── .babelrc ├── docs ├── .vuepress │ ├── config │ │ └── baiduCode.js │ ├── public │ │ ├── favicon.ico │ │ └── img │ │ │ ├── bg.gif │ │ │ ├── more.png │ │ │ ├── other.png │ │ │ ├── favicon.ico │ │ │ └── dunwu-logo.png │ └── plugins │ │ └── love-me │ │ └── index.js ├── @pages │ ├── tagsPage.md │ ├── archivesPage.md │ └── categoriesPage.md ├── 01.Java │ ├── 12.工具 │ │ ├── 04.测试 │ │ │ └── README.md │ │ └── 99.其他 │ │ │ └── 02.Java工具包.md │ ├── 13.框架 │ │ └── 01.Spring │ │ │ └── 01.Spring核心 │ │ │ └── 24.SpringEL.md │ ├── 11.软件 │ │ ├── 02.IDE │ │ │ └── README.md │ │ └── 03.监控诊断 │ │ │ ├── README.md │ │ │ └── 01.监控工具对比.md │ └── 02.JavaEE │ │ └── 02.服务器 │ │ └── 01.Tomcat │ │ └── README.md └── .markdownlint.json ├── settings └── elastic │ └── logstash │ ├── logstash-input-stdin.conf │ ├── logstash-input-udp.conf │ ├── logstash-input-tcp.conf │ └── logstash-input-file.conf ├── prettier.config.js ├── utils ├── config.yml └── modules │ └── fn.js ├── .editorconfig ├── scripts └── init.sh └── pom.xml /codes/javaee/README.md: -------------------------------------------------------------------------------- 1 | # JavaEE 示例代码 -------------------------------------------------------------------------------- /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "compact": false 3 | } 4 | -------------------------------------------------------------------------------- /codes/README.md: -------------------------------------------------------------------------------- 1 | # Source Code 2 | 3 | > 示例代码。 4 | -------------------------------------------------------------------------------- /docs/.vuepress/config/baiduCode.js: -------------------------------------------------------------------------------- 1 | module.exports = '' 2 | -------------------------------------------------------------------------------- /codes/java-distributed/README.md: -------------------------------------------------------------------------------- 1 | # Java 和分布式 2 | 3 | > 分布式系统中常用算法的 Java 实现方案 4 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jsp/src/main/webapp/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Class-Path: 3 | 4 | -------------------------------------------------------------------------------- /codes/javaee/javaee-taglib/src/main/resources/copyright.properties: -------------------------------------------------------------------------------- 1 | copyright=©2016-2017, Zhang Peng 2 | -------------------------------------------------------------------------------- /docs/@pages/tagsPage.md: -------------------------------------------------------------------------------- 1 | --- 2 | tagsPage: true 3 | title: 标签 4 | permalink: /tags/ 5 | article: false 6 | --- -------------------------------------------------------------------------------- /codes/javaee/javaee-filter/src/main/webapp/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Class-Path: 3 | 4 | -------------------------------------------------------------------------------- /codes/javaee/javaee-listener/src/main/webapp/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Class-Path: 3 | 4 | -------------------------------------------------------------------------------- /codes/javaee/javaee-servlet/src/main/webapp/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Class-Path: 3 | 4 | -------------------------------------------------------------------------------- /codes/javaee/javaee-session/src/main/webapp/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Class-Path: 3 | 4 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jsp/src/main/webapp/WEB-INF/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Class-Path: 3 | 4 | -------------------------------------------------------------------------------- /codes/javatech/javatech-server/src/main/webapp/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Class-Path: 3 | 4 | -------------------------------------------------------------------------------- /docs/.vuepress/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/java-tutorial/HEAD/docs/.vuepress/public/favicon.ico -------------------------------------------------------------------------------- /docs/.vuepress/public/img/bg.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/java-tutorial/HEAD/docs/.vuepress/public/img/bg.gif -------------------------------------------------------------------------------- /docs/.vuepress/public/img/more.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/java-tutorial/HEAD/docs/.vuepress/public/img/more.png -------------------------------------------------------------------------------- /codes/javaee/javaee-taglib/src/main/java/io/github/dunwu/javaee/taglib/test/messages.properties: -------------------------------------------------------------------------------- 1 | TestMessage.0=test {0}, {1} 2 | -------------------------------------------------------------------------------- /docs/.vuepress/public/img/other.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/java-tutorial/HEAD/docs/.vuepress/public/img/other.png -------------------------------------------------------------------------------- /docs/@pages/archivesPage.md: -------------------------------------------------------------------------------- 1 | --- 2 | archivesPage: true 3 | title: 归档 4 | permalink: /archives/ 5 | article: false 6 | --- 7 | -------------------------------------------------------------------------------- /docs/@pages/categoriesPage.md: -------------------------------------------------------------------------------- 1 | --- 2 | categoriesPage: true 3 | title: 分类 4 | permalink: /categories/ 5 | article: false 6 | --- -------------------------------------------------------------------------------- /codes/javaee/javaee-jsp/src/main/webapp/views/jsp/directive.jsp: -------------------------------------------------------------------------------- 1 | <%@page contentType="image/jpeg" %> 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jstl/src/main/resources/messages.properties: -------------------------------------------------------------------------------- 1 | prompt.hello=Hello, "{0}". 2 | prompt.greeting=Nice to meet you. 3 | -------------------------------------------------------------------------------- /docs/.vuepress/public/img/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/java-tutorial/HEAD/docs/.vuepress/public/img/favicon.ico -------------------------------------------------------------------------------- /docs/.vuepress/public/img/dunwu-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/java-tutorial/HEAD/docs/.vuepress/public/img/dunwu-logo.png -------------------------------------------------------------------------------- /codes/javaee/javaee-oss/src/main/resources/template/hello.vm: -------------------------------------------------------------------------------- 1 | Hello World! The first velocity demo. 2 | Name is $name. 3 | Project is $project -------------------------------------------------------------------------------- /codes/javaee/javaee-listener/src/main/webapp/a.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/java-tutorial/HEAD/codes/javaee/javaee-listener/src/main/webapp/a.gif -------------------------------------------------------------------------------- /codes/javaee/javaee-listener/src/main/webapp/b.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/java-tutorial/HEAD/codes/javaee/javaee-listener/src/main/webapp/b.gif -------------------------------------------------------------------------------- /codes/javaee/javaee-taglib/src/main/webapp/vote.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/java-tutorial/HEAD/codes/javaee/javaee-taglib/src/main/webapp/vote.gif -------------------------------------------------------------------------------- /codes/javaee/javaee-taglib/src/main/webapp/index.jsp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/java-tutorial/HEAD/codes/javaee/javaee-taglib/src/main/webapp/index.jsp -------------------------------------------------------------------------------- /codes/javaee/javaee-taglib/src/main/webapp/table.jsp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/java-tutorial/HEAD/codes/javaee/javaee-taglib/src/main/webapp/table.jsp -------------------------------------------------------------------------------- /codes/javaee/javaee-jsp/src/main/webapp/images/mail.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/java-tutorial/HEAD/codes/javaee/javaee-jsp/src/main/webapp/images/mail.gif -------------------------------------------------------------------------------- /codes/javaee/javaee-jstl/src/main/resources/messages_zh_CN.properties: -------------------------------------------------------------------------------- 1 | prompt.hello=\u4f60\u597d, "{0}". 2 | prompt.greeting=\u5f88\u9ad8\u5174\u89c1\u5230\u4f60. 3 | -------------------------------------------------------------------------------- /codes/javaee/javaee-taglib/src/main/webapp/images/I.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/java-tutorial/HEAD/codes/javaee/javaee-taglib/src/main/webapp/images/I.png -------------------------------------------------------------------------------- /codes/javaee/javaee-taglib/src/main/webapp/images/L.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/java-tutorial/HEAD/codes/javaee/javaee-taglib/src/main/webapp/images/L.png -------------------------------------------------------------------------------- /codes/javaee/javaee-taglib/src/main/webapp/images/T.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/java-tutorial/HEAD/codes/javaee/javaee-taglib/src/main/webapp/images/T.png -------------------------------------------------------------------------------- /codes/javaee/javaee-filter/src/main/webapp/WEB-INF/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/java-tutorial/HEAD/codes/javaee/javaee-filter/src/main/webapp/WEB-INF/logo.png -------------------------------------------------------------------------------- /codes/javaee/javaee-jsp/src/main/webapp/views/jsp/index.jsp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/java-tutorial/HEAD/codes/javaee/javaee-jsp/src/main/webapp/views/jsp/index.jsp -------------------------------------------------------------------------------- /codes/javaee/javaee-oss/src/main/resources/images/lion.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/java-tutorial/HEAD/codes/javaee/javaee-oss/src/main/resources/images/lion.jpg -------------------------------------------------------------------------------- /codes/javaee/javaee-oss/src/main/resources/images/lion2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/java-tutorial/HEAD/codes/javaee/javaee-oss/src/main/resources/images/lion2.jpg -------------------------------------------------------------------------------- /codes/javaee/javaee-oss/src/test/resources/images/lion.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/java-tutorial/HEAD/codes/javaee/javaee-oss/src/test/resources/images/lion.jpg -------------------------------------------------------------------------------- /codes/javaee/javaee-oss/src/test/resources/images/lion2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/java-tutorial/HEAD/codes/javaee/javaee-oss/src/test/resources/images/lion2.jpg -------------------------------------------------------------------------------- /codes/javaee/javaee-taglib/src/main/webapp/images/Lplus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/java-tutorial/HEAD/codes/javaee/javaee-taglib/src/main/webapp/images/Lplus.png -------------------------------------------------------------------------------- /codes/javaee/javaee-taglib/src/main/webapp/images/Thumbs.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/java-tutorial/HEAD/codes/javaee/javaee-taglib/src/main/webapp/images/Thumbs.db -------------------------------------------------------------------------------- /codes/javaee/javaee-taglib/src/main/webapp/images/Tplus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/java-tutorial/HEAD/codes/javaee/javaee-taglib/src/main/webapp/images/Tplus.png -------------------------------------------------------------------------------- /codes/javaee/javaee-taglib/src/main/webapp/images/asc.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/java-tutorial/HEAD/codes/javaee/javaee-taglib/src/main/webapp/images/asc.gif -------------------------------------------------------------------------------- /codes/javaee/javaee-taglib/src/main/webapp/images/bg_4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/java-tutorial/HEAD/codes/javaee/javaee-taglib/src/main/webapp/images/bg_4.jpg -------------------------------------------------------------------------------- /codes/javaee/javaee-taglib/src/main/webapp/images/blank.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/java-tutorial/HEAD/codes/javaee/javaee-taglib/src/main/webapp/images/blank.png -------------------------------------------------------------------------------- /codes/javaee/javaee-taglib/src/main/webapp/images/desc.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/java-tutorial/HEAD/codes/javaee/javaee-taglib/src/main/webapp/images/desc.gif -------------------------------------------------------------------------------- /codes/javaee/javaee-taglib/src/main/webapp/images/edit.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/java-tutorial/HEAD/codes/javaee/javaee-taglib/src/main/webapp/images/edit.gif -------------------------------------------------------------------------------- /codes/javaee/javaee-taglib/src/main/webapp/images/file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/java-tutorial/HEAD/codes/javaee/javaee-taglib/src/main/webapp/images/file.png -------------------------------------------------------------------------------- /codes/javaee/javaee-taglib/src/main/webapp/images/memo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/java-tutorial/HEAD/codes/javaee/javaee-taglib/src/main/webapp/images/memo.gif -------------------------------------------------------------------------------- /codes/javaee/javaee-taglib/src/main/webapp/images/new.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/java-tutorial/HEAD/codes/javaee/javaee-taglib/src/main/webapp/images/new.png -------------------------------------------------------------------------------- /codes/javaee/javaee-taglib/src/main/webapp/images/next.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/java-tutorial/HEAD/codes/javaee/javaee-taglib/src/main/webapp/images/next.gif -------------------------------------------------------------------------------- /codes/javaee/javaee-taglib/src/main/webapp/images/prev.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/java-tutorial/HEAD/codes/javaee/javaee-taglib/src/main/webapp/images/prev.gif -------------------------------------------------------------------------------- /codes/javaee/javaee-taglib/src/main/webapp/images/role.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/java-tutorial/HEAD/codes/javaee/javaee-taglib/src/main/webapp/images/role.gif -------------------------------------------------------------------------------- /codes/javaee/javaee-taglib/src/main/webapp/images/team.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/java-tutorial/HEAD/codes/javaee/javaee-taglib/src/main/webapp/images/team.gif -------------------------------------------------------------------------------- /codes/javaee/javaee-taglib/src/main/webapp/images/trans.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/java-tutorial/HEAD/codes/javaee/javaee-taglib/src/main/webapp/images/trans.gif -------------------------------------------------------------------------------- /codes/javatech/javatech-others/javatech-ruleengine/README.md: -------------------------------------------------------------------------------- 1 | # 规则引擎示例 2 | 3 | - [easy-rules](https://github.com/j-easy/easy-rules) - 使用便捷简单:支持注解、Java API、MVEL 表达式 方式定义规则 -------------------------------------------------------------------------------- /codes/javaee/javaee-oss/src/main/resources/html/example.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 测试html页面 4 | 5 | 6 |

牛刀小试

7 | 8 | 9 | -------------------------------------------------------------------------------- /codes/javaee/javaee-taglib/src/main/webapp/images/Lminus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/java-tutorial/HEAD/codes/javaee/javaee-taglib/src/main/webapp/images/Lminus.png -------------------------------------------------------------------------------- /codes/javaee/javaee-taglib/src/main/webapp/images/Tminus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/java-tutorial/HEAD/codes/javaee/javaee-taglib/src/main/webapp/images/Tminus.png -------------------------------------------------------------------------------- /codes/javaee/javaee-taglib/src/main/webapp/images/delete.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/java-tutorial/HEAD/codes/javaee/javaee-taglib/src/main/webapp/images/delete.gif -------------------------------------------------------------------------------- /codes/javaee/javaee-taglib/src/main/webapp/images/element.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/java-tutorial/HEAD/codes/javaee/javaee-taglib/src/main/webapp/images/element.gif -------------------------------------------------------------------------------- /codes/javaee/javaee-taglib/src/main/webapp/images/line01.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/java-tutorial/HEAD/codes/javaee/javaee-taglib/src/main/webapp/images/line01.gif -------------------------------------------------------------------------------- /codes/javaee/javaee-taglib/src/main/webapp/images/project.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/java-tutorial/HEAD/codes/javaee/javaee-taglib/src/main/webapp/images/project.png -------------------------------------------------------------------------------- /codes/javaee/javaee-filter/src/main/webapp/views/images/mm.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/java-tutorial/HEAD/codes/javaee/javaee-filter/src/main/webapp/views/images/mm.jpg -------------------------------------------------------------------------------- /codes/javaee/javaee-jsp/src/main/webapp/images/bg-btn-blue.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/java-tutorial/HEAD/codes/javaee/javaee-jsp/src/main/webapp/images/bg-btn-blue.gif -------------------------------------------------------------------------------- /codes/javaee/javaee-jsp/src/main/webapp/images/vertical_line.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/java-tutorial/HEAD/codes/javaee/javaee-jsp/src/main/webapp/images/vertical_line.gif -------------------------------------------------------------------------------- /codes/javaee/javaee-oss/src/test/resources/images/wartermark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/java-tutorial/HEAD/codes/javaee/javaee-oss/src/test/resources/images/wartermark.png -------------------------------------------------------------------------------- /codes/javaee/javaee-taglib/src/main/webapp/images/delimiter.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/java-tutorial/HEAD/codes/javaee/javaee-taglib/src/main/webapp/images/delimiter.gif -------------------------------------------------------------------------------- /codes/javaee/javaee-taglib/src/main/webapp/images/foldericon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/java-tutorial/HEAD/codes/javaee/javaee-taglib/src/main/webapp/images/foldericon.png -------------------------------------------------------------------------------- /codes/javaee/javaee-taglib/src/main/webapp/images/ibm_logo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/java-tutorial/HEAD/codes/javaee/javaee-taglib/src/main/webapp/images/ibm_logo.gif -------------------------------------------------------------------------------- /codes/javaee/javaee-taglib/src/main/webapp/images/password.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/java-tutorial/HEAD/codes/javaee/javaee-taglib/src/main/webapp/images/password.gif -------------------------------------------------------------------------------- /codes/javaee/javaee-taglib/src/main/webapp/images/pspbrwse.jbf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/java-tutorial/HEAD/codes/javaee/javaee-taglib/src/main/webapp/images/pspbrwse.jbf -------------------------------------------------------------------------------- /codes/javaee/javaee-taglib/src/main/webapp/images/rl-bullet.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/java-tutorial/HEAD/codes/javaee/javaee-taglib/src/main/webapp/images/rl-bullet.gif -------------------------------------------------------------------------------- /codes/javaee/javaee-taglib/src/main/webapp/images/top-left.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/java-tutorial/HEAD/codes/javaee/javaee-taglib/src/main/webapp/images/top-left.gif -------------------------------------------------------------------------------- /codes/javaee/javaee-taglib/src/main/webapp/images/top-right.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/java-tutorial/HEAD/codes/javaee/javaee-taglib/src/main/webapp/images/top-right.gif -------------------------------------------------------------------------------- /settings/elastic/logstash/logstash-input-stdin.conf: -------------------------------------------------------------------------------- 1 | input { stdin { } } 2 | output { 3 | elasticsearch { hosts => ["localhost:9200"] } 4 | stdout { codec => rubydebug } 5 | } 6 | -------------------------------------------------------------------------------- /codes/javaee/javaee-filter/src/main/webapp/views/images/error.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/java-tutorial/HEAD/codes/javaee/javaee-filter/src/main/webapp/views/images/error.gif -------------------------------------------------------------------------------- /codes/javaee/javaee-filter/src/main/webapp/views/images/sunset.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/java-tutorial/HEAD/codes/javaee/javaee-filter/src/main/webapp/views/images/sunset.jpg -------------------------------------------------------------------------------- /codes/javaee/javaee-filter/src/main/webapp/views/images/winter.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/java-tutorial/HEAD/codes/javaee/javaee-filter/src/main/webapp/views/images/winter.jpg -------------------------------------------------------------------------------- /codes/javaee/javaee-session/src/main/webapp/META-INF/context.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /codes/javaee/javaee-session/src/main/webapp/views/images/mail.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/java-tutorial/HEAD/codes/javaee/javaee-session/src/main/webapp/views/images/mail.gif -------------------------------------------------------------------------------- /codes/javaee/javaee-taglib/src/main/webapp/images/bg-btn-blue.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/java-tutorial/HEAD/codes/javaee/javaee-taglib/src/main/webapp/images/bg-btn-blue.gif -------------------------------------------------------------------------------- /codes/javaee/javaee-taglib/src/main/webapp/images/bottom-left.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/java-tutorial/HEAD/codes/javaee/javaee-taglib/src/main/webapp/images/bottom-left.gif -------------------------------------------------------------------------------- /codes/javaee/javaee-taglib/src/main/webapp/images/bottom-right.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/java-tutorial/HEAD/codes/javaee/javaee-taglib/src/main/webapp/images/bottom-right.gif -------------------------------------------------------------------------------- /codes/javaee/javaee-taglib/src/main/webapp/images/btn-go-dark.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/java-tutorial/HEAD/codes/javaee/javaee-taglib/src/main/webapp/images/btn-go-dark.gif -------------------------------------------------------------------------------- /codes/javaee/javaee-filter/src/main/webapp/views/xml/messageLog.xsl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/java-tutorial/HEAD/codes/javaee/javaee-filter/src/main/webapp/views/xml/messageLog.xsl -------------------------------------------------------------------------------- /codes/javaee/javaee-jstl/src/main/webapp/examples/uncheck/param.jsp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/java-tutorial/HEAD/codes/javaee/javaee-jstl/src/main/webapp/examples/uncheck/param.jsp -------------------------------------------------------------------------------- /codes/javaee/javaee-oss/src/main/resources/mail/mail.properties: -------------------------------------------------------------------------------- 1 | smtp.host=smtp.163.com 2 | pop3.host=pop3.163.com 3 | mail.host=@163.com 4 | mail.account=xxxxxx 5 | mail.password=xxxxxx 6 | -------------------------------------------------------------------------------- /codes/javaee/javaee-oss/src/test/resources/images/lion2_watermark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/java-tutorial/HEAD/codes/javaee/javaee-oss/src/test/resources/images/lion2_watermark.png -------------------------------------------------------------------------------- /codes/javaee/javaee-session/src/main/webapp/views/images/cookie.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/java-tutorial/HEAD/codes/javaee/javaee-session/src/main/webapp/views/images/cookie.gif -------------------------------------------------------------------------------- /codes/javaee/javaee-taglib/src/main/webapp/images/left-nav-corner.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/java-tutorial/HEAD/codes/javaee/javaee-taglib/src/main/webapp/images/left-nav-corner.gif -------------------------------------------------------------------------------- /codes/javaee/javaee-taglib/src/main/webapp/images/openfoldericon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/java-tutorial/HEAD/codes/javaee/javaee-taglib/src/main/webapp/images/openfoldericon.png -------------------------------------------------------------------------------- /codes/javatech/javatech-lib/src/test/java/io/github/dunwu/javatech/java/samples/Foo.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.javatech.java.samples; 2 | 3 | class Foo { 4 | 5 | Bar bar; 6 | 7 | } 8 | -------------------------------------------------------------------------------- /codes/javaee/javaee-session/src/main/webapp/views/images/errorstate.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/java-tutorial/HEAD/codes/javaee/javaee-session/src/main/webapp/views/images/errorstate.gif -------------------------------------------------------------------------------- /codes/javaee/javaee-session/src/main/webapp/views/jsp/cookie/cookie.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/java-tutorial/HEAD/codes/javaee/javaee-session/src/main/webapp/views/jsp/cookie/cookie.gif -------------------------------------------------------------------------------- /codes/javaee/javaee-taglib/src/main/webapp/images/template-gradient.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/java-tutorial/HEAD/codes/javaee/javaee-taglib/src/main/webapp/images/template-gradient.gif -------------------------------------------------------------------------------- /codes/javaee/javaee-session/src/main/webapp/views/images/bg-btn-blue.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/java-tutorial/HEAD/codes/javaee/javaee-session/src/main/webapp/views/images/bg-btn-blue.gif -------------------------------------------------------------------------------- /codes/javaee/javaee-session/src/main/webapp/views/images/vertical_line.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/java-tutorial/HEAD/codes/javaee/javaee-session/src/main/webapp/views/images/vertical_line.gif -------------------------------------------------------------------------------- /codes/javaee/javaee-taglib/src/main/webapp/images/ibm-tab-background.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/java-tutorial/HEAD/codes/javaee/javaee-taglib/src/main/webapp/images/ibm-tab-background.gif -------------------------------------------------------------------------------- /codes/javaee/javaee-taglib/src/main/webapp/images/pagetools-gradient.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/java-tutorial/HEAD/codes/javaee/javaee-taglib/src/main/webapp/images/pagetools-gradient.gif -------------------------------------------------------------------------------- /codes/javaee/javaee-taglib/src/main/webapp/images/pagetools_gradient_a.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/java-tutorial/HEAD/codes/javaee/javaee-taglib/src/main/webapp/images/pagetools_gradient_a.gif -------------------------------------------------------------------------------- /codes/javaee/javaee-taglib/src/main/webapp/images/top-content-shadow.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/java-tutorial/HEAD/codes/javaee/javaee-taglib/src/main/webapp/images/top-content-shadow.gif -------------------------------------------------------------------------------- /codes/javaee/javaee-taglib/src/main/webapp/images/masthead-links-gradient.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/java-tutorial/HEAD/codes/javaee/javaee-taglib/src/main/webapp/images/masthead-links-gradient.gif -------------------------------------------------------------------------------- /codes/javaee/javaee-filter/src/main/webapp/views/xml/book.xml: -------------------------------------------------------------------------------- 1 | 2 | Bruce 3 | Java 编程思想 4 | 计算机经典书籍系列丛书 5 | $100.00 6 | 7 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jsp/src/main/webapp/examples/04.action/date.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %> 2 |

3 | 今天的日期是: <%= (new java.util.Date())%> 4 |

5 | -------------------------------------------------------------------------------- /codes/javaee/javaee-taglib/src/main/webapp/images/leftnav-overview-highlight.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/java-tutorial/HEAD/codes/javaee/javaee-taglib/src/main/webapp/images/leftnav-overview-highlight.gif -------------------------------------------------------------------------------- /codes/javaee/javaee-jsp/src/main/java/io/github/dunwu/javaee/jsp/util/ip/QQWry.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dunwu/java-tutorial/HEAD/codes/javaee/javaee-jsp/src/main/java/io/github/dunwu/javaee/jsp/util/ip/QQWry.dat -------------------------------------------------------------------------------- /codes/javaee/javaee-jsp/src/main/webapp/views/jsp/action/date.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %> 2 |

3 | 今天的日期是: <%=(new java.util.Date()).toLocaleString()%> 4 |

5 | -------------------------------------------------------------------------------- /codes/javaee/javaee-filter/src/main/webapp/WEB-INF/sensitive.properties: -------------------------------------------------------------------------------- 1 | # \u81ea\u52a8\u66f4\u6b63 2 | Chna=China 3 | www.baidu.com.cn=www.baidu.com 4 | # \u81ea\u52a8\u66ff\u6362 5 | \u8272\u60c5=** 6 | \u60c5\u8272=** 7 | \u8d4c\u535a=** 8 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jsp/src/main/webapp/examples/uncheck/01.helloWorld.jsp: -------------------------------------------------------------------------------- 1 | 2 | 3 | First Jsp Programe 4 | 5 | 6 | <% 7 | out.println("Hello World!"); 8 | %> 9 | 10 | 11 | -------------------------------------------------------------------------------- /codes/javatool/javatool-monitor/javatool-zipkin-springboot/src/main/resources/META-INF/spring.factories: -------------------------------------------------------------------------------- 1 | org.springframework.boot.autoconfigure.EnableAutoConfiguration = \ 2 | io.github.dunwu.javatool.monitor.zipkin.TracingConfiguration 3 | -------------------------------------------------------------------------------- /codes/java-distributed/java-load-balance/src/main/java/io/github/dunwu/distributed/support/HashStrategy.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.distributed.support; 2 | 3 | public interface HashStrategy { 4 | 5 | int hashCode(String key); 6 | 7 | } 8 | -------------------------------------------------------------------------------- /settings/elastic/logstash/logstash-input-udp.conf: -------------------------------------------------------------------------------- 1 | input { 2 | udp { 3 | port => "9250" 4 | codec => json 5 | } 6 | } 7 | output { 8 | elasticsearch { hosts => ["localhost:9200"] } 9 | stdout { codec => rubydebug } 10 | } 11 | -------------------------------------------------------------------------------- /codes/javaee/javaee-filter/src/main/webapp/views/xml/thinkInJava.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Bruce 4 | Java 编程思想 5 | 计算机经典书籍系列丛书 6 | $100.00 7 | 8 | -------------------------------------------------------------------------------- /codes/javaee/javaee-oss/src/main/resources/template/velocity.properties: -------------------------------------------------------------------------------- 1 | resource.loader=file 2 | file.resource.loader.path=D:/01_Workspace/Project/zp/java/javaee-tutorial/codes/oss/src/main/resources 3 | input.encoding=utf-8 4 | output.encoding=utf-8 5 | -------------------------------------------------------------------------------- /codes/javaee/javaee-taglib/src/main/webapp/taglib/helloTag.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib prefix="ex" uri="/WEB-INF/tld/hello.tld" %> 2 | 3 | 4 | A sample custom tag 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /codes/java-distributed/java-load-balance/src/main/java/io/github/dunwu/distributed/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 负载均衡算法实现 3 | * 4 | * @author Zhang Peng 5 | * @since 2020-01-22 6 | */ 7 | package io.github.dunwu.distributed; 8 | -------------------------------------------------------------------------------- /codes/javatech/javatech-others/javatech-ruleengine/src/main/resources/weather-rule.yml: -------------------------------------------------------------------------------- 1 | name: "weather rule" 2 | description: "if it rains then take an umbrella" 3 | condition: "rain == true" 4 | actions: 5 | - "System.out.println(\"It rains, take an umbrella!\");" 6 | -------------------------------------------------------------------------------- /settings/elastic/logstash/logstash-input-tcp.conf: -------------------------------------------------------------------------------- 1 | input { 2 | tcp { 3 | port => 9251 4 | codec => json_lines 5 | mode => server 6 | } 7 | } 8 | output { 9 | elasticsearch { hosts => ["localhost:9200"] } 10 | stdout { codec => rubydebug } 11 | } 12 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jsp/src/main/webapp/views/jsp/action.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" %> 2 | 3 | 4 | 5 | 这里是正文 6 | 7 | -------------------------------------------------------------------------------- /prettier.config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @see https://prettier.io/docs/en/options.html 3 | * @see https://prettier.io/docs/en/configuration.html 4 | */ 5 | module.exports = { 6 | tabWidth: 2, 7 | semi: false, 8 | singleQuote: true, 9 | trailingComma: 'none' 10 | } 11 | -------------------------------------------------------------------------------- /codes/javatech/javatech-lib/src/test/java/io/github/dunwu/javatech/java/samples/LexicalPreservation.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.javatech.java.samples; 2 | 3 | // Hey, this is a comment 4 | 5 | // Another one 6 | public class LexicalPreservation { 7 | 8 | 9 | } 10 | -------------------------------------------------------------------------------- /codes/javatech/javatech-mq/javatech-rocketmq/src/main/java/io/github/dunwu/javatech/rocketmq/order/README.md: -------------------------------------------------------------------------------- 1 | # Rocket 官方示例之 Order Message Example 2 | 3 | - RocketMQ 使用 FIFO 顺序提供有序消息。 4 | 5 | ## 参考资料 6 | 7 | - [Order Example](https://rocketmq.apache.org/docs/order-example/) 8 | -------------------------------------------------------------------------------- /codes/javaee/javaee-listener/src/main/webapp/META-INF/context.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /codes/javaee/javaee-taglib/src/main/webapp/taglib/helloTag3.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib prefix="ex" uri="/WEB-INF/tld/hello3.tld" %> 2 | 3 | 4 | A sample custom tag 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /codes/javatech/javatech-cache/src/test/java/io/github/dunwu/javatech/cache/spring/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Spring 集成各类缓存库测试 3 | * 4 | * @author Zhang Peng 5 | * @since 2020-07-10 6 | */ 7 | package io.github.dunwu.javatech.cache.spring; 8 | -------------------------------------------------------------------------------- /codes/javatool/javatool-monitor/javatool-zipkin-spring/README.md: -------------------------------------------------------------------------------- 1 | # 监控工具示例 2 | 3 | ## Zipkin 4 | 5 | > 搬迁 https://github.com/openzipkin/brave-webmvc-example 示例。 6 | > 7 | 8 | 使用方法: 9 | 10 | ``` 11 | mvn jetty:run -Pfrontend 12 | mvn jetty:run -Pbackend 13 | ``` 14 | 15 | -------------------------------------------------------------------------------- /codes/javaee/javaee-listener/src/main/webapp/aa.html: -------------------------------------------------------------------------------- 1 |

sdfsd

2 | 3 |

sadfsdf

4 | 5 |
    6 |
  1. sadf
  2. 7 |
  3. asdfsadf
  4. 8 |
  5. sdf
  6. 9 |
  7. sdfsadfasdf
  8. 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /codes/javatech/javatech-mq/javatech-rocketmq/src/main/java/io/github/dunwu/javatech/rocketmq/scheduled/README.md: -------------------------------------------------------------------------------- 1 | # Rocket 官方示例之 Schedule Example 2 | 3 | - 定时消息与普通消息的不同之处在于,它们要等到指定的时间后才会发送。 4 | 5 | ## 参考资料 6 | 7 | - [Schedule Example](https://rocketmq.apache.org/docs/schedule-example/) 8 | -------------------------------------------------------------------------------- /codes/javatech/javatech-server/src/main/resources/properties/application-develop.properties: -------------------------------------------------------------------------------- 1 | # jdbc 2 | jdbc.driver = 3 | jdbc.url = 4 | jdbc.username = 5 | jdbc.password = 6 | # redis 7 | redis.name = 8 | redis.host = 9 | redis.port = 10 | redis.password = 11 | redis.database = 12 | -------------------------------------------------------------------------------- /codes/javatech/javatech-server/src/main/resources/properties/application-test.properties: -------------------------------------------------------------------------------- 1 | # jdbc 2 | jdbc.driver = 3 | jdbc.url = 4 | jdbc.username = 5 | jdbc.password = 6 | # redis 7 | redis.name = 8 | redis.host = 9 | redis.port = 10 | redis.password = 11 | redis.database = 12 | -------------------------------------------------------------------------------- /codes/javaee/javaee-taglib/src/main/webapp/taglib/helloTag2.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib prefix="ex" uri="/WEB-INF/tld/hello2.tld" %> 2 | 3 | 4 | A sample custom tag 5 | 6 | 7 | 8 | This is message body 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /codes/javatech/javatech-others/javatech-zookeeper/src/main/java/io/github/dunwu/javatech/zk/example/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * ZooKeeper 最基本操作示例 3 | * 4 | * @author Zhang Peng 5 | * @since 2020-01-13 6 | */ 7 | package io.github.dunwu.javatech.zk.example; 8 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jsp/src/main/webapp/views/jsp/error.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=utf-8" isErrorPage="true" %> 2 | 3 | 4 | JSP 5 | 6 | 7 | <% 8 | out.println("程序抛出了一个异常:" + exception); 9 | %> 10 | 11 | 12 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jstl/src/main/webapp/xml/books.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Padam History 4 | ZARA 5 | 100 6 | 7 | 8 | Great Mistry 9 | NUHA 10 | 2000 11 | 12 | 13 | -------------------------------------------------------------------------------- /codes/javatech/javatech-mq/javatech-rocketmq/src/main/java/io/github/dunwu/javatech/rocketmq/broadcast/README.md: -------------------------------------------------------------------------------- 1 | # Rocket 官方示例之 Broadcasting Example 2 | 3 | - 广播是向主题的所有订阅者发送消息。如果您希望所有订阅者都收到有关某个主题的消息,广播是一个不错的选择。 4 | 5 | ## 参考资料 6 | 7 | - [Broadcasting Example](https://rocketmq.apache.org/docs/broadcast-example/) 8 | -------------------------------------------------------------------------------- /codes/javaee/javaee-filter/src/main/webapp/WEB-INF/privilege.properties: -------------------------------------------------------------------------------- 1 | # Privilege Settings 2 | admin.do?action\=*=administrator 3 | log.do?action\=*=administrator 4 | list.do?action\=add=member 5 | list.do?action\=delete=member 6 | list.do?action\=save=member 7 | list.do?action\=view=guest 8 | list.do?action\=list=guest 9 | -------------------------------------------------------------------------------- /codes/javatech/javatech-mq/javatech-rocketmq/src/main/java/io/github/dunwu/javatech/rocketmq/RocketConstant.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.javatech.rocketmq; 2 | 3 | /** 4 | * @author Zhang Peng 5 | */ 6 | public class RocketConstant { 7 | 8 | public static final String HOST = "localhost:9876"; 9 | 10 | } 11 | -------------------------------------------------------------------------------- /codes/javatech/javatech-mq/javatech-rocketmq/src/main/java/io/github/dunwu/javatech/rocketmq/simple/README.md: -------------------------------------------------------------------------------- 1 | # Rocket 官方示例之 Simple Message Example 2 | 3 | - 使用 RocketMQ 通过三种方式发送消息:可靠同步、可靠异步、单向传输。 4 | - 使用 RocketMQ 消费消息。 5 | 6 | ## 参考资料 7 | 8 | - [Simple Message Example](https://rocketmq.apache.org/docs/simple-example/) 9 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jsp/src/main/webapp/examples/05.implicit_object/error.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=utf-8" isErrorPage="true" %> 2 | 3 | JSP 4 | 5 | 6 | <% 7 | out.println("程序拋出了一个异常:" + exception); 8 | %> 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /codes/javatech/javatech-others/javatech-cli/src/main/java/io/github/dunwu/javatech/constant/AnsiElement.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.javatech.constant; 2 | 3 | public interface AnsiElement { 4 | 5 | /** 6 | * @return the ANSI escape code 7 | */ 8 | @Override 9 | String toString(); 10 | 11 | } 12 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jsp/src/main/webapp/views/jsp/application.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=utf-8" %> 2 | <% 3 | out.getBufferSize(); 4 | 5 | out.println(request); 6 | 7 | 8 | %> 9 | 10 | JSP Scriptlets 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /codes/javaee/javaee-taglib/src/main/java/io/github/dunwu/javaee/taglib/test/TestMessage.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.javaee.taglib.test; 2 | 3 | public class TestMessage { 4 | 5 | public static void main(String[] args) { 6 | System.out.println(Messages.getString("TestMessage.0", "A", "B")); //$NON-NLS-1$ 7 | } 8 | 9 | } 10 | -------------------------------------------------------------------------------- /codes/javatech/javatech-lib/src/test/java/io/github/dunwu/javatech/java/samples/A.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.javatech.java.samples; 2 | 3 | class A { 4 | 5 | public void foo(Object param) { 6 | System.out.println(1); 7 | System.out.println("hi"); 8 | System.out.println(param); 9 | } 10 | 11 | } 12 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jsp/src/main/webapp/examples/uncheck/01.helloWorld_zh.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8" %> 3 | 4 | 5 | 6 | 第一个Jsp程序 7 | 8 | 9 | <% 10 | out.println("你好!"); 11 | %> 12 | 13 | 14 | -------------------------------------------------------------------------------- /codes/javatech/javatech-lib/src/test/java/io/github/dunwu/javatech/java/samples/Bar.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.javatech.java.samples; 2 | 3 | class Bar { 4 | 5 | private String a; 6 | 7 | void aMethod() { 8 | while (true) { 9 | int a = 0; 10 | a = a + 1; 11 | } 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jsp/src/main/java/io/github/dunwu/javaee/jsp/bean/Counter.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.javaee.jsp.bean; 2 | 3 | public class Counter { 4 | 5 | private int count; 6 | 7 | public int getCount() { 8 | return ++count; 9 | } 10 | 11 | public void setCount(int count) { 12 | this.count = count; 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /codes/javaee/javaee-oss/src/main/resources/template/header.vm: -------------------------------------------------------------------------------- 1 | 2 | 3 | Velocity 邮件模板 5 | 6 | 7 | -------------------------------------------------------------------------------- /codes/javatech/javatech-mq/javatech-rocketmq/src/main/java/io/github/dunwu/javatech/rocketmq/batch/README.md: -------------------------------------------------------------------------------- 1 | # Rocket 官方示例之 Batch Example 2 | 3 | 批量发送消息提高了传递小消息的性能。 4 | 5 | 同一批次的消息应该具有:相同的主题、相同的 waitStoreMsgOK 并且不支持调度。 6 | 7 | 此外,一批消息的总大小不应超过 1MiB。 8 | 9 | ## 参考资料 10 | 11 | - [Batch Example](https://rocketmq.apache.org/docs/batch-example/) 12 | -------------------------------------------------------------------------------- /codes/javatech/javatech-others/javatech-zookeeper/src/main/java/io/github/dunwu/javatech/zk/sequence/DistributedSequence.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.javatech.zk.sequence; 2 | 3 | /** 4 | * Created by sunyujia@aliyun.com on 2016/2/25. 5 | */ 6 | public interface DistributedSequence { 7 | 8 | public Long sequence(String sequenceName); 9 | } 10 | -------------------------------------------------------------------------------- /codes/java-distributed/java-load-balance/src/main/java/io/github/dunwu/distributed/support/JdkHashCodeStrategy.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.distributed.support; 2 | 3 | public class JdkHashCodeStrategy implements HashStrategy { 4 | 5 | @Override 6 | public int hashCode(String key) { 7 | return key.hashCode(); 8 | } 9 | 10 | } 11 | -------------------------------------------------------------------------------- /codes/javatech/javatech-others/javatech-ruleengine/src/main/java/io/github/dunwu/javatech/rule/mvel/RuleContext.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.javatech.rule.mvel; 2 | 3 | import java.util.Map; 4 | import java.util.concurrent.ConcurrentHashMap; 5 | 6 | public class RuleContext extends ConcurrentHashMap implements Map { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /codes/javatool/javatool-monitor/javatool-zipkin-springboot/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | # spring.application.name and server.port are set in the main methods, 2 | # so not done here 3 | logging.level.root=INFO 4 | # Adds trace and span IDs to logs (when a trace is in progress) 5 | logging.pattern.level=[%X{traceId}/%X{spanId}] %-5p [%t] %C{2} - %m%n 6 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jsp/src/main/java/io/github/dunwu/javaee/jsp/bean/Message.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.javaee.jsp.bean; 2 | 3 | public class Message { 4 | 5 | private String content; 6 | 7 | public String getContent() { 8 | return content; 9 | } 10 | 11 | public void setContent(String content) { 12 | this.content = content; 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /codes/javaee/javaee-taglib/src/main/webapp/WEB-INF/tld/hello.tld: -------------------------------------------------------------------------------- 1 | 2 | 1.0 3 | 2.0 4 | Example TLD 5 | 6 | Hello 7 | io.github.dunwu.javaee.taglib.HelloTag 8 | empty 9 | 10 | 11 | -------------------------------------------------------------------------------- /codes/javatech/javatech-cache/src/main/resources/sql/data.sql: -------------------------------------------------------------------------------- 1 | -- ------------------------------------------- 2 | -- 运行本项目的 DML 脚本 3 | -- ------------------------------------------- 4 | 5 | INSERT INTO user (name, age, address, email) 6 | VALUES ('张三', 18, '北京', 'xxx@163.com'); 7 | INSERT INTO user (name, age, address, email) 8 | VALUES ('李四', 19, '上海', 'xxx@163.com'); 9 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jsp/src/main/webapp/examples/uncheck/configuration.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=utf-8" %> 2 | 3 | 4 | JSP config 示例 5 | 6 | 7 |

8 | <% 9 | String message = config.getInitParameter("message"); 10 | out.println(message); 11 | %> 12 |

13 | 14 | 15 | -------------------------------------------------------------------------------- /codes/javaee/javaee-filter/src/main/java/io/github/dunwu/javaee/filter/exception/AccountException.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.javaee.filter.exception; 2 | 3 | public class AccountException extends Exception { 4 | 5 | private static final long serialVersionUID = -3040955562136599570L; 6 | 7 | public AccountException(String msg) { 8 | super(msg); 9 | } 10 | 11 | } 12 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jsp/src/main/webapp/views/jsp/action/forward.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %> 2 | 3 | 4 | 5 | 6 | jsp:forward范例 7 | 8 | 9 |

jsp:forward范例

10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /codes/javatech/javatech-lib/src/test/java/io/github/dunwu/javatech/java/samples/WebSocketMsgType.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.javatech.java.samples; 2 | 3 | /** 4 | * WebSocket 消息类型 5 | */ 6 | public enum WebSocketMsgType { 7 | /** 连接 */ 8 | CONNECT, 9 | /** 关闭 */ 10 | CLOSE, 11 | /** 信息 */ 12 | INFO, 13 | /** 错误 */ 14 | ERROR 15 | } 16 | -------------------------------------------------------------------------------- /settings/elastic/logstash/logstash-input-file.conf: -------------------------------------------------------------------------------- 1 | input { 2 | file { 3 | path => ["/var/log/nginx/access.log"] 4 | type => "nginx-access-log" 5 | start_position => "beginning" 6 | } 7 | } 8 | 9 | output { 10 | if [type] == "nginx-access-log" { 11 | elasticsearch { 12 | hosts => ["localhost:9200"] 13 | index => "nginx-access-log" 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /utils/config.yml: -------------------------------------------------------------------------------- 1 | # 批量添加和修改、删除front matter配置文件 2 | 3 | # 需要批量处理的路径,docs文件夹内的文件夹 (数组,映射路径:path[0]/path[1]/path[2] ... ) 4 | path: 5 | - docs # 第一个成员必须是docs 6 | 7 | # 要删除的字段 (数组) 8 | delete: 9 | # - tags 10 | 11 | # 要添加、修改front matter的数据 (front matter中没有的数据则添加,已有的数据则覆盖) 12 | data: 13 | # author: 14 | # name: xugaoyi 15 | # link: https://github.com/xugaoyi 16 | -------------------------------------------------------------------------------- /codes/java-distributed/java-rate-limit/src/main/java/io/github/dunwu/distributed/ratelimit/RateLimiter.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.distributed.ratelimit; 2 | 3 | /** 4 | * 限流器 5 | * 6 | * @author Zhang Peng 7 | * @date 2024-01-18 8 | */ 9 | public interface RateLimiter { 10 | 11 | boolean tryAcquire(int permits); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /codes/javaee/javaee-filter/src/main/java/io/github/dunwu/javaee/filter/exception/BusinessException.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.javaee.filter.exception; 2 | 3 | public class BusinessException extends Exception { 4 | 5 | private static final long serialVersionUID = -3040955562136599570L; 6 | 7 | public BusinessException(String msg) { 8 | super(msg); 9 | } 10 | 11 | } 12 | -------------------------------------------------------------------------------- /codes/javaee/javaee-taglib/src/main/webapp/WEB-INF/tld/hello2.tld: -------------------------------------------------------------------------------- 1 | 2 | 1.0 3 | 2.0 4 | Example TLD with Body 5 | 6 | Hello 7 | io.github.dunwu.javaee.taglib.HelloTag2 8 | scriptless 9 | 10 | 11 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jsp/src/main/webapp/views/jsp/action/include.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %> 2 | 3 | 4 | 5 | 6 | jsp:include范例 7 | 8 | 9 |

include 动作实例

10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jsp/src/main/webapp/views/jsp/exception.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=utf-8" errorPage="/error.jsp" %> 2 | <% 3 | out.clear(); 4 | String str = null; 5 | // length() 操作会抛出 NullPointerException 6 | int length = str.length(); 7 | %> 8 | 9 | JSP 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /codes/javatech/javatech-others/javatech-zookeeper/src/main/java/io/github/dunwu/javatech/zk/dlock/TimeoutHandler.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.javatech.zk.dlock; 2 | 3 | /** 4 | * @author Zhang Peng 5 | * @since 2020-01-14 6 | */ 7 | public interface TimeoutHandler { 8 | 9 | V onTimeout() throws InterruptedException; 10 | 11 | } 12 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jsp/src/main/webapp/views/jsp/directive/page/errorPage.jsp: -------------------------------------------------------------------------------- 1 | 2 | <%@ page language="java" errorPage="isErrorPage.jsp" pageEncoding="UTF-8" %> 3 | 4 | 5 | JSP指令page-属性errorPage 6 | 7 | 8 | <% 9 | //这行代码肯定会出错,因为除数是0,一运行就会抛出异常 10 | int x = 1 / 0; 11 | %> 12 | 13 | 14 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jstl/src/main/webapp/examples/core/c_redirect.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8" %> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 4 | 5 | 6 | c:redirect 标签实例 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /codes/javatech/javatech-others/javatech-zookeeper/src/main/java/io/github/dunwu/javatech/zk/dlock/Callback.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.javatech.zk.dlock; 2 | 3 | /** 4 | * Created by sunyujia@aliyun.com on 2016/2/23. 5 | */ 6 | public interface Callback { 7 | 8 | V onGetLock() throws InterruptedException; 9 | 10 | V onTimeout() throws InterruptedException; 11 | 12 | } 13 | -------------------------------------------------------------------------------- /codes/javatech/javatech-lib/src/main/java/io/github/dunwu/javatech/bean/lombok/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 本 package 下所有代码均为 Lombok 示例 3 | * 4 | * @author Zhang Peng 5 | * @see Reducing Boilerplate Code with Project Lombok 6 | * @since 2019-11-22 7 | */ 8 | package io.github.dunwu.javatech.bean.lombok; 9 | -------------------------------------------------------------------------------- /codes/javatool/javatool-monitor/javatool-zipkin-springboot/README.md: -------------------------------------------------------------------------------- 1 | # 监控工具示例 2 | 3 | ## Zipkin 4 | 5 | > 搬迁 https://github.com/openzipkin/brave-webmvc-example 示例。 6 | > 7 | 8 | 使用方法: 9 | 10 | ``` 11 | mvn compile exec:java -Dexec.mainClass=io.github.dunwu.javatool.monitor.zipkin.Backend 12 | mvn compile exec:java -Dexec.mainClass=io.github.dunwu.javatool.monitor.zipkin.Frontend 13 | ``` 14 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jsp/src/main/webapp/examples/05.implicit_object/exception.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=utf-8" errorPage="error.jsp" %> 2 | <% 3 | out.clear(); 4 | String str = null; 5 | // length() 会抛出 NullPointerException 6 | int length = str.length(); 7 | %> 8 | 9 | JSP 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jsp/src/main/webapp/examples/04.action/jspinclude.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %> 2 | 3 | 4 | 5 | 6 | jsp:include 示例 7 | 8 | 9 | 10 |

jsp:include 示例

11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /docs/01.Java/12.工具/04.测试/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Java 测试 3 | date: 2022-02-17 22:34:30 4 | categories: 5 | - Java 6 | - 工具 7 | - 测试 8 | tags: 9 | - Java 10 | - 测试 11 | permalink: /pages/2cecc3/ 12 | hidden: true 13 | index: false 14 | --- 15 | 16 | # Java 测试 17 | 18 | ## 内容 19 | 20 | - [Junit](01.Junit.md) 21 | - [Mockito](02.Mockito.md) 22 | - [Jmeter](03.Jmeter.md) 23 | - [JMH](04.JMH.md) -------------------------------------------------------------------------------- /codes/javaee/javaee-jsp/src/main/webapp/views/jsp/directive/page/contentType.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" %> 2 | 3 | 4 | 5 | JSP指令page-属性contentType 6 | 7 | 8 | 9 |

你好啊

10 |

contentType="text/html; charset=UTF-8"

11 | 12 | 13 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jsp/src/main/webapp/views/jsp/directive/page/isErrorPage.jsp: -------------------------------------------------------------------------------- 1 | 2 | <%@ page language="java" pageEncoding="UTF-8" isErrorPage="true" %> 3 | 4 | 5 | JSP 6 | 7 | 8 | <% 9 | out.println("程序抛出了一个异常:" + exception); 10 | %> 11 | 12 | 13 | -------------------------------------------------------------------------------- /codes/java-distributed/java-load-balance/src/main/java/io/github/dunwu/distributed/LoadBalance.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.distributed; 2 | 3 | import java.util.List; 4 | 5 | /** 6 | * 负载均衡策略接口 7 | * 8 | * @author Zhang Peng 9 | * @since 2020-01-21 10 | */ 11 | public interface LoadBalance { 12 | 13 | N select(List nodes, String ip); 14 | 15 | } 16 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jsp/src/main/webapp/examples/03.directive/foot.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=utf-8" %> 2 | 3 | 4 | 5 | 8 | 9 | 10 |
6 | Copyright 2017 &Zhang Peng 7 |
11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jsp/src/main/webapp/examples/uncheck/03.yourIp.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8" %> 3 | 4 | 5 | 6 | 7 | 菜鸟教程(runoob.com) 8 | 9 | 10 | Hello World!
11 | <% 12 | out.println("你的 IP 地址 " + request.getRemoteAddr()); 13 | %> 14 | 15 | 16 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jstl/src/main/webapp/examples/core/c_import.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8" %> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 4 | 5 | 6 | c:import 标签实例 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jstl/src/main/webapp/examples/core/c_set.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8" %> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 4 | 5 | 6 | c:set 标签实例 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /codes/javaee/javaee-taglib/src/main/webapp/multi.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" %> 2 | <%@ taglib uri="http://www.victorzhang.com/tags" prefix="taglib" %> 3 | 4 | 5 | 6 | Insert title here 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jsp/src/main/webapp/examples/practice/form/formGet.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 表单 - Get操作 6 | 7 | 8 | 9 |
10 | 站点名: 11 |
12 | 网址: 13 | 14 |
15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jsp/src/main/webapp/examples/practice/form/formPost.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 表单 - Post操作 6 | 7 | 8 | 9 |
10 | 站点名: 11 |
12 | 网址: 13 | 14 |
15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /codes/javatech/javatech-server/src/main/java/io/github/dunwu/javatech/service/HelloService.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.javatech.service; 2 | 3 | import org.springframework.stereotype.Service; 4 | 5 | /** 6 | * @author Zhang Peng 7 | * @date 2022-07-28 8 | */ 9 | @Service 10 | public class HelloService { 11 | 12 | public String hello() { 13 | return "hello"; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /codes/javatool/javatool-monitor/javatool-zipkin-spring/src/main/resources/log4j2.properties: -------------------------------------------------------------------------------- 1 | appenders = console 2 | appender.console.type = Console 3 | appender.console.name = STDOUT 4 | appender.console.layout.type = PatternLayout 5 | appender.console.layout.pattern = %d{ABSOLUTE} [%X{traceId}/%X{spanId}] %-5p [%t] %C{2} - %m%n 6 | rootLogger.level = info 7 | rootLogger.appenderRefs = stdout 8 | rootLogger.appenderRef.stdout.ref = STDOUT 9 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jsp/src/main/webapp/views/jsp/directive/include/foot.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=utf-8" %> 2 | 3 | 4 | 5 | 8 | 9 | 10 |
6 | Copyright 2007-2010 ©Helloweenvsfei 7 |
11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jstl/src/main/webapp/examples/core/c_forEach.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8" %> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 4 | 5 | 6 | c:forEach 标签实例 7 | 8 | 9 | 10 | Item

11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /codes/javaee/javaee-session/src/main/webapp/encodeURL.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" pageEncoding="UTF-8" %> 2 | 3 | 4 | 5 | Cookie Encoding 6 | 7 | 8 | ">Homepage 9 | 10 | <%= response.encodeURL("index.jsp") %>?c=1&wd=Java 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jsp/src/main/webapp/examples/02.grammar/scriptlet.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=utf-8" %> 2 | 3 | JSP Scriptlets 4 | 5 | 6 | <% 7 | int num = 10; 8 | int result = 1; 9 | for (int i = 1; i <= num; i++) { 10 | result *= i; 11 | } 12 | out.println("


"); 13 | out.println("数字 " + num + " 的阶乘为:" + result); 14 | %> 15 | 16 | 17 | -------------------------------------------------------------------------------- /codes/javaee/javaee-taglib/src/main/java/io/github/dunwu/javaee/taglib/tags2/RepeatTag.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.javaee.taglib.tags2; 2 | 3 | import javax.servlet.jsp.tagext.SimpleTagSupport; 4 | 5 | public class RepeatTag extends SimpleTagSupport { 6 | 7 | private int times; 8 | 9 | public int getTimes() { 10 | return times; 11 | } 12 | 13 | public void setTimes(int times) { 14 | this.times = times; 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jsp/src/main/webapp/views/jsp/life.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" %> 2 | <%! 3 | 4 | %> 5 | 6 | 7 | 8 | 9 | 10 | Insert title here 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jstl/src/main/resources/sql/create_employees.sql: -------------------------------------------------------------------------------- 1 | create table Employees 2 | ( 3 | id int not null, 4 | age int not null, 5 | first varchar (255), 6 | last varchar (255) 7 | ); 8 | 9 | INSERT INTO Employees VALUES (100, 18, 'Zara', 'Ali'); 10 | INSERT INTO Employees VALUES (101, 25, 'Mahnaz', 'Fatma'); 11 | INSERT INTO Employees VALUES (102, 30, 'Zaid', 'Khan'); 12 | INSERT INTO Employees VALUES (103, 28, 'Sumit', 'Mittal'); -------------------------------------------------------------------------------- /codes/javaee/javaee-taglib/src/main/webapp/WEB-INF/tld/hello3.tld: -------------------------------------------------------------------------------- 1 | 2 | 1.0 3 | 2.0 4 | Example TLD with Body 5 | 6 | Hello 7 | io.github.dunwu.javaee.taglib.HelloTag3 8 | scriptless 9 | 10 | message 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /codes/javaee/javaee-taglib/src/main/webapp/loop.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" %> 2 | <%@ taglib uri="http://www.victorzhang.com/tags" prefix="taglib" %> 3 | 4 | 5 | 6 | Insert title here 7 | 8 | 9 | 10 |
11 | Loop. 
12 | 
13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jsp/src/main/java/io/github/dunwu/javaee/jsp/util/IpUtil.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.javaee.jsp.util; 2 | 3 | import io.github.dunwu.javaee.jsp.util.ip.IPSeeker; 4 | 5 | public class IpUtil { 6 | 7 | public static String getIpAddress(String ip) { 8 | try { 9 | return IPSeeker.getInstance().getAddress(ip); 10 | } catch (Exception e) { 11 | e.printStackTrace(); 12 | } 13 | return "δ֪����"; 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /codes/javaee/javaee-taglib/src/main/webapp/taglib/copyright.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" %> 2 | <%@ taglib uri="http://www.victorzhang.com/tags" prefix="taglib" %> 3 | 4 | 5 | 6 | Insert title here 7 | 8 | 9 | 10 | Hello, taglib 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jsp/src/main/webapp/examples/03.directive/page.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" %> 2 | <%@ page contentType="text/html; charset=UTF-8" %> 3 | <%@ page pageEncoding="UTF-8" %> 4 | <%@ page trimDirectiveWhitespaces="false" %> 5 | <%@ page buffer="10kb" %> 6 | <%@ page info="false" %> 7 | 8 | 9 | 10 | 第一个Jsp程序 11 | 12 | 13 | <% 14 | out.println("你好!"); 15 | %> 16 | 17 | 18 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jstl/src/main/java/io/github/dunwu/javaee/util/Example.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.javaee.util; 2 | 3 | import java.util.ListResourceBundle; 4 | 5 | public class Example extends ListResourceBundle { 6 | 7 | static final Object[][] contents = { { "count.one", "一" }, { "count.two", "二" }, { "count.three", "三" }, }; 8 | 9 | @Override 10 | public Object[][] getContents() { 11 | return contents; 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jstl/src/main/java/io/github/dunwu/javaee/util/Example_es_ES.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.javaee.util; 2 | 3 | import java.util.ListResourceBundle; 4 | 5 | public class Example_es_ES extends ListResourceBundle { 6 | 7 | static final Object[][] contents = { { "count.one", "one" }, { "count.two", "two" }, { "count.three", "three" }, }; 8 | 9 | public Object[][] getContents() { 10 | return contents; 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jstl/src/main/webapp/examples/core/c_url.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8" %> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 4 | 5 | 6 | c:url 标签实例 7 | 8 | 9 |

<c:url>实例 Demo

10 | "> 11 | 这个链接通过 <c:url> 标签生成。 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jstl/src/main/webapp/examples/core/c_forTokens.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8" %> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 4 | 5 | 6 | c:forTokens 标签实例 7 | 8 | 9 | 10 |

11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jstl/src/main/resources/sql/create_students.sql: -------------------------------------------------------------------------------- 1 | create table Students 2 | ( 3 | id int not null, 4 | first varchar (255), 5 | last varchar (255), 6 | dob date 7 | ); 8 | 9 | INSERT INTO Students VALUES (100, 'Zara', 'Ali', '2002/05/16'); 10 | INSERT INTO Students VALUES (101, 'Mahnaz', 'Fatma', '1978/11/28'); 11 | INSERT INTO Students VALUES (102, 'Zaid', 'Khan', '1980/10/10'); 12 | INSERT INTO Students VALUES (103, 'Sumit', 'Mittal', '1971/05/08'); -------------------------------------------------------------------------------- /codes/javaee/javaee-taglib/src/main/webapp/toLowerCase.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" %> 2 | <%@ taglib uri="http://www.victorzhang.com/tags" prefix="taglib" %> 3 | 4 | 5 | 6 | Insert title here 7 | 8 | 9 | 10 | Hello, To Lower Case Tag with Body. 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /codes/javatool/javatool-monitor/javatool-zipkin-spring/src/main/java/io/github/dunwu/javatool/monitor/zipkin/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Zipkin 使用示例 3 | * 4 | * @author Zhang Peng 5 | * @see brave 6 | * @see brave-webmvc-example 7 | * @since 2020-03-05 8 | */ 9 | package io.github.dunwu.javatool.monitor.zipkin; 10 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jsp/src/main/webapp/examples/02.grammar/if2.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %> 2 | <%! int day = 1; %> 3 | 4 | 5 | 6 | 7 | 02.JSP语法 - if...else示例 8 | 9 | 10 |

if...else示例

11 | <% if (day == 1 | day == 7) { %> 12 |

今天是周末

13 | <% } else { %> 14 |

今天不是周末

15 | <% } %> 16 | 17 | 18 | -------------------------------------------------------------------------------- /codes/javaee/javaee-taglib/src/main/webapp/toUpperCase.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" %> 2 | <%@ taglib uri="http://www.victorzhang.com/tags" prefix="taglib" %> 3 | 4 | 5 | 6 | Insert title here 7 | 8 | 9 | 10 | 11 | This is a to upper case tag. 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jstl/src/main/webapp/examples/core/c_if.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8" %> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 4 | 5 | 6 | c:if 标签实例 7 | 8 | 9 | 10 | 11 |

我的工资为:

12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /codes/javatech/javatech-mq/javatech-kafka-springboot/src/main/java/io/github/dunwu/javatech/MsgKafkaApplication.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.javatech; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class MsgKafkaApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(MsgKafkaApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jsp/src/main/webapp/examples/practice/redirect.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8" %> 3 | 4 | 5 | 6 | 页面重定向 7 | 8 | 9 | 10 |

页面重定向

11 | 12 | <% 13 | // 重定向到新地址 14 | String site = "http://www.baidu.com"; 15 | response.setStatus(response.SC_MOVED_TEMPORARILY); 16 | response.setHeader("Location", site); 17 | %> 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jsp/src/main/webapp/views/jsp/scriptlet.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=utf-8" %> 2 | 3 | JSP Scriptlets 4 | 5 | 6 | <% 7 | int num = 10; 8 | int result = 1; 9 | for (int i = 1; i <= num; i++) { 10 | result *= i; 11 | out.println("第" + i + "步运算:" + result + "
"); 12 | } 13 | out.println("
"); 14 | out.println("数字 " + num + " 的阶乘为: " + result); 15 | %> 16 | 17 | 18 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jsp/src/main/webapp/views/jsp/taglib.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" %> 2 | 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 4 | 5 | 6 | My JSP 'taglib.jsp' starting page 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jsp/src/main/webapp/views/jsp/comment.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" %> 2 | <% 3 | // 这是 Java 行注释 4 | String path = request.getContextPath(); 5 | 6 | /* 7 | 这是 Java 多行注释 8 | */ 9 | %> 10 | 11 | 12 | 13 | JSP 注释 14 | 15 | <%-- 16 | 这是 JSP 注释,可以添加多行注释 17 | --%> 18 | 19 | This is my JSP page.
20 | 21 | 22 | -------------------------------------------------------------------------------- /docs/.vuepress/plugins/love-me/index.js: -------------------------------------------------------------------------------- 1 | const path = require('path') 2 | const LoveMyPlugin = (options = {}) => ({ 3 | define() { 4 | const COLOR = 5 | options.color || 6 | 'rgb(' + ~~(255 * Math.random()) + ',' + ~~(255 * Math.random()) + ',' + ~~(255 * Math.random()) + ')' 7 | const EXCLUDECLASS = options.excludeClassName || '' 8 | return { COLOR, EXCLUDECLASS } 9 | }, 10 | enhanceAppFiles: [path.resolve(__dirname, 'love-me.js')] 11 | }) 12 | module.exports = LoveMyPlugin 13 | -------------------------------------------------------------------------------- /codes/javatech/javatech-others/javatech-zookeeper/src/main/java/io/github/dunwu/javatech/zk/dlock/DistributedLock.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.javatech.zk.dlock; 2 | 3 | import java.util.concurrent.TimeUnit; 4 | 5 | /** 6 | * 分布式锁接口 7 | * 8 | * @author Zhang Peng 9 | * @since 2020-01-14 10 | */ 11 | public interface DistributedLock { 12 | 13 | void lock(); 14 | 15 | boolean tryLock(long timeout, TimeUnit unit); 16 | 17 | void unlock(); 18 | 19 | } 20 | -------------------------------------------------------------------------------- /docs/.markdownlint.json: -------------------------------------------------------------------------------- 1 | { 2 | "default": true, 3 | "MD002": false, 4 | "MD004": { "style": "dash" }, 5 | "ul-indent": { "indent": 2 }, 6 | "MD013": { "line_length": 600 }, 7 | "MD024": false, 8 | "MD025": false, 9 | "MD026": false, 10 | "MD029": { "style": "ordered" }, 11 | "MD033": false, 12 | "MD034": false, 13 | "MD036": false, 14 | "fenced-code-language": false, 15 | "no-hard-tabs": false, 16 | "whitespace": false, 17 | "emphasis-style": { "style": "consistent" } 18 | } 19 | -------------------------------------------------------------------------------- /codes/javatech/javatech-others/javatech-cli/src/test/java/io/github/dunwu/javatech/CliUtilTests.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.javatech; 2 | 3 | import org.junit.Test; 4 | 5 | /** 6 | * @author Zhang Peng 7 | * @since 2019/10/29 8 | */ 9 | public class CliUtilTests { 10 | 11 | @Test 12 | public void prepare() throws Exception { 13 | String[] args = { "-sql", "select * from aa", "-name", "测试" }; 14 | CliUtil.prepare(args); 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /codes/javatech/javatech-others/javatech-zookeeper/src/main/java/io/github/dunwu/javatech/zk/dlock/DLockTemplate.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.javatech.zk.dlock; 2 | 3 | /** 4 | * 分布式锁模板类 Created by sunyujia@aliyun.com on 2016/2/23. 5 | */ 6 | public interface DLockTemplate { 7 | 8 | /** 9 | * @param lockId 锁id(对应业务唯一ID) 10 | * @param timeout 单位毫秒 11 | * @param callback 回调函数 12 | * @return 13 | */ 14 | V execute(String lockId, long timeout, Callback callback); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jsp/src/main/webapp/examples/practice/form/checkbox.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Checkbox 6 | 7 | 8 | 9 |
10 | 谷歌 11 | 百度 12 | 淘宝 13 | 14 |
15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /codes/javaee/javaee-session/src/main/webapp/views/jsp/cookie/addCookies.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" pageEncoding="UTF-8" %> 2 | 3 | 4 | 5 | 6 | 添加Cookie 7 | 8 | 9 |
10 | 站点名 : 11 |
12 | 站点 URL:
13 | 14 |
15 | 16 | 17 | -------------------------------------------------------------------------------- /codes/javaee/javaee-filter/src/main/webapp/views/jsp/testWaterMarkFilter.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" %> 2 | 3 | 4 | 5 | 6 | 图片过滤器示例 7 | 8 | 9 | 10 | 11 | 刷新 12 |
13 | ${ header } 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jsp/src/main/webapp/examples/practice/form/checkbox2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Checkbox 6 | 7 | 8 | 9 |
10 | 谷歌 11 | 百度 12 | 淘宝 13 | 14 |
15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jsp/src/main/webapp/examples/practice/form/formGet.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8" %> 3 | 4 | 5 | 6 | 7 | 表单 - Get操作 8 | 9 | 10 |

使用 GET 方法读取数据

11 |
    12 |
  • 站点名: 13 | <%= request.getParameter("name")%> 14 |

  • 15 |
  • 网址: 16 | <%= request.getParameter("url")%> 17 |

  • 18 |
19 | 20 | 21 | -------------------------------------------------------------------------------- /codes/deadloop/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%boldYellow(%thread)] [%highlight(%-5level)] %boldGreen(%c{36}.%M) - %boldBlue(%m%n) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /codes/javaee/javaee-filter/src/main/webapp/views/jsp/dispatcher.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" %> 2 | 3 | 4 | 5 | 6 | ${ pageContext.request.requestURI } 7 | 8 | 9 | 10 | 你正在访问 ${ pageContext.request.requestURI }?${ pageContext.request.queryString }. 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jstl/src/main/webapp/examples/core/c_remove.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8" %> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 4 | 5 | 6 | c:remove 标签实例 7 | 8 | 9 | 10 |

salary 变量值:

11 | 12 |

删除 salary 变量后的值:

13 | 14 | 15 | -------------------------------------------------------------------------------- /codes/javaee/javaee-taglib/src/main/webapp/hello.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" %> 2 | <%@ taglib uri="http://www.victorzhang.com/tags" prefix="taglib" %> 3 | 4 | 5 | 6 | Insert title here 7 | 8 | 9 | 10 |
11 |
12 |
13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /docs/01.Java/12.工具/99.其他/02.Java工具包.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: javalib-util 3 | date: 2022-02-17 22:34:30 4 | order: 02 5 | categories: 6 | - Java 7 | - 工具 8 | - 其他 9 | tags: 10 | - Java 11 | - 工具包 12 | permalink: /pages/27ad42/ 13 | --- 14 | 15 | # 细说 Java 主流工具包 16 | 17 | - apache.commons 18 | - [commons-lang](https://github.com/apache/commons-lang) 19 | - [commons-collections](https://github.com/apache/commons-collections) 20 | - [common-io](https://github.com/apache/commons-io) 21 | - [guava](https://github.com/google/guava) -------------------------------------------------------------------------------- /codes/javaee/javaee-jsp/src/main/webapp/examples/locale/language2.jsp: -------------------------------------------------------------------------------- 1 | <% 2 | // Set response content type 3 | response.setContentType("text/html"); 4 | // Set spanish language code. 5 | response.setHeader("Content-Language", "es"); 6 | String title = "En Espa?ol"; 7 | 8 | %> 9 | 10 | 11 | <% out.print(title); %> 12 | 13 | 14 |

<% out.print(title); %>

15 |
16 |

En Espa?ol

17 |

?Hola Mundo!

18 |
19 | 20 | 21 | -------------------------------------------------------------------------------- /codes/trouble-shooting/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%boldYellow(%thread)] [%highlight(%-5level)] %boldGreen(%c{36}.%M) - %boldBlue(%m%n) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jstl/src/main/webapp/examples/uncheck/url.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" %> 2 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 3 | 4 | 5 | 6 | 7 | Insert title here 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /codes/javaee/javaee-taglib/src/main/webapp/dynamic.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" %> 2 | <%@ taglib uri="http://www.victorzhang.com/tags" prefix="taglib" %> 3 | 4 | 5 | 6 | Insert title here 7 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /docs/01.Java/13.框架/01.Spring/01.Spring核心/24.SpringEL.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Spring EL 表达式 3 | date: 2023-01-12 20:26:46 4 | order: 24 5 | categories: 6 | - Java 7 | - 框架 8 | - Spring 9 | - Spring核心 10 | tags: 11 | - Java 12 | - 框架 13 | - Spring 14 | permalink: /pages/1f743f/ 15 | --- 16 | 17 | # Spring EL 表达式 18 | 19 | ## 参考资料 20 | 21 | - [Spring 官方文档之 Core Technologies](https://docs.spring.io/spring-framework/docs/current/spring-framework-reference/core.html#beans) 22 | - [《小马哥讲 Spring 核心编程思想》](https://time.geekbang.org/course/intro/265) -------------------------------------------------------------------------------- /codes/javaee/javaee-filter/src/main/webapp/views/jsp/testOutputReplaceFilter.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" %> 2 | 3 | 4 | 5 | 6 | Insert title here 7 | 8 | 9 | 10 | Chna
11 |
12 | 色情
13 | 赌博
14 | 情色
15 |
16 | www.baidu.com.cn
17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jsp/src/main/webapp/examples/02.grammar/while.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=utf-8" %> 2 | 3 | 4 | JSP Scriptlets 5 | 6 | 7 | <% 8 | java.util.List list = new java.util.ArrayList(); 9 | 10 | list.add("青青子衿"); 11 | list.add("悠悠我心"); 12 | list.add("但为君故"); 13 | list.add("沉吟至今"); 14 | 15 | java.util.Iterator it = list.iterator(); 16 | 17 | while (it.hasNext()) { 18 | %> <%= it.next() %>
19 | <% 20 | } 21 | %> 22 | 23 | 24 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jsp/src/main/webapp/views/jsp/grammar/while.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=utf-8" %> 2 | 3 | JSP Scriptlets 4 | 5 | 6 | <% 7 | java.util.List list = new java.util.ArrayList(); 8 | 9 | list.add("茕茕白兔"); 10 | list.add("东走西顾"); 11 | list.add("衣不如新"); 12 | list.add("人不如故"); 13 | 14 | java.util.Iterator it = list.iterator(); 15 | 16 | while (it.hasNext()) { 17 | %> <%= it.next() %>
18 | <% 19 | } 20 | 21 | %> 22 | 23 | 24 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jstl/src/main/webapp/examples/uncheck/index.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" %> 2 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 3 | 4 | 5 | 6 | 7 | Insert title here 8 | 9 | 10 | 11 | index.jsp 12 | 13 | Test 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jstl/src/main/webapp/examples/uncheck/redirect.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" %> 2 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 3 | 4 | 5 | 6 | 7 | Insert title here 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jstl/src/main/webapp/examples/core/c_catch.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8" %> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 4 | 5 | 6 | c:catch 标签实例 7 | 8 | 9 | 10 | 11 | <% int x = 5 / 0;%> 12 | 13 | 14 | 15 |

异常为 : ${catchException}
16 | 发生了异常: ${catchException.message}

17 |
18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jstl/src/main/webapp/examples/uncheck/fmt.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" %> 2 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> 4 | 5 | 6 | 7 | 8 | Insert title here 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /codes/deadloop/src/main/resources/sql/schema.sql: -------------------------------------------------------------------------------- 1 | -- ------------------------------------------------------------------- 2 | -- 运行本项目的初始化 DDL 脚本 3 | -- Mysql 知识点可以参考: 4 | -- https://dunwu.github.io/db-tutorial/#/sql/mysql/README 5 | -- ------------------------------------------------------------------- 6 | 7 | -- 强制新建用户表 8 | DROP TABLE IF EXISTS `testuser`; 9 | CREATE TABLE `testuser` ( 10 | `id` BIGINT(20) NOT NULL AUTO_INCREMENT, 11 | `name` VARCHAR(255) NOT NULL, 12 | PRIMARY KEY (`id`) 13 | ) 14 | ENGINE = InnoDB 15 | DEFAULT CHARSET = utf8mb4; 16 | -------------------------------------------------------------------------------- /codes/java-distributed/java-rate-limit/src/main/resources/scripts/fixed_window_rate_limit.lua: -------------------------------------------------------------------------------- 1 | -- 缓存 Key 2 | local key = KEYS[1] 3 | -- 访问请求数 4 | local permits = tonumber(ARGV[1]) 5 | -- 过期时间 6 | local seconds = tonumber(ARGV[2]) 7 | -- 限流阈值 8 | local limit = tonumber(ARGV[3]) 9 | 10 | -- 获取统计值 11 | local count = tonumber(redis.call('GET', key) or "0") 12 | 13 | if count + permits > limit then 14 | -- 请求拒绝 15 | return -1 16 | else 17 | -- 请求通过 18 | redis.call('INCRBY', key, permits) 19 | redis.call('EXPIRE', key, seconds) 20 | return count + permits 21 | end -------------------------------------------------------------------------------- /codes/javaee/javaee-jstl/src/main/webapp/examples/function/fn_toLowerCase.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8" %> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 4 | <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> 5 | 6 | 7 | 使用 JSTL 函数 8 | 9 | 10 | 11 | 12 | 13 | 14 |

字符串为 : ${string2}

15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jstl/src/main/webapp/examples/function/fn_toUpperCase.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8" %> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 4 | <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> 5 | 6 | 7 | 使用 JSTL 函数 8 | 9 | 10 | 11 | 12 | 13 | 14 |

字符串为 : ${string2}

15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /codes/javatech/javatech-lib/src/test/resources/META-INF/reflections/inner/resource2-reflections.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | io.github.dunwu.javatech.reflections.TestModel$AF1 7 | 8 | io.github.dunwu.javatech.reflections.TestModel$C4.f1 9 | io.github.dunwu.javatech.reflections.TestModel$C4.f2 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /codes/java-distributed/java-distributed-id/src/main/resources/scripts/fixed_window_rate_limit.lua: -------------------------------------------------------------------------------- 1 | -- 缓存 Key 2 | local key = KEYS[1] 3 | -- 访问请求数 4 | local permits = tonumber(ARGV[1]) 5 | -- 过期时间 6 | local seconds = tonumber(ARGV[2]) 7 | -- 限流阈值 8 | local limit = tonumber(ARGV[3]) 9 | 10 | -- 获取统计值 11 | local count = tonumber(redis.call('GET', key) or "0") 12 | 13 | if count + permits > limit then 14 | -- 请求拒绝 15 | return -1 16 | else 17 | -- 请求通过 18 | redis.call('INCRBY', key, permits) 19 | redis.call('EXPIRE', key, seconds) 20 | return count + permits 21 | end -------------------------------------------------------------------------------- /codes/trouble-shooting/src/main/resources/sql/schema.sql: -------------------------------------------------------------------------------- 1 | -- ------------------------------------------------------------------- 2 | -- 运行本项目的初始化 DDL 脚本 3 | -- Mysql 知识点可以参考: 4 | -- https://dunwu.github.io/db-tutorial/#/sql/mysql/README 5 | -- ------------------------------------------------------------------- 6 | 7 | -- 强制新建用户表 8 | DROP TABLE IF EXISTS `testuser`; 9 | CREATE TABLE `testuser` ( 10 | `id` BIGINT(20) NOT NULL AUTO_INCREMENT, 11 | `name` VARCHAR(255) NOT NULL, 12 | PRIMARY KEY (`id`) 13 | ) 14 | ENGINE = InnoDB 15 | DEFAULT CHARSET = utf8mb4; 16 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jsp/src/main/webapp/views/jsp/break.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=utf-8" %> 2 | 3 | JSP Scriptlets 4 | 5 | 6 | <% 7 | 8 | for (int i = 0; i < 5; i++) { 9 | %> break 所在的循环, i = <%= i %>.
10 | <% 11 | if (i == 2) { 12 | break; 13 | } 14 | } 15 | %> break 循环完毕.
16 | <% 17 | for (int i = 0; i < 5; i++) { 18 | %> return 所在的循环, i = <%= i %>.
19 | <% 20 | if (i == 2) { 21 | return; 22 | } 23 | } 24 | %> return 循环完毕.
25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jsp/src/main/webapp/WEB-INF/resources/jsp/index.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" %> 2 | 3 | 4 | 5 | 6 | My JSP 'index.jsp' starting page 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |

This is my JSP page.

15 | 16 | 17 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jsp/src/main/webapp/examples/02.grammar/break.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=utf-8" %> 2 | 3 | JSP Scriptlets 4 | 5 | 6 | <% 7 | for (int i = 0; i < 5; i++) { 8 | %> break 所在的循环, i = <%= i %>。
9 | <% 10 | if (i == 2) { 11 | break; 12 | } 13 | } 14 | %> break 循环完毕,
15 | <% 16 | for (int i = 0; i < 5; i++) { 17 | %> return 所在的循环, i = <%= i %>。
18 | <% 19 | if (i == 2) { 20 | return; 21 | } 22 | } 23 | %> return 循环完毕,
24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jstl/src/main/webapp/examples/function/fn_substring.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8" %> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 4 | <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> 5 | 6 | 7 | 使用 JSTL 函数 8 | 9 | 10 | 11 | 12 | 13 | 14 |

生成的子字符串为 : ${string2}

15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jstl/src/main/webapp/examples/function/fn_substringAfter.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8" %> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 4 | <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> 5 | 6 | 7 | 使用 JSTL 函数 8 | 9 | 10 | 11 | 12 | 13 | 14 |

生成的子字符串 : ${string2}

15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /codes/javaee/javaee-listener/src/main/webapp/WEB-INF/resources/jsp/index.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" %> 2 | 3 | 4 | 5 | 6 | My JSP 'index.jsp' starting page 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |

This is my JSP page.

15 | 16 | 17 | -------------------------------------------------------------------------------- /codes/javatech/javatech-lib/src/test/java/io/github/dunwu/javatech/seriralize/json/gson/VersionedClass.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.javatech.seriralize.json.gson; 2 | 3 | import com.google.gson.annotations.Since; 4 | 5 | public class VersionedClass { 6 | 7 | @Since(1.1) 8 | private final String newerField; 9 | 10 | @Since(1.0) 11 | private final String newField; 12 | 13 | private final String field; 14 | 15 | public VersionedClass() { 16 | this.newerField = "newer"; 17 | this.newField = "new"; 18 | this.field = "old"; 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jsp/src/main/webapp/examples/locale/language.jsp: -------------------------------------------------------------------------------- 1 | <%@ page import="java.util.Locale" %> 2 | <% 3 | //获取客户端本地化信息 4 | Locale locale = request.getLocale(); 5 | String language = locale.getLanguage(); 6 | String country = locale.getCountry(); 7 | %> 8 | 9 | 10 | Detecting Locale 11 | 12 | 13 |
14 |

Detecting Locale

15 |
16 |

17 | <% 18 | out.println("Language : " + language + "
"); 19 | out.println("Country : " + country + "
"); 20 | %> 21 |

22 | 23 | 24 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jsp/src/main/webapp/views/jsp/action/getProperty.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %> 2 | 3 | 4 | 5 | jsp:setProperty和jsp:getProperty使用范例 6 | 7 | 8 | 9 |

jsp:setProperty和jsp:getProperty使用范例

10 | 11 | 12 | 13 | 14 |

输出信息....

15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jstl/src/main/webapp/examples/function/fn_substringBefore.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8" %> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 4 | <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> 5 | 6 | 7 | 使用 JSTL 函数 8 | 9 | 10 | 11 | 12 | 13 | 14 |

生成的子字符串 : ${string2}

15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /codes/deadloop/src/main/java/io/github/dunwu/trouble/FooService.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.trouble; 2 | 3 | import org.springframework.stereotype.Component; 4 | 5 | import java.util.ArrayList; 6 | import java.util.List; 7 | import java.util.stream.Collectors; 8 | import java.util.stream.IntStream; 9 | 10 | @Component 11 | public class FooService { 12 | 13 | List data = new ArrayList<>(); 14 | 15 | public void oom() { 16 | data.add(IntStream.rangeClosed(1, 100000) 17 | .mapToObj(__ -> "a") 18 | .collect(Collectors.joining(""))); 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /codes/javaee/javaee-oss/src/main/resources/template/footer.vm: -------------------------------------------------------------------------------- 1 | #set ($company = "Apache") 2 | #set ($year = "2016") 3 | 4 | 5 | 6 | 7 | 8 | 12 | 13 | 14 |
9 | Copyright $company $year. 保留所有权利。 11 |
15 | 16 | 17 | -------------------------------------------------------------------------------- /codes/javatech/javatech-mq/javatech-kafka-springboot/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%boldYellow(%thread)] [%highlight(%-5level)] %boldGreen(%c{36}.%M) - %boldBlue(%m%n) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /codes/deadloop/src/main/resources/sql/data.sql: -------------------------------------------------------------------------------- 1 | -- ------------------------------------------------------------------- 2 | -- 运行本项目的初始化 DML 脚本 3 | -- Mysql 知识点可以参考: 4 | -- https://dunwu.github.io/db-tutorial/#/sql/mysql/README 5 | -- ------------------------------------------------------------------- 6 | 7 | # INSERT INTO user (username, password, email) 8 | # VALUES ('admin', '$2a$10$Y9uV9YjFuNlATDGz5MeTZeuo8LbebbpP6jRgtZYQcgiCZRlf8rJYG', 'admin@xxx.com'); 9 | # 10 | # INSERT INTO user (username, password, email) 11 | # VALUES ('user', '$2a$10$Y9uV9YjFuNlATDGz5MeTZeuo8LbebbpP6jRgtZYQcgiCZRlf8rJYG', 'user@xxx.com'); 12 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jsp/src/main/webapp/views/jsp/return.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=utf-8" %> 2 | 3 | JSP Scriptlets 4 | 5 | 6 | <% 7 | String param = request.getParameter("param"); 8 | %> 9 | 昔我往矣,
10 | 杨柳依依。
11 | 今我来思,
12 | 雨雪霏霏。
13 | <% 14 | if ("return".equals(param)) { 15 | return; 16 | } 17 | %> 18 | 青青子衿,
19 | 悠悠我心,
20 | 但为君故,
21 | 沉吟至今!
22 | 23 |
24 | <%= request.getRequestURI() %>?param=return 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jstl/src/main/webapp/examples/uncheck/out.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" %> 2 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 3 | 4 | 5 | 6 | 7 | Insert title here 8 | 9 | 10 | 11 | action 参数为: 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /codes/javatech/javatech-cache/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%boldYellow(%thread)] [%highlight(%-5level)] %boldGreen(%c{36}.%M) - %boldBlue(%m%n) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig 用于在 IDE 中检查代码的基本 Code Style 2 | # @see: https://editorconfig.org/ 3 | 4 | # 配置说明: 5 | # 所有文件换行使用 Unix 风格(LF),*.bat 文件使用 Windows 风格(CRLF) 6 | # java / sh 文件缩进 4 个空格,其他所有文件缩进 2 个空格 7 | 8 | root = true 9 | 10 | [*] 11 | end_of_line = lf 12 | indent_size = 2 13 | indent_style = space 14 | max_line_length = 120 15 | charset = utf-8 16 | trim_trailing_whitespace = true 17 | insert_final_newline = true 18 | 19 | [*.{bat, cmd}] 20 | end_of_line = crlf 21 | 22 | [*.{java, gradle, groovy, kt, sh}] 23 | indent_size = 4 24 | 25 | [*.md] 26 | max_line_length = 0 27 | trim_trailing_whitespace = false 28 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jsp/src/main/webapp/examples/practice/form/checkbox.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8" %> 3 | 4 | 5 | 6 | 7 | Checkbox 8 | 9 | 10 |

从复选框中读取数据

11 |
    12 |
  • 谷歌是否选中: 13 | <%= request.getParameter("google")%> 14 |

  • 15 |
  • 百度是否选中: 16 | <%= request.getParameter("baidu")%> 17 |

  • 18 |
  • 淘宝是否选中: 19 | <%= request.getParameter("taobao")%> 20 |

  • 21 |
22 | 23 | 24 | -------------------------------------------------------------------------------- /codes/javaee/javaee-servlet/src/main/java/io/github/dunwu/javaee/servlet/upload/UploadListener.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.javaee.servlet.upload; 2 | 3 | import org.apache.commons.fileupload.ProgressListener; 4 | 5 | public class UploadListener implements ProgressListener { 6 | 7 | private UploadStatus status; 8 | 9 | public UploadListener(UploadStatus status) { 10 | this.status = status; 11 | } 12 | 13 | public void update(long bytesRead, long contentLength, int items) { 14 | status.setBytesRead(bytesRead); 15 | status.setContentLength(contentLength); 16 | status.setItems(items); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /codes/javatech/javatech-server/src/main/webapp/views/jsp/hello.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %> 2 | <% 3 | String path = request.getContextPath(); 4 | String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/"; 5 | %> 6 | 7 | 8 | 9 | 10 | HelloController 11 | 12 | 13 |

${message}

14 | 回到首页
15 | 16 | 17 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jstl/src/main/webapp/examples/fmt/fmt_bundle.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8" %> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 4 | <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> 5 | 6 | 7 | fmt:bundle 标签 8 | 9 | 10 | 11 | 12 |
13 |
14 |
15 |
16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jstl/src/main/webapp/examples/function/fn_join.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8" %> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 4 | <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> 5 | 6 | 7 | 使用 JSTL 函数 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |

字符串为 : ${string3}

16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /codes/trouble-shooting/src/main/resources/sql/data.sql: -------------------------------------------------------------------------------- 1 | -- ------------------------------------------------------------------- 2 | -- 运行本项目的初始化 DML 脚本 3 | -- Mysql 知识点可以参考: 4 | -- https://dunwu.github.io/db-tutorial/#/sql/mysql/README 5 | -- ------------------------------------------------------------------- 6 | 7 | # INSERT INTO user (username, password, email) 8 | # VALUES ('admin', '$2a$10$Y9uV9YjFuNlATDGz5MeTZeuo8LbebbpP6jRgtZYQcgiCZRlf8rJYG', 'admin@xxx.com'); 9 | # 10 | # INSERT INTO user (username, password, email) 11 | # VALUES ('user', '$2a$10$Y9uV9YjFuNlATDGz5MeTZeuo8LbebbpP6jRgtZYQcgiCZRlf8rJYG', 'user@xxx.com'); 12 | -------------------------------------------------------------------------------- /codes/javatech/javatech-lib/src/main/java/io/github/dunwu/javatech/bean/lombok/NonNullDemo.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.javatech.bean.lombok; 2 | 3 | import lombok.Getter; 4 | import lombok.NonNull; 5 | import lombok.Setter; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | * @NonNull 示例 11 | * 12 | * @author Zhang Peng 13 | * @see @NonNull 14 | * @since 2019-11-22 15 | */ 16 | public class NonNullDemo { 17 | 18 | @Getter 19 | @Setter 20 | @NonNull 21 | private List members; 22 | 23 | } 24 | -------------------------------------------------------------------------------- /codes/javatool/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | io.github.dunwu.javatool 7 | javatool 8 | 1.0.0 9 | pom 10 | JAVATOOL 11 | 12 | 13 | javatool-monitor 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jstl/src/main/webapp/examples/fmt/fmt_parseDate.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8" %> 3 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 4 | <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> 5 | 6 | 7 | 8 | fmt:parseDate 标签 9 | 10 | 11 |

日期解析:

12 | 13 | 14 | 16 |

解析后的日期为:

17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jstl/src/main/webapp/examples/function/fn_replace.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8" %> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 4 | <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> 5 | 6 | 7 | 使用 JSTL 函数 8 | 9 | 10 | 11 | 12 | 14 | 15 |

替换后的字符串 : ${string2}

16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jstl/src/main/webapp/examples/uncheck/fn.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" %> 2 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> 4 | <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> 5 | 6 | 7 | 8 | 9 | Insert title here 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jstl/src/main/webapp/examples/function/fn_length.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8" %> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 4 | <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> 5 | 6 | 7 | 使用 JSTL 函数 8 | 9 | 10 | 11 | 12 | 13 | 14 |

字符串长度 (1) : ${fn:length(string1)}

15 |

字符串长度 (2) : ${fn:length(string2)}

16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /codes/javatech/javatech-cache/src/main/resources/sql/schema.sql: -------------------------------------------------------------------------------- 1 | -- ------------------------------------------- 2 | -- 运行本项目的 DDL 脚本 3 | -- ------------------------------------------- 4 | 5 | -- 创建数据表 user 6 | CREATE TABLE IF NOT EXISTS user ( 7 | id BIGINT(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Id', 8 | name VARCHAR(10) NOT NULL DEFAULT '' COMMENT '用户名', 9 | age TINYINT(3) NOT NULL DEFAULT 0 COMMENT '年龄', 10 | address VARCHAR(32) NOT NULL DEFAULT '' COMMENT '地址', 11 | email VARCHAR(32) NOT NULL DEFAULT '' COMMENT '邮件', 12 | PRIMARY KEY (id) 13 | ) COMMENT = '用户表'; 14 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jsp/src/main/webapp/examples/practice/form/formPost.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8" %> 3 | 4 | 5 | 6 | 7 | 表单 - Post操作 8 | 9 | 10 |

使用 POST 方法读取数据

11 |
    12 |
  • 站点名: 13 | <% 14 | // 解决中文乱码的问题 15 | String name = new String((request.getParameter("name")).getBytes("ISO-8859-1"), "UTF-8"); 16 | %> 17 | <%=name%> 18 |

  • 19 |
  • 网址: 20 | <%= request.getParameter("url")%> 21 |

  • 22 |
23 | 24 | 25 | -------------------------------------------------------------------------------- /scripts/init.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ################################################################################# 4 | # javatool-server 项目初始化脚本 5 | # 执行本脚本后,会将 JavaStack 下载到 /home/zp/source/JavaStack 目录下。 6 | # 环境中必须安装了 git 7 | ################################################################################# 8 | 9 | rm -rf /home/temp 10 | rm -rf /home/zp/source/JavaStack 11 | mkdir -p /home/temp 12 | cd /home/temp 13 | wget https://raw.githubusercontent.com/dunwu/JavaStack/master/scripts/git-clone.sh 14 | chmod 777 git-clone.sh 15 | ./git-clone.sh JavaStack master 16 | chmod 777 -R /home/zp/source/JavaStack 17 | rm -rf /home/temp 18 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jsp/src/main/webapp/examples/03.directive/head.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=utf-8" %> 2 | 3 | 4 | JSP 示例 5 | 6 | 7 | 8 | 9 | 10 | 11 | 14 | 15 | 16 | 17 | 18 | 19 | 20 |
JSP 示例 13 |
首页资源文档
21 | -------------------------------------------------------------------------------- /codes/javaee/javaee-taglib/src/main/webapp/multiAttribute.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" %> 2 | <%@ taglib uri="http://www.victorzhang.com/tags" prefix="taglib" %> 3 | 4 | 5 | 6 | Insert title here 7 | 12 | 13 | 14 | 15 | 16 | 标签体一, 17 | 标签体二, 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /codes/javaee/javaee-filter/src/main/webapp/views/xml/xml.xsl: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jsp/src/main/webapp/examples/locale/localeCurrency.jsp: -------------------------------------------------------------------------------- 1 | <%@ page import="java.text.NumberFormat,java.util.Locale" %> 2 | 3 | <% 4 | String title = "Locale Specific Currency"; 5 | //Get the client's Locale 6 | Locale locale = request.getLocale(); 7 | NumberFormat nft = NumberFormat.getCurrencyInstance(locale); 8 | String formattedCurr = nft.format(1000000); 9 | %> 10 | 11 | 12 | <% out.print(title); %> 13 | 14 | 15 |

<% out.print(title); %>

16 |
17 |

Formatted Currency: <% out.print(formattedCurr); %>

18 |
19 | 20 | 21 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jsp/src/main/webapp/examples/locale/localePercent.jsp: -------------------------------------------------------------------------------- 1 | <%@ page import="java.text.NumberFormat,java.util.Locale" %> 2 | 3 | <% 4 | String title = "Locale Specific Percentage"; 5 | //Get the client's Locale 6 | Locale locale = request.getLocale(); 7 | NumberFormat nft = NumberFormat.getPercentInstance(locale); 8 | String formattedPerc = nft.format(0.51); 9 | %> 10 | 11 | 12 | <% out.print(title); %> 13 | 14 | 15 |

<% out.print(title); %>

16 |
17 |

Formatted Percentage: <% out.print(formattedPerc); %>

18 |
19 | 20 | 21 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jsp/src/main/java/io/github/dunwu/javaee/jsp/bean/Person.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.javaee.jsp.bean; 2 | 3 | public class Person { 4 | 5 | private String name; 6 | 7 | private int age; 8 | 9 | private String sex; 10 | 11 | public String getName() { 12 | return name; 13 | } 14 | 15 | public void setName(String name) { 16 | this.name = name; 17 | } 18 | 19 | public int getAge() { 20 | return age; 21 | } 22 | 23 | public void setAge(int age) { 24 | this.age = age; 25 | } 26 | 27 | public String getSex() { 28 | return sex; 29 | } 30 | 31 | public void setSex(String sex) { 32 | this.sex = sex; 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jstl/src/main/webapp/examples/core/c_choose.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8" %> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 4 | 5 | 6 | c:choose 标签实例 7 | 8 | 9 | 10 |

你的工资为 :

11 | 12 | 13 | 太惨了。 14 | 15 | 16 | 不错的薪水,还能生活。 17 | 18 | 19 | 什么都没有。 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jstl/src/main/webapp/examples/function/fn_trim.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8" %> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 4 | <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> 5 | 6 | 7 | 使用 JSTL 函数 8 | 9 | 10 | 11 | 12 |

string1 长度 : ${fn:length(string1)}

13 | 14 | 15 |

string2 长度 : ${fn:length(string2)}

16 |

字符串为 : ${string2}

17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jsp/src/main/webapp/examples/locale/localeDate.jsp: -------------------------------------------------------------------------------- 1 | <%@ page import="java.text.DateFormat,java.util.Date" %> 2 | <%@ page import="java.util.Locale " %> 3 | 4 | <% 5 | String title = "Locale Specific Dates"; 6 | //Get the client's Locale 7 | Locale locale = request.getLocale(); 8 | String date = DateFormat.getDateTimeInstance(DateFormat.FULL, DateFormat.SHORT, locale).format(new Date()); 9 | %> 10 | 11 | 12 | <% out.print(title); %> 13 | 14 | 15 |

<% out.print(title); %>

16 |
17 |

Local Date: <% out.print(date); %>

18 |
19 | 20 | 21 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jstl/src/main/webapp/examples/uncheck/choose.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" %> 2 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 3 | 4 | 5 | 6 | 7 | Insert title here 8 | 9 | 10 | 11 | 12 | 13 | when 标签的输出 14 | 15 | 16 | otherwise 标签的输出 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /codes/javatech/javatech-lib/src/main/java/io/github/dunwu/javatech/bean/lombok/DataDemo.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.javatech.bean.lombok; 2 | 3 | import lombok.Data; 4 | import lombok.ToString; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * @Data 示例 10 | * 11 | * @author Zhang Peng 12 | * @see @Data 13 | * @since 2019-11-22 14 | */ 15 | @Data(staticConstructor = "of") 16 | @ToString 17 | public class DataDemo { 18 | 19 | private final Person founder; 20 | 21 | protected List employees; 22 | 23 | private String name; 24 | 25 | } 26 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jstl/src/main/webapp/examples/function/fn_contains.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8" %> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 4 | <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> 5 | 6 | 7 | fn:contains 示例 8 | 9 | 10 | 11 | 12 | 13 | 14 |

找到 china 15 |

16 | 17 | 18 | 19 |

找到 CHINA 20 |

21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jstl/src/main/webapp/examples/function/fn_indexOf.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8" %> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 4 | <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> 5 | 6 | 7 | Using JSTL Functions 8 | 9 | 10 | 11 | 12 | 13 | 14 |

Index (1) : ${fn:indexOf(string1, "first")}

15 |

Index (2) : ${fn:indexOf(string2, "second")}

16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jstl/src/main/webapp/examples/function/fn_startsWith.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8" %> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 4 | <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> 5 | 6 | 7 | 使用 JSTL 函数 8 | 9 | 10 | 11 | 12 | 13 |

字符串以 Google 开头

14 |
15 |
16 | 17 |

字符串以 China 开头

18 |
19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jsp/src/main/webapp/examples/practice/hitCount.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8" %> 3 | 4 | 5 | 6 | 访问量统计 7 | 8 | 9 | <% 10 | Integer hitsCount = (Integer) application.getAttribute("hitCounter"); 11 | if (hitsCount == null || hitsCount == 0) { 12 | /* 第一次访问 */ 13 | out.println("欢迎访问!"); 14 | hitsCount = 1; 15 | } else { 16 | /* 返回访问值 */ 17 | out.println("欢迎再次访问!"); 18 | hitsCount += 1; 19 | } 20 | application.setAttribute("hitCounter", hitsCount); 21 | %> 22 | 23 |

页面访问量为: <%= hitsCount%> 24 |

25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jstl/src/main/webapp/examples/function/fn_endsWith.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8" %> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 4 | <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> 5 | 6 | 7 | 使用 JSTL 函数 8 | 9 | 10 | 11 | 12 | 13 | 14 |

字符串以 123 结尾 15 |

16 | 17 | 18 | 19 |

字符串以 china 结尾 20 |

21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jstl/src/main/webapp/examples/sql/sql_setDataSource.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8" %> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 4 | <%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql" %> 5 | 6 | 7 | sql:setDataSource 示例 8 | 9 | 10 | 11 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /codes/javaee/javaee-taglib/src/main/java/io/github/dunwu/javaee/taglib/tags/ToLowerCaseTag.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.javaee.taglib.tags; 2 | 3 | import javax.servlet.jsp.JspException; 4 | import javax.servlet.jsp.tagext.BodyTagSupport; 5 | 6 | public class ToLowerCaseTag extends BodyTagSupport { 7 | 8 | private static final long serialVersionUID = -2529343271020971948L; 9 | 10 | @Override 11 | public int doEndTag() throws JspException { 12 | 13 | String content = this.getBodyContent().getString(); 14 | 15 | try { 16 | this.pageContext.getOut().print(content.toLowerCase()); 17 | } catch (Exception e) { 18 | } 19 | 20 | return EVAL_PAGE; 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /codes/deadloop/src/main/resources/banner.txt: -------------------------------------------------------------------------------- 1 | ${AnsiColor.BRIGHT_YELLOW}${AnsiStyle.BOLD} 2 | ________ ___ ___ ________ ___ __ ___ ___ 3 | |\ ___ \|\ \|\ \|\ ___ \|\ \ |\ \|\ \|\ \ 4 | \ \ \_|\ \ \ \\\ \ \ \\ \ \ \ \ \ \ \ \ \\\ \ 5 | \ \ \ \\ \ \ \\\ \ \ \\ \ \ \ \ __\ \ \ \ \\\ \ 6 | \ \ \_\\ \ \ \\\ \ \ \\ \ \ \ \|\__\_\ \ \ \\\ \ 7 | \ \_______\ \_______\ \__\\ \__\ \____________\ \_______\ 8 | \|_______|\|_______|\|__| \|__|\|____________|\|_______| 9 | ${AnsiColor.CYAN}${AnsiStyle.BOLD} 10 | :: Java :: (v${java.version}) 11 | :: Spring Boot :: (v${spring-boot.version}) 12 | ${AnsiStyle.NORMAL} 13 | -------------------------------------------------------------------------------- /codes/javaee/javaee-oss/src/test/java/io/github/dunwu/javaee/oss/template/VelocityUtilTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The Apache License 2.0 Copyright (c) 2016 Victor Zhang 3 | */ 4 | package io.github.dunwu.javaee.oss.template; 5 | 6 | import org.apache.velocity.VelocityContext; 7 | import org.junit.Test; 8 | 9 | /** 10 | * @author Victor Zhang 11 | * @since 2016/12/23. 12 | */ 13 | public class VelocityUtilTest { 14 | 15 | @Test 16 | public void test() { 17 | VelocityContext context = new VelocityContext(); 18 | context.put("name", "Victor Zhang"); 19 | context.put("project", "Velocity"); 20 | System.out.println(VelocityUtil.getMergeOutput(context, "template/hello.vm")); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /docs/01.Java/11.软件/02.IDE/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Java IDE 3 | date: 2022-02-18 08:53:11 4 | categories: 5 | - Java 6 | - 软件 7 | - IDE 8 | tags: 9 | - Java 10 | - IDE 11 | permalink: /pages/8695a7/ 12 | hidden: true 13 | index: false 14 | --- 15 | 16 | # Java IDE 17 | 18 | > 自从有了 **IDE**,写代码从此就告别了刀耕火种的蛮荒时代。 19 | > 20 | > - [Eclipse](02.Eclipse.md) 是久负盛名的开源 Java IDE,我的学生时代一直使用它写 Java。 21 | > - 曾经抗拒从转 [Intellij Idea](01.Intellij.md) ,但后来发现真香,不得不说,确实是目前最优秀的 Java IDE。 22 | > - 你可以在 [vscode](03.VsCode.md) 中写各种语言,只要安装相应插件即可。如果你的项目中使用了很多种编程语言,又懒得在多个 IDE 之间切换,那么就用 vscode 来一网打尽吧。 23 | 24 | - [Intellij IDEA 快速入门](01.Intellij.md) 25 | - [Eclipse 快速入门](02.Eclipse.md) 26 | - [Vscode 快速入门](03.VsCode.md) -------------------------------------------------------------------------------- /codes/javaee/javaee-jstl/src/main/webapp/examples/core/c_out.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8" %> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 4 | 5 | 6 | 7 | c:out 标签实例 8 | 9 | 10 | 11 | 12 | <c:out>实例 13 | 14 | 15 |

<c:out> 实例

16 |
17 |
18 | 使用的表达式结果为null,则输出该默认值
19 | 20 | 21 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jstl/src/main/webapp/examples/function/fn_containsIgnoreCase.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8" %> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 4 | <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> 5 | 6 | 7 | 使用 JSTL 函数 8 | 9 | 10 | 11 | 12 | 13 | 14 |

找到 china 15 |

16 | 17 | 18 | 19 |

找到 CHINA 20 |

21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /codes/trouble-shooting/src/main/resources/banner.txt: -------------------------------------------------------------------------------- 1 | ${AnsiColor.BRIGHT_YELLOW}${AnsiStyle.BOLD} 2 | ________ ___ ___ ________ ___ __ ___ ___ 3 | |\ ___ \|\ \|\ \|\ ___ \|\ \ |\ \|\ \|\ \ 4 | \ \ \_|\ \ \ \\\ \ \ \\ \ \ \ \ \ \ \ \ \\\ \ 5 | \ \ \ \\ \ \ \\\ \ \ \\ \ \ \ \ __\ \ \ \ \\\ \ 6 | \ \ \_\\ \ \ \\\ \ \ \\ \ \ \ \|\__\_\ \ \ \\\ \ 7 | \ \_______\ \_______\ \__\\ \__\ \____________\ \_______\ 8 | \|_______|\|_______|\|__| \|__|\|____________|\|_______| 9 | ${AnsiColor.CYAN}${AnsiStyle.BOLD} 10 | :: Java :: (v${java.version}) 11 | :: Spring Boot :: (v${spring-boot.version}) 12 | ${AnsiStyle.NORMAL} 13 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jsp/src/main/webapp/examples/04.action/jspforward.jsp: -------------------------------------------------------------------------------- 1 | 2 | 3 | <% 4 | out.clear(); 5 | if ("1".equals(request.getParameter("param"))) { 6 | %> 7 | 8 | 9 | 10 | 11 | <% 12 | } 13 | %> 14 | 15 | 16 | 闀ㄤ讲鍓ラ弪镡煎禌?/title> 17 | <link rel='stylesheet' type='text/css' href='css/style.css'> 18 | </head> 19 | <body> 20 | i闀ㄥ洷娓规繛锲噭閵娿储鍕鹃柛褉锅挞梹妞ょ箰瀵剟寮?param=1 闀ㄤ礁娼″Λ鍓佹嫚閵夆敛钪妫婚ⅳ顑藉亾? 21 | </body> 22 | </html> 23 | 24 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jsp/src/main/webapp/examples/practice/date.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8" %> 3 | <%@ page import="java.text.SimpleDateFormat,java.util.Date" %> 4 | <html> 5 | <head> 6 | <title>显示当前时间与日期 7 | 8 | 9 | 10 |

显示当前时间与日期

11 | 12 | <% 13 | Date date = new Date(); 14 | out.print("

" + date.toString() + "

"); 15 | %> 16 | 17 |

使用SimpleDateFormat格式化日期

18 | <% 19 | Date dNow = new Date(); 20 | SimpleDateFormat ft = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); 21 | out.print("

" + ft.format(dNow) + "

"); 22 | %> 23 | 24 | 25 | -------------------------------------------------------------------------------- /codes/javatech/javatech-mq/javatech-kafka-springboot/src/main/java/io/github/dunwu/javatech/KafkaConsumer.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.javatech; 2 | 3 | import org.slf4j.Logger; 4 | import org.slf4j.LoggerFactory; 5 | import org.springframework.kafka.annotation.KafkaListener; 6 | import org.springframework.stereotype.Component; 7 | 8 | /** 9 | * Kafka 消费者 10 | * 11 | * @author Zhang Peng 12 | * @since 2018-11-28 13 | */ 14 | @Component 15 | public class KafkaConsumer { 16 | 17 | private final Logger log = LoggerFactory.getLogger(KafkaConsumer.class); 18 | 19 | @KafkaListener(topics = "test") 20 | public void processMessage(String data) { 21 | log.info("收到kafka消息:{}", data); 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jstl/src/main/webapp/examples/uncheck/parseNumber.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" %> 2 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> 4 | 5 | 6 | 7 | 8 | Insert title here 9 | 10 | 11 | 12 |
13 |
14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jstl/src/main/webapp/examples/uncheck/remove.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" %> 2 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 3 | 4 | <%@page import="java.util.HashMap" %> 5 | 6 | 7 | 8 | Insert title here 9 | 10 | 11 | 12 | <% 13 | request.setAttribute("somemap", new HashMap()); 14 | %> 15 | 16 | 17 | 18 | ${ somemap == null ? 'somemap 已经被删除' : 'somemap 没有被删除' } 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jstl/src/main/webapp/examples/uncheck/sql.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" %> 2 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> 4 | <%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql" %> 5 | <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> 6 | 7 | 8 | 9 | 10 | Insert title here 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /codes/javatech/javatech-cache/src/main/resources/banner.txt: -------------------------------------------------------------------------------- 1 | ${AnsiColor.BRIGHT_YELLOW}${AnsiStyle.BOLD} 2 | ________ ___ ___ ________ ___ __ ___ ___ 3 | |\ ___ \|\ \|\ \|\ ___ \|\ \ |\ \|\ \|\ \ 4 | \ \ \_|\ \ \ \\\ \ \ \\ \ \ \ \ \ \ \ \ \\\ \ 5 | \ \ \ \\ \ \ \\\ \ \ \\ \ \ \ \ __\ \ \ \ \\\ \ 6 | \ \ \_\\ \ \ \\\ \ \ \\ \ \ \ \|\__\_\ \ \ \\\ \ 7 | \ \_______\ \_______\ \__\\ \__\ \____________\ \_______\ 8 | \|_______|\|_______|\|__| \|__|\|____________|\|_______| 9 | ${AnsiColor.CYAN}${AnsiStyle.BOLD} 10 | :: Java :: (v${java.version}) 11 | :: Spring Boot :: (v${spring-boot.version}) 12 | ${AnsiStyle.NORMAL} 13 | -------------------------------------------------------------------------------- /codes/javatech/javatech-lib/src/main/java/io/github/dunwu/javatech/bean/lombok/GetterAndSetterDemo.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.javatech.bean.lombok; 2 | 3 | import lombok.AccessLevel; 4 | import lombok.Getter; 5 | import lombok.Setter; 6 | 7 | /** 8 | * @Getter@Setter 示例 9 | * 10 | * @author Zhang Peng 11 | * @see @Getter and @Setter 12 | * @since 2019-11-22 13 | */ 14 | public class GetterAndSetterDemo { 15 | 16 | @Getter 17 | @Setter 18 | private boolean employed = true; 19 | 20 | @Setter(AccessLevel.PROTECTED) 21 | private String name; 22 | 23 | } 24 | -------------------------------------------------------------------------------- /codes/javatech/javatech-lib/src/main/java/io/github/dunwu/javatech/bean/lombok/User.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.javatech.bean.lombok; 2 | 3 | import lombok.Data; 4 | import lombok.ToString; 5 | 6 | /** 7 | * @Data@ToString@EqualsAndHashCode 示例 8 | * 9 | * @author Zhang Peng 10 | * @see @Data 11 | * 、@ToString@EqualsAndHashCode 12 | * @since 2019-11-22 13 | */ 14 | @Data 15 | @ToString 16 | public class User { 17 | 18 | private String name; 19 | 20 | private Integer age; 21 | 22 | private String sex; 23 | 24 | } 25 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jstl/src/main/webapp/examples/uncheck/indexOf.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" %> 2 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> 4 | <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> 5 | 6 | 7 | 8 | 9 | Insert title here 10 | 11 | 12 | 13 | fn:indexOf('filename.txt', '.') = ${ fn:indexOf('filename.txt', '.') } 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /codes/javatool/javatool-monitor/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | io.github.dunwu.javatool 7 | javatool-monitor 8 | 1.0.0 9 | pom 10 | JAVATOOL-监控 11 | 12 | 13 | javatool-zipkin-spring 14 | javatool-zipkin-springboot 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /codes/javaee/javaee-taglib/src/main/java/io/github/dunwu/javaee/taglib/HelloTag.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The Apache License 2.0 Copyright (c) 2017 Zhang Peng 3 | */ 4 | package io.github.dunwu.javaee.taglib; 5 | 6 | /** 7 | * @author Zhang Peng 8 | * @since 2017/4/3. 9 | */ 10 | 11 | import java.io.IOException; 12 | import javax.servlet.jsp.JspException; 13 | import javax.servlet.jsp.JspWriter; 14 | import javax.servlet.jsp.tagext.SimpleTagSupport; 15 | 16 | public class HelloTag extends SimpleTagSupport { 17 | 18 | @Override 19 | public void doTag() throws JspException, IOException { 20 | JspWriter out = getJspContext().getOut(); 21 | out.println("Hello Custom Tag!"); 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /codes/javaee/javaee-filter/src/main/webapp/views/jsp/image.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" %> 2 | 3 | 4 | 5 | 6 | Insert title here 7 | 8 | 9 | 10 | 11 | 刷新 12 | 直接访问 14 |
15 | 16 | request.getHeader("referer"): ${ header['referer'] } 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jstl/src/main/webapp/examples/fmt/fmt_parseNumber.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8" %> 3 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 4 | <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> 5 | 6 | 7 | fmt:parseNumber 标签 8 | 9 | 10 |

数字解析:

11 | 12 | 13 | 14 |

数字解析 (1) :

15 | 17 |

数字解析 (2) :

18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /codes/javatech/javatech-lib/src/test/java/io/github/dunwu/javatech/reflections/UsageTestModel.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.javatech.reflections; 2 | 3 | public interface UsageTestModel { 4 | 5 | class C1 { 6 | 7 | C2 c2 = new C2(); 8 | 9 | public C1() {} 10 | 11 | public C1(C2 c2) {this.c2 = c2;} 12 | 13 | public void method() {c2.method();} 14 | 15 | public void method(String string) {c2.method();} 16 | 17 | } 18 | 19 | class C2 { 20 | 21 | C1 c1 = new C1(); 22 | 23 | public void method() { 24 | c1 = new C1(); 25 | c1 = new C1(this); 26 | c1.method(); 27 | c1.method(""); 28 | } 29 | 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /codes/javatech/javatech-mq/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | io.github.dunwu.javatech 8 | javatech-mq 9 | 1.0.0 10 | pom 11 | JAVATECH-MQ示例 12 | 13 | 14 | javatech-kafka 15 | javatech-kafka-springboot 16 | javatech-rocketmq 17 | 18 | 19 | -------------------------------------------------------------------------------- /codes/javatech/javatech-others/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | io.github.dunwu.javatech 8 | javatech-others 9 | 1.0.0 10 | pom 11 | JAVATECH-其他示例 12 | 13 | 14 | javatech-cli 15 | javatech-ruleengine 16 | javatech-zookeeper 17 | 18 | 19 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jstl/src/main/webapp/examples/uncheck/import.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" %> 2 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 3 | 4 | 5 | 6 | 7 | Insert title here 8 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | Baidu 的源代码为: 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jstl/src/main/webapp/examples/xml/x_parse.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8" %> 3 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 4 | <%@ taglib prefix="x" uri="http://java.sun.com/jsp/jstl/xml" %> 5 | 6 | 7 | 8 | x:parse 标签 9 | 10 | 11 |

Books Info:

12 | 13 | 14 | 15 | The title of the first book is: 16 | 17 |
18 | The price of the second book: 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /codes/javaee/javaee-taglib/src/main/java/io/github/dunwu/javaee/taglib/HelloTag2.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The Apache License 2.0 Copyright (c) 2017 Zhang Peng 3 | */ 4 | package io.github.dunwu.javaee.taglib; 5 | 6 | import java.io.IOException; 7 | import java.io.StringWriter; 8 | import javax.servlet.jsp.JspException; 9 | import javax.servlet.jsp.tagext.SimpleTagSupport; 10 | 11 | /** 12 | * @author Zhang Peng 13 | * @since 2017/4/3. 14 | */ 15 | public class HelloTag2 extends SimpleTagSupport { 16 | 17 | StringWriter sw = new StringWriter(); 18 | 19 | public void doTag() throws JspException, IOException { 20 | getJspBody().invoke(sw); 21 | getJspContext().getOut().println(sw.toString()); 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /codes/deadloop/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port = 8888 2 | #server.port = ${random.int[1024,65536]} 3 | spring.datasource.url = jdbc:mysql://172.22.6.9:3316/trouble_shooting?serverTimezone=UTC&useUnicode=true&characterEncoding=utf8 4 | #spring.datasource.url = jdbc:mysql://172.22.6.9:3316/trouble_shooting?serverTimezone=UTC&useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true 5 | spring.datasource.driver-class-name = com.mysql.cj.jdbc.Driver 6 | spring.datasource.username = root 7 | spring.datasource.password = 604330436 8 | # 强制每次启动使用 sql 初始化数据,本项目仅为了演示方便,真实环境应避免这种模式 9 | spring.datasource.initialization-mode = ALWAYS 10 | spring.datasource.schema = classpath:sql/schema.sql 11 | spring.datasource.data = classpath:sql/data.sql 12 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jsp/src/main/webapp/views/jsp/el.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" pageEncoding="UTF-8" %> 2 | 3 | <%! 4 | String ss1 = "ss String"; 5 | %> 6 | <% 7 | %> 8 | 9 | 10 | My JSP 'el.jsp' starting page 11 | 12 | 13 | 14 | 15 | 16 | 19 | 20 | 21 | 22 | 23 | ${not (1==2) } 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jstl/src/main/webapp/examples/fmt/fmt_requestEncoding.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8" %> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 4 | <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> 5 | 6 | 7 | fmt:message 标签 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 |
17 |
18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jstl/src/main/webapp/examples/core/c_param.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8" %> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 4 | 5 | 6 | c:forTokens 标签实例 7 | 8 | 9 |

<c:param> 实例

10 | 11 | 12 | 13 | 14 | <%-- 15 | 16 | 17 | 18 | "> 19 | 使用 <c:param> 为指定URL发送两个参数。--%> 20 | 21 | 22 | -------------------------------------------------------------------------------- /codes/javatech/javatech-lib/src/main/java/io/github/dunwu/javatech/bean/sample/User.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.javatech.bean.sample; 2 | 3 | public class User { 4 | 5 | private Long id; 6 | 7 | private String name; 8 | 9 | public User() { 10 | } 11 | 12 | public User(Long id, String name) { 13 | this.id = id; 14 | this.name = name; 15 | } 16 | 17 | public Long getId() { 18 | return id; 19 | } 20 | 21 | public User setId(Long id) { 22 | this.id = id; 23 | return this; 24 | } 25 | 26 | public String getName() { 27 | return name; 28 | } 29 | 30 | public User setName(String name) { 31 | this.name = name; 32 | return this; 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /docs/01.Java/11.软件/03.监控诊断/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Java 监控诊断 3 | date: 2020-02-11 17:48:32 4 | categories: 5 | - Java 6 | - 软件 7 | - 监控诊断 8 | tags: 9 | - Java 10 | - 监控 11 | - 诊断 12 | permalink: /pages/3d16d3/ 13 | hidden: true 14 | index: false 15 | --- 16 | 17 | # Java 监控诊断 18 | 19 | ## 内容 20 | 21 | - [监控工具对比](01.监控工具对比.md) 22 | - [CAT](02.CAT.md) 23 | - [Zipkin](03.Zipkin.md) 24 | - [SkyWalking](04.Skywalking.md) 25 | - [Arthas](05.Arthas.md) 26 | 27 | ## 资料 28 | 29 | - [CAT Github](https://github.com/dianping/cat) 30 | - [Zipkin Github](https://github.com/openzipkin/zipkin) 31 | - [SkyWalking Github](https://github.com/apache/skywalking) 32 | - [PinPoint Github](https://github.com/naver/pinpoint) 33 | - [Arthas Github](https://github.com/alibaba/arthas) -------------------------------------------------------------------------------- /codes/javatech/javatech-lib/src/main/java/io/github/dunwu/javatech/seriralize/util/User.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.javatech.seriralize.util; 2 | 3 | public class User { 4 | 5 | private Long id; 6 | 7 | private String name; 8 | 9 | public User() { 10 | } 11 | 12 | public User(Long id, String name) { 13 | this.id = id; 14 | this.name = name; 15 | } 16 | 17 | public Long getId() { 18 | return id; 19 | } 20 | 21 | public User setId(Long id) { 22 | this.id = id; 23 | return this; 24 | } 25 | 26 | public String getName() { 27 | return name; 28 | } 29 | 30 | public User setName(String name) { 31 | this.name = name; 32 | return this; 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /codes/trouble-shooting/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port = 8888 2 | #server.port = ${random.int[1024,65536]} 3 | #spring.datasource.url = jdbc:mysql://172.22.6.9:3316/trouble_shooting?serverTimezone=UTC&useUnicode=true&characterEncoding=utf8 4 | spring.datasource.url = jdbc:mysql://172.22.6.9:3316/trouble_shooting?serverTimezone=UTC&useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true 5 | spring.datasource.driver-class-name = com.mysql.cj.jdbc.Driver 6 | spring.datasource.username = root 7 | spring.datasource.password = 604330436 8 | # 强制每次启动使用 sql 初始化数据,本项目仅为了演示方便,真实环境应避免这种模式 9 | spring.datasource.initialization-mode = ALWAYS 10 | spring.datasource.schema = classpath:sql/schema.sql 11 | spring.datasource.data = classpath:sql/data.sql 12 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jstl/src/main/webapp/examples/uncheck/join.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" %> 2 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> 4 | <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> 5 | 6 | 7 | 8 | 9 | Insert title here 10 | 11 | 12 | 13 | <% 14 | request.setAttribute("array", new String[] {"John", "Tom", "Tommi", "Kurt",}); 15 | %> 16 | 17 | ${ fn:join(array, '; ') } 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /codes/javaee/javaee-listener/src/main/webapp/index.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" %> 2 | <% 3 | String path = request.getContextPath(); 4 | String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/"; 5 | %> 6 | 7 | 8 | 9 | 10 | 11 | javaee-listener 首页 12 | 13 | 14 | 15 | This is my JSP page.
16 | Listener
17 | active
18 | 登录
19 | 在线用户统计
20 | Listener
21 | 22 | 23 | -------------------------------------------------------------------------------- /codes/javatech/javatech-log/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | io.github.dunwu.javatech 8 | javatech-log 9 | 1.0.0 10 | pom 11 | JAVATECH-日志示例 12 | 13 | 14 | javatech-log4j 15 | javatech-log4j2 16 | javatech-logback 17 | javatech-logstash 18 | 19 | 20 | -------------------------------------------------------------------------------- /docs/01.Java/02.JavaEE/02.服务器/01.Tomcat/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Tomcat 教程 3 | date: 2022-02-18 08:53:11 4 | categories: 5 | - Java 6 | - JavaEE 7 | - 服务器 8 | - Tomcat 9 | tags: 10 | - Java 11 | - JavaWeb 12 | - 服务器 13 | - Tomcat 14 | permalink: /pages/33e817/ 15 | hidden: true 16 | index: false 17 | --- 18 | 19 | # Tomcat 教程 20 | 21 | ## 📖 内容 22 | 23 | - [Tomcat 快速入门](01.Tomcat快速入门.md) 24 | - [Tomcat 连接器](02.Tomcat连接器.md) 25 | - [Tomcat 容器](03.Tomcat容器.md) 26 | - [Tomcat 优化](04.Tomcat优化.md) 27 | - [Tomcat 和 Jetty](05.Tomcat和Jetty.md) 28 | 29 | ## 📚 资料 30 | 31 | - [Tomcat 官网](http://tomcat.apache.org/) 32 | - [深入拆解 Tomcat & Jetty](https://time.geekbang.org/column/intro/100027701) 33 | 34 | ## 🚪 传送 35 | 36 | ◾ 💧 [钝悟的 IT 知识图谱](https://dunwu.github.io/waterdrop/) ◾ -------------------------------------------------------------------------------- /codes/javaee/javaee-filter/src/main/webapp/views/jsp/exception.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %> 2 | 3 | 4 | 5 | 6 | exception 7 | 16 | 17 | 18 | 19 |
20 | ${ message } 返回 21 |
22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jstl/src/main/webapp/examples/fmt/fmt_setTimeZone.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8" %> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 4 | <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> 5 | 6 | 7 | fmt:setTimeZone 标签 8 | 9 | 10 | 11 |

当前时区时间:

13 |

修改为 GMT-8 时区:

14 | 15 |

Date in Changed Zone:

17 | 18 | 19 | -------------------------------------------------------------------------------- /codes/javaee/javaee-oss/src/main/java/io/github/dunwu/javaee/oss/logging/Slf4jDemo.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The Apache License 2.0 Copyright (c) 2016 Victor Zhang 3 | */ 4 | package io.github.dunwu.javaee.oss.logging; 5 | 6 | import org.slf4j.Logger; 7 | import org.slf4j.LoggerFactory; 8 | 9 | /** 10 | * 测试 slf4j + logback 输出日志 11 | * 12 | * @author Victor Zhang 13 | * @since 2016/11/18. 14 | */ 15 | public class Slf4jDemo { 16 | 17 | private static final Logger log = LoggerFactory.getLogger(Slf4jDemo.class); 18 | 19 | public static void main(String[] args) { 20 | String msg = "print log, current level: {}"; 21 | log.trace(msg, "trace"); 22 | log.debug(msg, "debug"); 23 | log.info(msg, "info"); 24 | log.warn(msg, "warn"); 25 | log.error(msg, "error"); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /codes/javatech/javatech-cache/src/main/java/io/github/dunwu/javatech/cache/CaffeineDemo.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.javatech.cache; 2 | 3 | import com.github.benmanes.caffeine.cache.Cache; 4 | import com.github.benmanes.caffeine.cache.Caffeine; 5 | 6 | import java.util.concurrent.TimeUnit; 7 | 8 | /** 9 | * @author Zhang Peng 10 | * @since 2020-07-09 11 | */ 12 | public class CaffeineDemo { 13 | 14 | public static void main(String[] args) { 15 | Cache cache = Caffeine.newBuilder() 16 | .expireAfterWrite(1, TimeUnit.SECONDS) 17 | .expireAfterAccess(1, TimeUnit.SECONDS) 18 | .maximumSize(10) 19 | .build(); 20 | cache.put("hello", "hello"); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /codes/javatech/javatech-lib/src/test/java/io/github/dunwu/javatech/java/samples/CaptchaTypeEnum.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.javatech.java.samples; 2 | 3 | /** 4 | * 验证码类型枚举 5 | * 6 | * @author peng.zhang 7 | * @date 2021-09-24 8 | */ 9 | public enum CaptchaTypeEnum { 10 | /** 11 | * 算数 12 | */ 13 | ARITHMETIC(1), 14 | /** 15 | * 中文 16 | */ 17 | CHINESE(2), 18 | /** 19 | * 中文闪图 20 | */ 21 | CHINESE_GIF(3), 22 | /** 23 | * 闪图 24 | */ 25 | GIF(4), 26 | /** 27 | * 数字大写字母 28 | */ 29 | SPEC(5); 30 | 31 | private final int code; 32 | 33 | CaptchaTypeEnum(int code) { 34 | this.code = code; 35 | } 36 | 37 | public int getCode() { 38 | return code; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /codes/javaee/javaee-websocket/src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | SocketServlet 10 | 11 | io.github.dunwu.javaee.servlet.SocketServlet 12 | 13 | 14 | 15 | SocketServlet 16 | /sock/* 17 | 18 | 19 | 20 | index.jsp 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /codes/javatech/javatech-lib/src/test/java/io/github/dunwu/javatech/java/samples/CodeBiEnum.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.javatech.java.samples; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Getter; 5 | 6 | /** 7 | * 验证码业务场景 8 | */ 9 | @Getter 10 | @AllArgsConstructor 11 | public enum CodeBiEnum { 12 | 13 | /* 旧邮箱修改邮箱 */ 14 | ONE(1, "旧邮箱修改邮箱"), 15 | 16 | /* 通过邮箱修改密码 */ 17 | TWO(2, "通过邮箱修改密码"); 18 | 19 | private final Integer code; 20 | private final String description; 21 | 22 | public static CodeBiEnum find(Integer code) { 23 | for (CodeBiEnum value : CodeBiEnum.values()) { 24 | if (code.equals(value.getCode())) { 25 | return value; 26 | } 27 | } 28 | return null; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /codes/javatech/javatech-cache/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.datasource.url = jdbc:mysql://localhost:3306/spring_boot_tutorial?serverTimezone=UTC&useUnicode=true&characterEncoding=utf8&useSSL=false 2 | spring.datasource.driver-class-name = com.mysql.cj.jdbc.Driver 3 | spring.datasource.username = root 4 | spring.datasource.password = root 5 | # 强制每次启动使用 sql 初始化数据,本项目仅为了演示方便,真实环境应避免这种模式 6 | spring.datasource.initialization-mode = ALWAYS 7 | spring.datasource.schema = classpath:sql/schema.sql 8 | spring.datasource.data = classpath:sql/data.sql 9 | #spring.redis.database = 0 10 | #spring.redis.host = localhost 11 | #spring.redis.port = 6379 12 | #spring.redis.password = 13 | spring.cache.type = simple 14 | spring.cache.cache-names = dunwu 15 | spring.cache.redis.time-to-live = 60s 16 | -------------------------------------------------------------------------------- /codes/java-distributed/java-load-balance/src/main/java/io/github/dunwu/distributed/RandomLoadBalance.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.distributed; 2 | 3 | import java.util.List; 4 | import java.util.Random; 5 | 6 | /** 7 | * (加权)随机负载均衡策略 8 | * 9 | * @author Zhang Peng 10 | * @see Zhang Peng 11 | * @since 2020-01-20 12 | */ 13 | public class RandomLoadBalance extends BaseLoadBalance implements LoadBalance { 14 | 15 | private final Random random = new Random(); 16 | 17 | @Override 18 | protected N doSelect(List nodes, String ip) { 19 | int index = random.nextInt(nodes.size()); 20 | return nodes.get(index); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jstl/src/main/webapp/examples/function/fn_split.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8" %> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 4 | <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> 5 | 6 | 7 | 使用 JSTL 函数 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |

string3 字符串 : ${string3}

16 | 17 | 18 | 19 | 20 |

string5 字符串: ${string5}

21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jstl/src/main/webapp/examples/uncheck/catch.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" %> 2 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 3 | 4 | 5 | 6 | 7 | Insert title here 8 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 程序抛出了异常 ${ e.class.name },原因: ${ e.message } 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /codes/javatech/javatech-lib/src/main/java/io/github/dunwu/javatech/bean/lombok/ToStringDemo.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.javatech.bean.lombok; 2 | 3 | import lombok.ToString; 4 | 5 | /** 6 | * @author Zhang Peng 7 | * @since 2019-11-22 8 | */ 9 | @ToString(callSuper = true, exclude = "someExcludedField") 10 | public class ToStringDemo { 11 | 12 | private boolean someBoolean = true; 13 | 14 | private String someStringField; 15 | 16 | private float someExcludedField; 17 | 18 | public ToStringDemo(boolean someBoolean, String someStringField, float someExcludedField) { 19 | this.someBoolean = someBoolean; 20 | this.someStringField = someStringField; 21 | this.someExcludedField = someExcludedField; 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /codes/javaee/javaee-filter/src/main/webapp/views/jsp/businessException.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %> 2 | 3 | 4 | 5 | 6 | businessException 7 | 16 | 17 | 18 | 19 |
20 | ${ message } 返回 21 |
22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jstl/src/main/webapp/examples/function/fn_escapeXml.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8" %> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 4 | <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> 5 | 6 | 7 | Using JSTL Functions 8 | 9 | 10 | 11 | 12 | 13 | 14 |

使用 escapeXml() 函数:

15 |

string (1) : ${fn:escapeXml(string1)}

16 |

string (2) : ${fn:escapeXml(string2)}

17 | 18 |

不使用 escapeXml() 函数:

19 |

string (1) : ${string1}

20 |

string (2) : ${string2}

21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /codes/javaee/javaee-taglib/src/main/java/io/github/dunwu/javaee/taglib/tags/HelloTag.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.javaee.taglib.tags; 2 | 3 | import javax.servlet.jsp.JspException; 4 | import javax.servlet.jsp.tagext.TagSupport; 5 | 6 | public class HelloTag extends TagSupport { 7 | 8 | private static final long serialVersionUID = -8828591126748246256L; 9 | 10 | private String name; 11 | 12 | @Override 13 | public int doEndTag() throws JspException { 14 | 15 | try { 16 | this.pageContext.getOut().println("Hello, " + name); 17 | } catch (Exception e) { 18 | throw new JspException(e); 19 | } 20 | 21 | return EVAL_PAGE; 22 | } 23 | 24 | public String getName() { 25 | return name; 26 | } 27 | 28 | public void setName(String name) { 29 | this.name = name; 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jstl/src/main/webapp/examples/uncheck/parseDate.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" %> 2 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> 4 | 5 | 6 | 7 | 8 | Insert title here 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jstl/src/main/webapp/examples/xml/x_set.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 2 | <%@ taglib prefix="x" uri="http://java.sun.com/jsp/jstl/xml" %> 3 | 4 | 5 | 6 | x:set 标签 7 | 8 | 9 |

Books Info:

10 | 11 | 12 | 13 | 14 | Padam History 15 | ZARA 16 | 100 17 | 18 | 19 | Great Mistry 20 | NUHA 21 | 2000 22 | 23 | 24 | 25 | 26 | 27 | 28 | The price of the second book: 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jstl/src/main/webapp/xml/style.xsl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 23 | 26 | 29 | 30 | 31 |
19 | 20 | 21 | 22 | 24 | 25 | 27 | 28 |
32 |
33 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jsp/src/main/webapp/examples/02.grammar/switch.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8" %> 3 | <%! int day = 3; %> 4 | 5 | 6 | 7 | 8 | 02.JSP语法 - switch...case示例 9 | 10 | 11 |

Sswitch...case示例

12 | <% 13 | switch (day) { 14 | case 0: 15 | out.println("星期天"); 16 | break; 17 | case 1: 18 | out.println("星期一"); 19 | break; 20 | case 2: 21 | out.println("星期二"); 22 | break; 23 | case 3: 24 | out.println("星期三"); 25 | break; 26 | case 4: 27 | out.println("星期四"); 28 | break; 29 | case 5: 30 | out.println("星期五"); 31 | break; 32 | default: 33 | out.println("星期六"); 34 | } 35 | %> 36 | 37 | 38 | -------------------------------------------------------------------------------- /codes/javaee/javaee-listener/src/main/java/io/github/dunwu/javaee/listener/util/ApplicationConstants.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.javaee.listener.util; 2 | 3 | import java.util.Date; 4 | import java.util.HashMap; 5 | import java.util.Map; 6 | import javax.servlet.http.HttpSession; 7 | 8 | public class ApplicationConstants { 9 | 10 | // 所有的 Session 11 | public static Map SESSION_MAP = new HashMap(); 12 | 13 | // 当前登录的用户总数 14 | public static int CURRENT_LOGIN_COUNT = 0; 15 | 16 | // 历史访客总数 17 | public static int TOTAL_HISTORY_COUNT = 0; 18 | 19 | // 服务器启动时间 20 | public static Date START_DATE = new Date(); 21 | 22 | // 最高在线时间 23 | public static Date MAX_ONLINE_COUNT_DATE = new Date(); 24 | 25 | // 最高在线人数 26 | public static int MAX_ONLINE_COUNT = 0; 27 | 28 | } 29 | -------------------------------------------------------------------------------- /utils/modules/fn.js: -------------------------------------------------------------------------------- 1 | // 类型判断 2 | exports.type = function (o) { 3 | var s = Object.prototype.toString.call(o) 4 | return s.match(/\[object (.*?)\]/)[1].toLowerCase() 5 | } 6 | 7 | // 修复date时区格式的问题 8 | exports.repairDate = function (date) { 9 | date = new Date(date) 10 | return `${date.getUTCFullYear()}-${zero(date.getUTCMonth() + 1)}-${zero(date.getUTCDate())} ${zero( 11 | date.getUTCHours() 12 | )}:${zero(date.getUTCMinutes())}:${zero(date.getUTCSeconds())}` 13 | } 14 | 15 | // 日期的格式 16 | exports.dateFormat = function (date) { 17 | return `${date.getFullYear()}-${zero(date.getMonth() + 1)}-${zero(date.getDate())} ${zero(date.getHours())}:${zero( 18 | date.getMinutes() 19 | )}:${zero(date.getSeconds())}` 20 | } 21 | 22 | // 小于10补0 23 | function zero(d) { 24 | return d.toString().padStart(2, '0') 25 | } -------------------------------------------------------------------------------- /codes/javaee/javaee-filter/src/main/webapp/views/jsp/testCharacterEncodingFilter.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" %> 2 | 3 | 4 | 5 | 6 | Insert title here 7 | 17 | 18 | 19 |
20 | 您输入了:
21 | ${ param.text }
22 | 
23 |

25 |
26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /codes/javaee/javaee-websocket/src/main/java/io/github/dunwu/javaee/websocket/WebSocketServerConfigurator.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.javaee.websocket; 2 | 3 | import javax.servlet.http.HttpSession; 4 | import javax.websocket.HandshakeResponse; 5 | import javax.websocket.server.HandshakeRequest; 6 | import javax.websocket.server.ServerEndpointConfig; 7 | 8 | /** 9 | * @author Zhang Peng 10 | */ 11 | public class WebSocketServerConfigurator extends ServerEndpointConfig.Configurator { 12 | 13 | @Override 14 | public void modifyHandshake(ServerEndpointConfig sec, HandshakeRequest request, HandshakeResponse response) { 15 | HttpSession httpSession = (HttpSession) request.getHttpSession(); 16 | sec.getUserProperties().put(HttpSession.class.getName(), httpSession); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /codes/javatech/javatech-lib/src/main/java/io/github/dunwu/javatech/bean/lombok/Person.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.javatech.bean.lombok; 2 | 3 | import lombok.Data; 4 | import lombok.EqualsAndHashCode; 5 | import lombok.ToString; 6 | 7 | /** 8 | * @Data@ToString@EqualsAndHashCode 示例 9 | * 10 | * @author Zhang Peng 11 | * @see @Data 12 | * 、@ToString@EqualsAndHashCode 13 | * @since 2019-11-22 14 | */ 15 | @Data 16 | @ToString(exclude = "age") 17 | @EqualsAndHashCode(exclude = { "age", "sex" }) 18 | public class Person { 19 | 20 | protected String name; 21 | 22 | protected Integer age; 23 | 24 | protected String sex; 25 | 26 | } 27 | -------------------------------------------------------------------------------- /codes/java-distributed/java-load-balance/src/main/java/io/github/dunwu/distributed/support/FnvHashStrategy.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.distributed.support; 2 | 3 | public class FnvHashStrategy implements HashStrategy { 4 | 5 | private static final long FNV_32_INIT = 2166136261L; 6 | 7 | private static final int FNV_32_PRIME = 16777619; 8 | 9 | @Override 10 | public int hashCode(String key) { 11 | final int p = FNV_32_PRIME; 12 | int hash = (int) FNV_32_INIT; 13 | for (int i = 0; i < key.length(); i++) 14 | hash = (hash ^ key.charAt(i)) * p; 15 | hash += hash << 13; 16 | hash ^= hash >> 7; 17 | hash += hash << 3; 18 | hash ^= hash >> 17; 19 | hash += hash << 5; 20 | hash = Math.abs(hash); 21 | return hash; 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /codes/javatech/javatech-cache/src/test/java/io/github/dunwu/javatech/cache/LRUCacheTest.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.javatech.cache; 2 | 3 | import org.junit.jupiter.api.Assertions; 4 | import org.junit.jupiter.api.Test; 5 | 6 | /** 7 | * @author Zhang Peng 8 | * @since 2020-01-18 9 | */ 10 | public class LRUCacheTest { 11 | 12 | @Test 13 | public void test() { 14 | LRUCache cache = new LRUCache(2); 15 | Assertions.assertNull(cache.get(2)); 16 | cache.put(2, "B"); 17 | Assertions.assertNull(cache.get(1)); 18 | cache.put(1, "A"); 19 | cache.put(3, "C"); 20 | Assertions.assertEquals("A", cache.get(1)); 21 | Assertions.assertEquals(null, cache.get(2)); 22 | Assertions.assertEquals("C", cache.get(3)); 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jstl/src/main/webapp/examples/uncheck/escapeXml.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" %> 2 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> 4 | <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> 5 | 6 | 7 | 8 | 9 | Insert title here 10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | ${ fn:escapeXml(source) } 18 |
19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jstl/src/main/webapp/examples/uncheck/substring.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" %> 2 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> 4 | <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> 5 | 6 | 7 | 8 | 9 | Insert title here 10 | 11 | 12 | 13 | liujhua@cn.ibm.com 14 | ${ fn:substring(email, 0, fn:indexOf(email, '@') ) } 15 | 16 | ${ fn:substringBefore(email, '@') } 17 | 18 | ${ fn:substringAfter(email, '@') } 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /codes/javaee/javaee-oss/src/main/java/io/github/dunwu/javaee/oss/logging/JclDemo.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The Apache License 2.0 Copyright (c) 2016 Victor Zhang 3 | */ 4 | package io.github.dunwu.javaee.oss.logging; 5 | 6 | import org.apache.commons.logging.Log; 7 | import org.apache.commons.logging.LogFactory; 8 | 9 | /** 10 | * 测试 common-logging + log4j 输出日志 11 | * 12 | * @author Victor Zhang 13 | * @since 2016/11/18. 14 | */ 15 | public class JclDemo { 16 | 17 | private static final Log log = LogFactory.getLog(JclDemo.class); 18 | 19 | public static void main(String[] args) { 20 | String msg = "print logging, current level: "; 21 | log.trace(msg + "trace"); 22 | log.debug(msg + "debug"); 23 | log.info(msg + "info"); 24 | log.warn(msg + "warn"); 25 | log.error(msg + "error"); 26 | log.fatal(msg + "fatal"); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /codes/javaee/javaee-taglib/src/main/java/io/github/dunwu/javaee/taglib/tags/AddTag.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.javaee.taglib.tags; 2 | 3 | import javax.servlet.jsp.JspException; 4 | import javax.servlet.jsp.tagext.TagSupport; 5 | 6 | public class AddTag extends TagSupport { 7 | 8 | private static final long serialVersionUID = -579746915908972833L; 9 | 10 | private int num1; 11 | 12 | private int num2; 13 | 14 | public void setNum1(int num1) { 15 | this.num1 = num1; 16 | } 17 | 18 | public void setNum2(int num2) { 19 | this.num2 = num2; 20 | } 21 | 22 | @Override 23 | public int doEndTag() throws JspException { 24 | try { 25 | this.pageContext.getOut().println(num1 + " + " + num2 + " = " + (num1 + num2)); 26 | } catch (Exception e) { 27 | e.printStackTrace(); 28 | } 29 | return EVAL_PAGE; 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /codes/javatech/javatech-others/javatech-ruleengine/src/main/java/io/github/dunwu/javatech/rule/eazyrules/WeatherRule.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.javatech.rule.eazyrules; 2 | 3 | import org.jeasy.rules.annotation.Action; 4 | import org.jeasy.rules.annotation.Condition; 5 | import org.jeasy.rules.annotation.Fact; 6 | import org.jeasy.rules.annotation.Rule; 7 | 8 | /** 9 | * @author Zhang Peng 10 | * @since 2020-05-15 11 | */ 12 | @Rule(name = "weather rule", description = "if it rains then take an umbrella" ) 13 | public class WeatherRule { 14 | 15 | @Condition 16 | public boolean itRains(@Fact("rain") boolean rain) { 17 | return rain; 18 | } 19 | 20 | @Action 21 | public void takeAnUmbrella() { 22 | System.out.println("It rains, take an umbrella!"); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jsp/src/main/webapp/views/jsp/directive/include/head.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=utf-8" %> 2 | 3 | 4 | JSP指令include范例 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 |
JSP指令include范例
首页资源文档下载关于邮件社区
24 | -------------------------------------------------------------------------------- /codes/javaee/javaee-taglib/src/main/java/io/github/dunwu/javaee/taglib/tags2/MultiTag.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.javaee.taglib.tags2; 2 | 3 | import java.io.IOException; 4 | import javax.servlet.jsp.JspException; 5 | import javax.servlet.jsp.tagext.SimpleTagSupport; 6 | 7 | public class MultiTag extends SimpleTagSupport { 8 | 9 | private int num1; 10 | 11 | private int num2; 12 | 13 | @Override 14 | public void doTag() throws JspException, IOException { 15 | this.getJspContext().getOut().write("" + num1 + " * " + num2 + " = " + (num1 * num2)); 16 | } 17 | 18 | public int getNum1() { 19 | return num1; 20 | } 21 | 22 | public void setNum1(int num1) { 23 | this.num1 = num1; 24 | } 25 | 26 | public int getNum2() { 27 | return num2; 28 | } 29 | 30 | public void setNum2(int num2) { 31 | this.num2 = num2; 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | io.github.dunwu.java 7 | java-tutorial 8 | 1.0.0 9 | pom 10 | JAVA-TUTORIAL 11 | 12 | 13 | codes/java-distributed 14 | codes/javaee 15 | codes/javatech 16 | codes/javatool 17 | codes/trouble-shooting 18 | codes/deadloop 19 | 20 | 21 | -------------------------------------------------------------------------------- /codes/java-distributed/java-load-balance/src/main/java/io/github/dunwu/distributed/IpHashLoadBalance.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.distributed; 2 | 3 | import cn.hutool.core.util.HashUtil; 4 | import cn.hutool.core.util.StrUtil; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * @author peng.zhang 10 | * @date 2021/1/19 11 | */ 12 | public class IpHashLoadBalance extends BaseLoadBalance implements LoadBalance { 13 | 14 | @Override 15 | protected N doSelect(List nodes, String ip) { 16 | if (StrUtil.isBlank(ip)) { 17 | ip = "127.0.0.1"; 18 | } 19 | 20 | int length = nodes.size(); 21 | int index = hash(ip) % length; 22 | return nodes.get(index); 23 | } 24 | 25 | public int hash(String text) { 26 | return HashUtil.fnvHash(text); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /codes/javatech/javatech-cache/src/test/resources/ehcache/ehcache1.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 17 | 18 | 19 | 26 | 27 | -------------------------------------------------------------------------------- /codes/javatech/javatech-cache/src/test/resources/ehcache/ehcache2.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 17 | 18 | 19 | 26 | 27 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jstl/src/main/webapp/examples/uncheck/length.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" %> 2 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> 4 | <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> 5 | 6 | 7 | 8 | 9 | Insert title here 10 | 11 | 12 | 13 | "${ pageContext.request.requestURL }" 的长度:${ fn:length(pageContext.request.requestURI) }
14 | Cookie[] 的长度:${ fn:length(pageContext.request.cookies) }
15 | Map header 的长度: ${ fn:length(header) }
16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jstl/src/main/webapp/examples/uncheck/split.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" %> 2 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> 4 | <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> 5 | 6 | 7 | 8 | 9 | Insert title here 10 | 11 | 12 | ${ header['accept'] } 13 | 14 | 15 | header['accept']:

16 | 17 | ${ name }
18 |
19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /codes/javaee/javaee-session/src/main/webapp/views/jsp/cookie/maxAge.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" pageEncoding="UTF-8" %> 2 | <% 3 | Cookie cookie = new Cookie("username", "helloweenvsfei"); 4 | cookie.setMaxAge(0); 5 | 6 | // 必须执行这一句 7 | response.addCookie(cookie); 8 | 9 | %> 10 | 11 | 12 | 13 | 14 | Cookie maxAge 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | This is my JSP page.
25 | 26 | 27 | -------------------------------------------------------------------------------- /codes/javatech/javatech-mq/javatech-kafka-springboot/src/test/java/io/github/dunwu/javatech/KafkaProducerTest.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.javatech; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.boot.test.context.SpringBootTest; 7 | import org.springframework.test.context.junit4.SpringRunner; 8 | 9 | /** 10 | * @author Zhang Peng 11 | * @since 2018-11-29 12 | */ 13 | @RunWith(SpringRunner.class) 14 | @SpringBootTest(classes = MsgKafkaApplication.class) 15 | public class KafkaProducerTest { 16 | 17 | @Autowired 18 | private KafkaProducer kafkaProducer; 19 | 20 | @Test 21 | public void test() { 22 | kafkaProducer.sendTransactionMsg("test", "上联:天王盖地虎"); 23 | kafkaProducer.sendTransactionMsg("test", "下联:宝塔镇河妖"); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /codes/javatech/javatech-server/src/main/webapp/views/jsp/index.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %> 2 | <% 3 | String path = request.getContextPath(); 4 | String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/"; 5 | %> 6 | 7 | 8 | 9 | 10 | javatool 11 | 12 | 13 | 14 |

javatool

15 |

<%out.print("Server Ip:" + basePath);%>

16 |
17 |

示例列表

18 | 26 |
27 | 28 | 29 | -------------------------------------------------------------------------------- /docs/01.Java/11.软件/03.监控诊断/01.监控工具对比.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 监控工具对比 3 | date: 2020-02-11 17:48:32 4 | order: 01 5 | categories: 6 | - Java 7 | - 软件 8 | - 监控诊断 9 | tags: 10 | - Java 11 | - 监控 12 | permalink: /pages/16563a/ 13 | --- 14 | 15 | # 监控工具对比 16 | 17 | ## 监控工具发展史 18 | 19 | ![img](https://raw.githubusercontent.com/dunwu/images/master/snap/20200211165813.png) 20 | 21 | ## 监控工具比对 22 | 23 | ### 特性对比 24 | 25 | ![img](https://raw.githubusercontent.com/dunwu/images/master/snap/20200211171551.png) 26 | 27 | ### 生态对比 28 | 29 | ![img](https://raw.githubusercontent.com/dunwu/images/master/snap/20200211172631.png) 30 | 31 | ## 技术选型 32 | 33 | - Zipkin 欠缺 APM 报表能力,不推荐。 34 | - 企业级,推荐 CAT 35 | - 关注和试点 SkyWalking。 36 | 37 | 用好调用链监控,需要订制化、自研能力。 38 | 39 | ## 参考资料 40 | 41 | [CAT、Zipkin 和 SkyWalking 该如何选型?](https://time.geekbang.org/dailylesson/detail/100028416) -------------------------------------------------------------------------------- /codes/javaee/javaee-jstl/src/main/webapp/examples/xml/x_transform.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8" %> 3 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 4 | <%@ taglib prefix="x" uri="http://java.sun.com/jsp/jstl/xml" %> 5 | 6 | 7 | 8 | x:transform 标签 9 | 10 | 11 |

Books Info:

12 | 13 | 14 | 15 | Padam History 16 | ZARA 17 | 100 18 | 19 | 20 | Great Mistry 21 | NUHA 22 | 2000 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /codes/javatech/javatech-mq/javatech-kafka-springboot/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.kafka.bootstrap-servers=tdh60dev01:9092,tdh60dev02:9092,tdh60dev03:9092 2 | spring.kafka.producer.retries=3 3 | spring.kafka.producer.transaction-id-prefix=javaweb-kafka 4 | # producer 5 | spring.kafka.producer.batch-size=1000 6 | spring.kafka.producer.key-serializer=org.apache.kafka.common.serialization.StringSerializer 7 | spring.kafka.producer.value-serializer=org.apache.kafka.common.serialization.StringSerializer 8 | # consumer 9 | spring.kafka.consumer.group-id=javaweb 10 | spring.kafka.consumer.enable-auto-commit=true 11 | spring.kafka.consumer.auto-commit-interval=1000 12 | spring.kafka.consumer.key-deserializer=org.apache.kafka.common.serialization.StringDeserializer 13 | spring.kafka.consumer.value-deserializer=org.apache.kafka.common.serialization.StringDeserializer 14 | -------------------------------------------------------------------------------- /codes/javaee/javaee-taglib/src/main/java/io/github/dunwu/javaee/taglib/tags/IteratorTag.java: -------------------------------------------------------------------------------- 1 | package io.github.dunwu.javaee.taglib.tags; 2 | 3 | import java.util.Collection; 4 | import javax.servlet.jsp.JspException; 5 | import javax.servlet.jsp.tagext.TagSupport; 6 | 7 | public class IteratorTag extends TagSupport { 8 | 9 | private static final long serialVersionUID = -8828591126748246256L; 10 | 11 | private Collection connection; 12 | 13 | @Override 14 | public int doEndTag() throws JspException { 15 | 16 | try { 17 | for (Object obj : connection) { 18 | this.pageContext.getOut().println(obj + ",
"); 19 | } 20 | } catch (Exception e) { 21 | throw new JspException(e); 22 | } 23 | 24 | return EVAL_PAGE; 25 | } 26 | 27 | public void setConnection(Collection connection) { 28 | this.connection = connection; 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /codes/javaee/javaee-jstl/src/main/webapp/examples/uncheck/setBundle.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" %> 2 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> 4 | 5 | 6 | 7 | 8 | Insert title here 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | Helloween 18 |
19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /codes/javaee/javaee-session/src/main/java/io/github/dunwu/javaee/cookie/bean/Topic.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The Apache License 2.0 Copyright (c) 2017 Zhang Peng 3 | */ 4 | package io.github.dunwu.javaee.cookie.bean; 5 | 6 | /** 7 | * @author Zhang Peng 8 | * @since 2017/3/26. 9 | */ 10 | public class Topic { 11 | 12 | private int id; 13 | 14 | private String title; 15 | 16 | private String content; 17 | 18 | public String getContent() { 19 | return content; 20 | } 21 | 22 | public void setContent(String content) { 23 | this.content = content; 24 | } 25 | 26 | public int getId() { 27 | return id; 28 | } 29 | 30 | public void setId(int id) { 31 | this.id = id; 32 | } 33 | 34 | public String getTitle() { 35 | return title; 36 | } 37 | 38 | public void setTitle(String title) { 39 | this.title = title; 40 | } 41 | 42 | } 43 | --------------------------------------------------------------------------------