Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to treat the problem of adding durid data sources to stusts2.

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

How to treat the problem of adding durid data sources to stusts2. Many novices are not very clear about this. In order to help you solve this problem, the following editor will explain it in detail. People with this need can come and learn. I hope you can gain something.

Download druid-1.0.19.jar (the old framework requires an old version)

Copy to the lib directory

Modify dataSource in infrastructureContext.xml

Web.xml adds to the strus2 filter

DruidWebStatFilter

Com.alibaba.druid.support.http.WebStatFilter

Exclusions

* .js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*,/download/*

DruidWebStatFilter

/ *

DruidStatView

Com.alibaba.druid.support.http.StatViewServlet

ResetEnable

False

DruidStatView

/ druid/*

Access after starting the project: http://localhost:9090/mytms2/druid/index.html turns on monitoring

Login problem, can not log in

4, possible problems

Sometimes there may be an error: there is not action mapped.

This is because struts2 treats / druid as an action and finds that an action named druid cannot be found, so an exception is thrown. One of the solutions is to add a suffix after action to distinguish and add to struts.xml:

one

No other changes are required to the configuration in struts.xml, but this suffix is required when using action. For example, the original form:

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report