求一段 修改 xml文件的java代码

[复制链接]
查看11 | 回复2 | 2008-6-8 00:50:24 | 显示全部楼层 |阅读模式
以下是web.xml
***********************



FilterEncoding
com.citsoft.servlet.filter.EncodingFilter
encoding
GB2312



FilterEncoding
/*

...................

This is the description of my J2EE component
This is the display name of my J2EE component
AddClassification
com.citsoft.servlet.AddClassification


This is the description of my J2EE component
This is the display name of my J2EE component
AlterPassword
com.citsoft.servlet.AlterPassword





**************************
上面的xml比如我想把 /*中的/*改称/teacher/*,用java该怎么实现 啊
我都说了,我不要固定 的,如果固定的话,我就不问了.我要做个动态的过滤器,过滤的IP不是固定不变的

回复

使用道具 举报

千问 | 2008-6-8 00:50:24 | 显示全部楼层
你直接改web.xml就好拉 使用配置文件本来就是为了解决业务发生变化时还要修改java代码的问题spring 就全部是配置文件 灵活性很强 也避免了 修改代码 只需修改配置文件就行
回复

使用道具 举报

千问 | 2008-6-8 00:50:24 | 显示全部楼层
若想用java来修改XML文件可能会不太好,会影响项目的规范性的,最好还是在web.xml文件里固定它就好了。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行