eclipse中关于struts出现问题研究

本文介绍了在Eclipse环境中遇到的Struts项目配置问题,当尝试打开struts-config.xml文件时,系统提示项目未配置为MyEclipse Web-Struts项目。解决方法是通过右键点击项目并选择"myeclipse"->"add struts capabilities"。此外,还提及了在Struts中如何将中文转换为Unicode,这一常见操作常用于配置文件的国际化处理。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1、打开struts-cofig .xml文件时提示出现问题

Project 'HelpConstract' is not configured as a MyEclipse Web-Struts Project. Therefore the MyEclipse Struts Editor may not be used with struts-config.xml. The default XML Editor has been used to open the file instead.
 解决方法:在项目上点击右键,选择“myeclipe”下的“add struts capabilities”即可解决

2、在Struts中,将中文转化为Unicode,经常用于配置文件中(*.properties)

例如:

  ApplicationResources_zh_CN.txt   中的内容

 index.heading=欢迎使用地址本!
    logon.title=点击这里进入!

 要将ApplicationResources_zh_CN.txt 中的中文转为为Unicode并且存储到ApplicationResources_zh_CN .properties文件中

 使用native2ascii命令(JDK自带)

 C:/> native2ascii -encoding GBK ApplicationResources_zh_CN.txt  ApplicationResources_zh_CN .properties

转换后的内容如下:

index.heading=/u6b22/u8fce/u4f7f/u7528/u5730/u5740/u672c!
    logon.title=/u70b9/u51fb/u8fd9/u91cc/u8fdb/u5165!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值